[Example] ObjectDetection(SSD) with Gst-Launch
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 21 Nov 2018 06:11:22 +0000 (15:11 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Fri, 23 Nov 2018 02:25:51 +0000 (02:25 +0000)
With the new decoder/bounding-box, we can do
object-detection + labeling in gst-launch with
visualization.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
nnstreamer_example/example_object_detection/get_model.sh [new file with mode: 0755]
nnstreamer_example/example_object_detection/gst-launch-object-detection.sh [new file with mode: 0755]

diff --git a/nnstreamer_example/example_object_detection/get_model.sh b/nnstreamer_example/example_object_detection/get_model.sh
new file mode 100755 (executable)
index 0000000..4d5447e
--- /dev/null
@@ -0,0 +1,4 @@
+#!/usr/bin/env bash
+wget https://github.com/nnsuite/testcases/raw/master/DeepLearningModels/tensorflow-lite/ssd_mobilenet_v2_coco/ssd_mobilenet_v2_coco.tflite
+wget https://github.com/nnsuite/testcases/raw/master/DeepLearningModels/tensorflow-lite/ssd_mobilenet_v2_coco/coco_labels_list.txt
+wget https://github.com/nnsuite/testcases/raw/master/DeepLearningModels/tensorflow-lite/ssd_mobilenet_v2_coco/box_priors.txt
diff --git a/nnstreamer_example/example_object_detection/gst-launch-object-detection.sh b/nnstreamer_example/example_object_detection/gst-launch-object-detection.sh
new file mode 100755 (executable)
index 0000000..2b2256f
--- /dev/null
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+gst-launch-1.0 \
+       v4l2src name=cam_src ! videoscale ! videoconvert ! video/x-raw,width=640,height=480,format=RGB,framerate=30/1 ! tee name=t \
+       t. ! queue leaky=2 max-size-buffers=2 ! videoscale ! video/x-raw,width=300,height=300,format=RGB ! tensor_converter ! \
+               tensor_transform mode=arithmetic option=typecast:float32,add:-127,mul:0.007843 ! \
+               tensor_filter framework=tensorflow-lite model=ssd_mobilenet_v2_coco.tflite ! \
+               tensor_decoder mode=bounding_boxes option1=ssd option2=coco_labels_list.txt option3=box_priors.txt option4=640:480 option5=300:300 ! \
+               compositor name=mix sink_0::zorder=2 sink_1::zorder=1 ! videoconvert ! ximagesink \
+       t. ! queue leaky=2 max-size-buffers=10 ! mix.