[Example] update arithmetic for normalization
authorJaeyun <jy1210.jung@samsung.com>
Fri, 23 Nov 2018 04:54:22 +0000 (13:54 +0900)
committerMyungJoo Ham <myungjoo.ham@gmail.com>
Fri, 23 Nov 2018 06:15:06 +0000 (06:15 +0000)
update arith mode in tensor-transform to normalize

Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
nnstreamer_example/example_object_detection/gst-launch-object-detection.sh
nnstreamer_example/example_object_detection/nnstreamer_example_object_detection.cc

index 2b2256f..23431a2 100755 (executable)
@@ -2,7 +2,7 @@
 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_transform mode=arithmetic option=typecast:float32,add:-127.5,div:127.5 ! \
                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 \
index 3fdcef7..d51e7a6 100644 (file)
@@ -674,7 +674,7 @@ main (int argc, char ** argv)
       "video/x-raw,width=%d,height=%d,format=RGB ! tee name=t_raw "
       "t_raw. ! queue ! videoconvert ! cairooverlay name=tensor_res ! ximagesink name=img_tensor "
       "t_raw. ! queue leaky=2 max-size-buffers=2 ! videoscale ! video/x-raw,width=%d,height=%d ! tensor_converter ! "
-      "tensor_transform mode=arithmetic option=typecast:float32,add:-127,mul:0.007843 ! "
+      "tensor_transform mode=arithmetic option=typecast:float32,add:-127.5,div:127.5 ! "
       "tensor_filter framework=tensorflow-lite model=%s ! "
       "tensor_sink name=tensor_sink",
       VIDEO_WIDTH, VIDEO_HEIGHT, MODEL_WIDTH, MODEL_HEIGHT,