Skip to content

Latest commit

 

History

History
 
 

demo_ncnn

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

PicoDet NCNN Demo

This project provides PicoDet 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 picodet_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 PicoDet ncnn model.

Webcam

picodet_demo 0 0

Inference images

picodet_demo 1 IMAGE_FOLDER/*.jpg

Inference video

picodet_demo 2 VIDEO_PATH

Benchmark

picodet_demo 3 0

result: picodet  min = 17.74  max = 22.71  avg = 18.16

Notice:

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

Linux:

export OMP_THREAD_LIMIT=4