@@ -180,7 +180,25 @@ $env:path = "$env:CUDNN_DIR\bin;" + $env:path
180180 <tr >
181181 <td>ncnn </td>
182182 <td>ncnn </td>
183- <td>TODO </td>
183+ <td>
184+ 1. 下载 <a href="https://github.com/google/protobuf/archive/v3.11.2.zip">protobuf-3.11.2</a><br>
185+ 2. 编译protobuf
186+ <pre><code>cd <protobuf-dir>
187+ mkdir build
188+ cd build
189+ cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=%cd%/install -Dbuild_TESTS=OFF -Dprotobuf_MSVC_STATIC_RUNTIME=OFF ../cmake
190+ cmake --build . --config Release -j 2
191+ cmake --build . --config Release --target install</code ></pre >
192+ 2. 下载ncnn
193+ <pre ><code >git clone --recursive https://github.com/Tencent/ncnn.git
194+ cd <ncnn-dir>
195+ mkdir -p ncnn_build
196+ cd ncnn_build
197+ cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=%cd%/install -Dprotobuf_DIR=<protobuf-dir >/build/install/cmake -DNCNN_VULKAN=OFF ..
198+ cmake --build . --config Release -j 2
199+ cmake --build . --config Release --target install
200+ </code ></pre >
201+ </td >
184202 </tr >
185203</tbody >
186204</table >
@@ -218,7 +236,18 @@ cmake --install . --config Release
218236
219237- ** ncnn** 自定义算子
220238
221- TODO
239+ ``` powershell
240+ mkdir build -ErrorAction SilentlyContinue
241+ cd build
242+ cmake .. -G "Visual Studio 16 2019" -A x64 -T v142
243+ -DMMDEPLOY_TARGET_BACKENDS="ncnn" \
244+ -Dncnn_DIR="<ncnn-dir>/ncnn_build/install/lib/cmake/ncnn"
245+ -Dprotobuf_DIR="<protobuf-dir>/build/install/cmake"
246+ -DProtobuf_LIBRARIES="<protobuf-dir>/build\install\lib"
247+ -DProtobuf_INCLUDE_DIR="<protobuf-dir>/build\install\include\"
248+ cmake --build . --config Release -- /m
249+ cmake --install . --config Release
250+ ```
222251
223252参考 [ cmake 选项说明] ( cmake_option.md )
224253
@@ -271,7 +300,26 @@ pip install -e .
271300 -Dpplcv_DIR="$env:PPLCV_DIR/pplcv-build/install/lib/cmake/ppl" `
272301 -DTENSORRT_DIR="$env:TENSORRT_DIR" `
273302 -DCUDNN_DIR="$env:CUDNN_DIR"
303+ cmake --build . --config Release -- /m
304+ cmake --install . --config Release
305+ ```
306+
307+ - cpu + ncnn
274308
309+ ``` PowerShell
310+ cd $env:MMDEPLOY_DIR
311+ mkdir build
312+ cd build
313+ cmake .. -G "Visual Studio 16 2019" -A x64 -T v142 `
314+ -DMMDEPLOY_BUILD_SDK=ON `
315+ -DMMDEPLOY_BUILD_EXAMPLES=ON `
316+ -DMMDEPLOY_BUILD_SDK_PYTHON_API=ON `
317+ -DMMDEPLOY_TARGET_DEVICES="cpu" `
318+ -DMMDEPLOY_TARGET_BACKENDS="ncnn" `
319+ -Dncnn_DIR="<ncnn-dir>/ncnn_build/install/lib/cmake/ncnn"
320+ -Dprotobuf_DIR="<protobuf-dir>/build/install/cmake"
321+ -DProtobuf_LIBRARIES="<protobuf-dir>/build\install\lib"
322+ -DProtobuf_INCLUDE_DIR="<protobuf-dir>/build\install\include\"
275323 cmake --build . --config Release -- /m
276324 cmake --install . --config Release
277325 ```
0 commit comments