From c06c9fcf239ebbaf0591abbc159c5ffb4f8f4bd7 Mon Sep 17 00:00:00 2001 From: Davide Sapienza Date: Mon, 30 Mar 2020 19:02:55 +0200 Subject: [PATCH] Update README.md Signed-off-by: Davide Sapienza --- README.md | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8ed4ede..ee8bb1e 100644 --- a/README.md +++ b/README.md @@ -101,10 +101,9 @@ python run_ssd_live_demo.py mb2-ssd-lite To run the an object detection demo follow these steps (example with yolov3): ``` -export TKDNN_MODE=FP16 # set the half floating point optimization -rm yolo3.rt # be sure to delete(or move) old tensorRT files +rm yolo3_FP32.rt # be sure to delete(or move) old tensorRT files ./test_yolo3 # run the yolo test (is slow) -./demo yolo3.rt ../demo/yolo_test.mp4 y +./demo yolo3_FP32.rt ../demo/yolo_test.mp4 y ``` In general the demo program takes 3 parameters: ``` @@ -114,11 +113,42 @@ where * `````` is the rt file generated by a test * ```<``` is the path to a video file or a camera input * `````` is the type of network. Thee types are currently supported: ```y``` (YOLO family), ```c``` (CenterNet family) and ```m``` (MobileNet-SSD family) -N.b. Using FP16 inference will lead to some errors in the results (first or second decimal). +N.b. By default it is used FP32 inference ![demo](https://user-images.githubusercontent.com/11562617/72547657-540e7800-388d-11ea-83c6-49dfea2a0607.gif) +### FP16 inference + +To run the an object detection demo with FP16 inference follow these steps (example with yolov3): +``` +export TKDNN_MODE=FP16 # set the half floating point optimization +rm yolo3_FP16.rt # be sure to delete(or move) old tensorRT files +./test_yolo3 # run the yolo test (is slow) +./demo yolo3_FP16.rt ../demo/yolo_test.mp4 y +``` +N.b. Using FP16 inference will lead to some errors in the results (first or second decimal). + +### INT8 inference + +To run the an object detection demo with INT8 inference follow these steps (example with yolov3): +``` +export TKDNN_MODE=INT8 # set the 8-bit integer optimization + +# image_list.txt contains the list of the absolute paths to the calibration images +export TKDNN_CALIB_IMG_PATH=/path/to/calibration/image_list.txt + +# label_list.txt contains the list of the absolute paths to the calibration labels +export TKDNN_CALIB_LABEL_PATH=/path/to/calibration/label_list.txt +rm yolo3_INT8.rt # be sure to delete(or move) old tensorRT files +./test_yolo3 # run the yolo test (is slow) +./demo yolo3_INT8.rt ../demo/yolo_test.mp4 y +``` +N.b. Using INT8 inference will lead to some errors in the results (first or second decimal). + +N.b. The network test script is very slow: it call the INT8 calibrator. + ## mAP demo + To compute mAP, precision, recall and f1score, run the map_demo. A validation set is needed. To download COCO_val2017 run (form the root folder): @@ -139,7 +169,7 @@ Example: ``` cd build -./map_demo dla34_cnet.rt c ../demo/COCO_val2017/all_labels.txt ../demo/config.yaml +./map_demo dla34_cnet_FP32.rt c ../demo/COCO_val2017/all_labels.txt ../demo/config.yaml ``` ## Existing tests and supported networks