image_classification.md

March 29, 2018 ยท View on GitHub

Classification for Image

This project supports multiple CNN models for classification. Please make sure you have already set up environment and installed this project correctly. You can refer to the following links for your interested models then.

1 CNN Models

2 Other Arguments


1 CNN Models

Compile NCS graph.

cd /opt/movidius/ncappzoo/caffe/AlexNet
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: alexnet.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/caffe/GoogleNet
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: googlenet.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/caffe/SqueezeNet
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: squeezenet.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/tensorflow/inception_v1
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: inception_v1.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/tensorflow/inception_v2
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: inception_v2.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/tensorflow/inception_v3
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: inception_v3.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/tensorflow/inception_v4
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: inception_v4.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

Compile NCS graph.

cd /opt/movidius/ncappzoo/tensorflow/mobilenets
make

Launch object classification service.

cd ~/ros2_ws
echo "param_file: mobilenet.yaml" > src/ros2_intel_movidius_ncs/movidius_ncs_launch/config/default.yaml
ament build
source install/local_setup.bash
launch `ros2 pkg prefix movidius_ncs_launch`/share/movidius_ncs_launch/launch/ncs_image_launch.py

Run the example application with an absolute path of an image on another console. For example,

ros2 run movidius_ncs_example movidius_ncs_example_image_classification /opt/movidius/ncappzoo/data/images/cat.jpg

2 Other Arguments

ArgumentsDescriptionDefault ValueValid Values
device_indexncs device index00~N-1(N is the maximum number of inserted NCS devices)
log_levelncs log level00:Nothing / 1:Errors / 2:Verbose
cnn_typeindicate different cnn modelsgooglenetalexnet / googlenet / squeezenet / inception_v1 / inception_v2 / inception_v3 / inception_v4 / mobilenet
top_nthe number of results to be shown, only valid for classification30~5