原创 MMDetection config下模型配置文件解讀

MMDetection config下模型配置文件解讀 faster_rcnn_r50_fpn_1x.py配置文件 #model settings model = dict( type='FasterRCNN',

原创 Pytorch1.4報RuntimeError: max_pool2d_with_indices_out_cuda_frame failed with error code 0

RuntimeError: max_pool2d_with_indices_out_cuda_frame failed with error code 0 問題描述 pytorch前向推理模型, 在1.3版本下可以運行, 但切換

原创 onnxruntime源碼編譯CMakeLists.txt中gpu參數設置

onnxruntime源碼編譯CMakeLists.txt中gpu參數設置 set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -gencode=arch=compute_62,code=sm_62

原创 解析MS-Celeb-1M人臉數據集中的FaceImageCroppedWithAlignment.tsv文件

下載並解壓微軟的大型人臉數據集MS-Celeb-1M後,將FaceImageCroppedWithAlignment.tsv文件還原成JPG圖片格式。代碼如下: import base64 import struct import

原创 c++ 圖片HWC格式轉CHW格式

c++ 圖片HWC格式轉CHW格式 vector<uint8_t> fileData(channels * height * width); float* hostInputBuffer = static_cast<float*>

原创 pytorch中model.eval的作用

pytorch中model.eval()的作用 問題描述: torch.onnx.export()導出onnx模型後,利用onnxruntime加載onnx模型後,其輸出結果與原始.pth模型的輸出結果之間存在很大的差距;通過拆分

原创 C++實現Non Maximum Suppression

C++實現Non Maximum Suppression std::vector<int> nonMaximumSuppression(std::vector<std::pair<float, int>>& scoreIndex

原创 ONNX模型轉MNN模型中permute使用說明

ONNX模型轉MNN模型中permute使用說明 問題描述:在利用TensorRT或MNN或OpenVINO等推理引擎加載ONNX模型的過程中,爲了少寫一些代碼,經常會將對圖像均值歸一化、通道變化等處理寫到ONNX模型中。然而在利

原创 Pytorch多batch導出ONNX模型

b, h, w, c = model.shape str_w = str(w) str_h = str(h) str_c = str(c) dynamic_axes = {'input': {0: 'batch', 1: str_

原创 MNN中Python示例

MNN中Python示例 MNNConvert工具轉換 /home/xxx/work/sdk/MNN/build/MNNConvert -f ONNX --modelFile ./models/pfld.onnx --MNNMod

原创 MNN中Python接口pymnn源碼編譯

MNN中Python接口pymnn源碼編譯 第一步:protobuf源碼編譯 git clone https://github.com/protocolbuffers/protobuf.git cd protobuf/ ./aut

原创 AI算法模型輸入的格式轉換函數HWC -> CHW或者CHW->HWC

/** * convert input from HWC format to CHW format * \param input A single image. The byte array has length of 3*h

原创 c++中map與unordered_map之間的區別

原理 map: 內部實現了一個紅黑樹(紅黑樹是非嚴格平衡二叉搜索樹,而AVL是嚴格平衡二叉搜索樹),紅黑樹具有自動排序的功能,因此map內部的所有元素都是有序的,紅黑樹的每一個節點都代表着map的一個元素。因此,對於map進行的

原创 const char *轉 const wchar *函數

const char *轉 const wchar *函數 const wchar_t* CharToWchar(const char* ch) { const size_t len = strlen(ch) + 1;

原创 ubuntu下onnxruntime源碼編譯

編譯命令: bash ./build.sh --skip_tests --use_cuda --config RelWithDebInfo --build_shared_lib --parallel --cmake_path=/