Sample projects to use ncnn
./main [input]
- input = blank
- use the default image file set in source code (main.cpp)
- e.g. ./main
- input = *.mp4, *.avi, *.webm
- use video file
- e.g. ./main test.mp4
- input = *.jpg, *.png, *.bmp
- use image file
- e.g. ./main test.jpg
- input = number (e.g. 0, 1, 2, ...)
- use camera
- e.g. ./main 0
git clone https://github.com/iwatake2222/play_with_ncnn.git
cd play_with_ncnn
git submodule update --init
sh InferenceHelper/third_party/download_prebuilt_libraries.sh
sh ./download_resource.sh
InferenceHelper/third_party/cmakes/ncnn.cmake
cd pj_ncnn_cls_mobilenet_v2 # for example
mkdir -p build && cd build
cmake ..
make
./main
Where is the source code
: path-to-play_with_ncnn/pj_ncnn_cls_mobilenet_v2 (for example)Where to build the binaries
: path-to-build (any)main.sln
main
project as a startup project, then build and run!Note: Debug mode in Visual Studio doesn’t work because debuggable libraries are not provided
resource
directory to /storage/emulated/0/Android/data/com.iwatake.viewandroidncnn/files/Documents/resource
ViewAndroid\app\src\main\cpp\CMakeLists.txt
to select a image processor you want to useset(ImageProcessor_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../../../pj_ncnn_cls_mobilenet_v2/image_processor")
pj_ncnn_cls_mobilenet_v2
to anothererror: use of typeid requires -frtti
error, modify ViewAndroid\sdk\native\jni\include\opencv2\opencv_modules.hpp
//#define HAVE_OPENCV_FLANN