The completed application runs any Model Zoo style object detector in Tensorflow mode (default) and an Inception V2 SSD detector converted from Tensorflow graph to UFF format recognized by TensorRT in TensorRT mode (-t).
Read these series of posts
- Clone the repo.
- Get the frozen graph and the class labels files for Tensorflow from here
- Get the frozen graph for TensorRT. The class labels file should be available in
/usr/src/tensorrt/data/ssd
directory. - Build:
mkdir build
cd build
cmake .. # cmake -DCMAKE_BUILD_TYPE=Debug
Command line options are described in main.cpp
:
const String keys =
"{d display |1 | view video while objects are detected}"
"{t tensorrt|false | use tensorrt}"
"{i int8|false| use INT8 (requires callibration)}"
"{v video | | video for detection}"
"{graph ||frozen graph location}"
"{labels ||trained labels filelocation}";
Examples are in run_*.sh
files in the sources directory. Worth mentioning:
-d=0 - run without UX, print out framerate only. -d=2 run with UX
-t - TensorRT graph
-t -i - TensorRT graph with INT8 precision.
The application uses a bare-bones OpenCV UI for visual feedback (imshow
) and that causes a significant perf hit, so to measure actual performance we run with -d=0
which suppresses the UI.