Skip to content

Instantly share code, notes, and snippets.

View Mainvooid's full-sized avatar

iPanda Mainvooid

  • Shanghai, China
View GitHub Profile
@Mainvooid
Mainvooid / log.cpp
Created April 17, 2019 09:03
调式日志封装 #C++ #windows
#include "log.h"
#include <windows.h>
#include <tchar.h>
#include <iostream>
void OutputDebugStringEx(const wchar_t * format, ...)
{
wchar_t buf[512];
va_list args;
va_start(args, format);
@Mainvooid
Mainvooid / imagefusion.cpp
Created April 16, 2019 06:14
图像拼接融合 #C++ #OpenCV
#include "test.h"
#include <iostream>
#include <opencv2/opencv.hpp>
#include "opencv2/stitching.hpp"
#include <opencv2/xfeatures2d.hpp>
#include "opencv2/xfeatures2d/cuda.hpp"
#include <opencv2/cudaimgproc.hpp>
#include "opencv2/features2d.hpp"
#include "opencv2/cudafeatures2d.hpp"
@Mainvooid
Mainvooid / D3D11Utils.cpp
Last active February 28, 2019 02:15
D3D常用辅助函数 #DirectX #C++
#include <d3d11.h>
#include <d3dx11.h>
/*
*@brief 创建texture配置
*@param textureDesc 保存Texture配置的对象
*@param width 宽度
*@param height 高度
*/
void createTextureDesc(D3D11_TEXTURE2D_DESC &textureDesc,int width, int height) {
ZeroMemory(&textureDesc, sizeof(textureDesc));
@Mainvooid
Mainvooid / printPlatformInfo.cpp
Last active March 6, 2019 07:18
ocl常用辅助类或函数 #OpenCL #C++
//DOCS:https://www.khronos.org/registry/OpenCL/sdk/1.2/docs/man/xhtml/
#include <CL/cl.h>
#include <CL/cl_d3d11_ext.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <stdlib.h>
class PlatformInfo
{
@Mainvooid
Mainvooid / luarefcpp.cpp
Last active February 27, 2019 08:01
Lua c++ 共享生命周期示例 #Lua #LuaBridge #C++
struct A
{
A() {}
int a=10;
static void regToLuaState(lua_State *L) {
luaL_openlibs(L);
getGlobalNamespace(L)
.beginNamespace("LuaCallFuncDll")
.beginClass <A>("A")
.addConstructor <void(*)(void)>()
@Mainvooid
Mainvooid / setQTByQuality.cpp
Last active January 3, 2019 04:26
根据编码质量修改原始量化表,NPP实现与普通实现对比 #C++ #NPP
#include <iostream>
#include <npp.h>
using namespace std;
unsigned char _STD_Y_QT[64] =
{
16, 11, 10, 16, 24, 40, 51, 61,
12, 12, 14, 19, 26, 58, 60, 55,
14, 13, 16, 24, 40, 57, 69, 56,
@Mainvooid
Mainvooid / cmdline.h
Last active April 28, 2019 08:48
cmdline c++命令行解析,只需包含头文件 #C++
#pragma once
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <string>
#include <stdexcept>
#include <typeinfo>
#include <cstring>
@Mainvooid
Mainvooid / deeplabv3_plus.py
Created December 5, 2018 08:46
keras实现deeplabv3+模型 #Keras #Python
from keras.layers import Activation,Conv2D,MaxPooling2D,BatchNormalization,Input,DepthwiseConv2D,add,Dropout,AveragePooling2D,Concatenate
from keras.models import Model
import keras.backend as K
from keras.engine import Layer,InputSpec
from keras.utils import conv_utils
class BilinearUpsampling(Layer):
def __init__(self, upsampling=(2, 2), data_format=None, **kwargs):
super(BilinearUpsampling, self).__init__(**kwargs)
@Mainvooid
Mainvooid / embedding.py
Created November 22, 2018 07:19
嵌入可视化 #TensorFlow #Python
# -*- coding: utf-8 -*-
# 嵌入可视化
import numpy as np
import tensorflow as tf
from tensorboard.plugins import projector
from tensorflow.examples.tutorials.mnist import input_data
import os
PATH_TO_MNIST_DATA = "MNIST_data"
LOG_DIR = "projector/data"
@Mainvooid
Mainvooid / xception.py
Created October 31, 2018 06:56
xception test #TensorFlow #Python
import numpy as np
import tensorflow as tf
model=tf.keras.applications.xception.Xception(include_top=True,
weights='imagenet',
input_tensor=None,
input_shape=None,
pooling=None,
classes=1000)