Skip to content

Latest commit

 

History

History

demo_ncnn

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

NanoDet NCNN Demo

This project provides NanoDet image inference, webcam inference and benchmark using Tencent's NCNN framework.

How to build

Windows

Step1.

Download and Install Visual Studio from https://visualstudio.microsoft.com/vs/community/

Step2.

Download and install OpenCV from https://github.com/opencv/opencv/releases

Step3(Optional).

Download and install Vulkan SDK from https://vulkan.lunarg.com/sdk/home

Step4.

Clone NCNN repository

git clone --recursive https://github.com/Tencent/ncnn.git

Build NCNN following this tutorial: Build for Windows x64 using VS2017

Step5.

Add ncnn_DIR = YOUR_NCNN_PATH/build/install/lib/cmake/ncnn to system environment variables.

Build project: Open x64 Native Tools Command Prompt for VS 2019 or 2017

cd <this-folder>
mkdir -p build
cd build
cmake ..
msbuild nanodet_demo.vcxproj /p:configuration=release /p:platform=x64

Linux

Step1.

Build and install OpenCV from https://github.com/opencv/opencv

Step2(Optional).

Download Vulkan SDK from https://vulkan.lunarg.com/sdk/home

Step3.

Clone NCNN repository

git clone --recursive https://github.com/Tencent/ncnn.git

Build NCNN following this tutorial: Build for Linux / NVIDIA Jetson / Raspberry Pi

Step4.

Set environment variables. Run:

export ncnn_DIR=YOUR_NCNN_PATH/build/install/lib/cmake/ncnn

Build project

cd <this-folder>
mkdir build
cd build
cmake ..
make

Run demo

Download NanoDet ncnn model.

Copy nanodet_m.param and nanodet_m.bin to demo program folder.

Webcam

nanodet_demo 0 0

Inference images

nanodet_demo 1 IMAGE_FOLDER/*.jpg

Inference video

nanodet_demo 2 VIDEO_PATH

Benchmark

nanodet_demo 3 0

bench_mark


Notice:

If benchmark speed is slow, try to limit omp thread num.

Linux:

export OMP_THREAD_LIMIT=4