PINTO0309 / OpenVINO-YoloV3

YoloV3/tiny-YoloV3+RaspberryPi3/Ubuntu LaptopPC+NCS/NCS2+USB Camera+Python+OpenVINO
https://qiita.com/PINTO
Apache License 2.0
538 stars 165 forks source link

Rectangle only on the center of the object when running YOLOv3-Tiny on NCS2 with smaller size #76

Open CardLin opened 3 years ago

CardLin commented 3 years ago

I am running YOLOv3-Tiny 224*224 on NCS2 with Raspberry Pi 3B+

My conversion environment is Python3.5, TensorFlow1.12.0, OpenVINO 2019 R1 $ python convert_weights_pb.py --weights_file yolov3-tiny.weights --class_names coco.names --tiny True --size 224 --data_format NHWC --output_graph tiny_yolov3_224.pb $ python 'D:\Cary\Other_Sources\yolov3-tiny\openvino\model-optimizer\mo_tf.py' --input_shape [1,224,224,3] -m tiny_yolov3_224.pb --reverse_input_channels --tensorflow_use_custom_operations_config yolo_v3_tiny_changed.json -n tiny_yolov3_224 --data_type FP16

My inference is test on Raspbian 9 with OpenVINO 2019.1.144 and Rasbian 10 with OpenVINO 2020.1.023 Modify m_input_size to 224 and model_xml to tiny_yolov3_224.xml $ python3 openvino_tiny-yolov3_224_test.py -d MYRIAD

Both has the same bad result which the rectangle is always at the center of object on all labels https://i.imgur.com/QbRSqcs.png

Should I change something when I change the inference size from 416 to 224?

PINTO0309 commented 3 years ago

Perform a scale conversion. https://github.com/PINTO0309/OpenVINO-YoloV3/blob/master/openvino_tiny-yolov3_test.py#L9

CardLin commented 3 years ago

I already modify m_input_size to 224 m_input_size = 224 The result of inference is locate at the center of object with very small w and h. It seems that x and y is correct but w and h is wrong. https://i.imgur.com/QbRSqcs.png Any Idea?