This application runs know CNN image classifiers on live/pre-recorded video stream.
Build & Install MIVisionX
git clone https://github.com/kiritigowda/MIVisionX-Classifier
cd MIVisionX-Classifier
cmake .
make
Usage: ./classifier
--inception <inceptionV4 weights.bin> [optional]
--resnet50 <resnet50 weights.bin> [optional]
--vgg16 <vgg16 weights.bin> [optional]
--googlenet <googlenet weights.bin> [optional]
--resnet101 <resnet101 weights.bin> [optional]
--resnet152 <resnet152 weights.bin> [optional]
--vgg19 <vgg19 weights.bin> [optional]
--label <label text> [required]
--video <video file>/<--capture 0> [required]
Download or train your own caffemodel and run the model_compiler to get the corresponding weights.bin file.
- Download or train your own caffemodel.
Here is the sample download link that contains all the prototxt:
https://github.com/SnailTyan/caffe-model-zoo
- Using Model Compiler
To convert a caffemodel into AMD NNIR model:
% python caffe_to_nnir.py <net.caffeModel> <nnirOutputFolder> --input-dims <n,c,h,w> [--verbose <0|1>]
To convert an AMD NNIR model into OpenVX C code:
% python nnir_to_openvx.py <nnirModelFolder> <nnirModelOutputFolder>
The weights file will be generated and you can use that as an input for this project.
The labels.txt file in this project.
Test the classification on your own video. Give the path to your video.
If you want to test with a live cam, turn on this option.
./classifier --inception /PATH/TO/inceptionV4/weights.bin --resnet50/PATH/TO/resnet50/weights.bin ...
...
--vgg19 /PATH/TO/vgg19/weights.bin
--label labels.txt
--capture 0