Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6386 Discussions

tiny-YoloV3's Python API sample (My own sample)

Hyodo__Katsuya
Innovator
1,277 Views
Hello, everyone. I tried the Python API implementation of tiny-YoloV3. I modified it much more simply than Intel's official sample program. I'm glad if I can help everyone. https://github.com/PINTO0309/OpenVINO-YoloV3/blob/master/openvino_tiny-yolov3_test.py Environment - Ubuntu 16.04 - OpenVINO toolkit 2018 R5 (2018.5.445) - Python 3.5 - OpenCV 4.0.1-openvino - tiny-YoloV3 (MS-COCO) - USB Camera
0 Kudos
15 Replies
Caspi__Itai
Beginner
1,277 Views

Thanks Katsuya, this is super helpful!

I was able to run this and get ~35 FPS on CPU, ~10 FPS on NCS2 and ~5 FPS on NCS1.

Probably possible to accelerate this further by using more than a single async inference request.

Thanks,

Itai

0 Kudos
Hyodo__Katsuya
Innovator
1,277 Views
0 Kudos
Lee__Terry
Beginner
1,277 Views

I gave up on tiny-yolov3 +NCS2 until I see your post. Many thanks Katsuya.

I have an application that use tiny-yolov2 with custom data set (4 classes) that needed to speed up the processing time with NCS2. By following your githut. I manage to get it working with CPU. However, was not able to get it working with NCS2 (with MYRIAD). 

The steps used are:

Step 1: cover weight.python convert_weights_pb_car.py  --weights_fil

e yolov3-tiny_416x416_3800.weights --class_names carcoco.names --size 416 --data_format NHWC

Step 2: convert to TensorFlow model
 python convert_weights_pb.py  --weights_file yolov3-tiny_416x416_3800.weights --class_names carcoco.names --size 416 --data_format NHWC

Step 3: Run object_detection_demo_yolov3_async

object_detection_demo_yolov3_async -i C:\Users\trafficcountuser\Downloads\OpenVINO-YoloV3-master\data\input\testvideo3.mp4 -m C:\Intel\computer_vision_sdk_2018.5.445\deployment_tools\model_optimizer\frozen_car_yolov3_model.xml -d MYRIAD

As shown at the attached picture, the result is not right for MYRIAD option with random boxes. If used CPU with --data_type=FP32 the result is correct.

I can't figure out the reason why it is work with CPU but not MYRIAD. Any suggestions to making custom data set to work with tiny-YoloV3 + NCS2 would be greatly appreciated.

Environment

- Windows 10
- OpenVINO toolkit 2018 R5 (2018.5.445)
- Python 3.6
- tiny-YoloV3 (MS-COCO)
- video file

- custom data set with 4 classes

Thanks,

Terry

 

 

0 Kudos
Hyodo__Katsuya
Innovator
1,277 Views
@Lee, Terry Your procedure does not include the conversion procedure to lrmodel. I can not answer anything with just the information you presented. Please attach all of the following. 1. convert_weights_pb_car.py 2. yolov3-tiny_416x416_3800.weights 3. frozen_car_yolov3_model.xml 4. frozen_car_yolov3_model.bin 5. xxx.json 6. xxx.pb 7. conversion script to lrmodel Perhaps the definition of anchor is inconsistent.
0 Kudos
Lee__Terry
Beginner
1,277 Views

Katsuya, Thanks for taking the time to helps out.

I added all the files that are needed to reproduce the issue to attached zip file. A readme file is also include to list the commands used and modification done to each files. Please let me if additional clarification are needed.

Thanks,

Terry  

0 Kudos
Hyodo__Katsuya
Innovator
1,277 Views
@Lee, Terry It worked in my environment. Please convert the difference between Windows and Linux commands. python convert_weights_pb_car.py --weights_file yolov3-tiny_416x416_3800.weights --class_names carcoco.names --data_format NHWC --tiny python /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py \ --input_model pbmodels/frozen_car_yolov3_model.pb \ --output_dir lrmodels/tiny-YoloV3/FP16 \ --data_type FP16 \ --batch 1 \ --tensorflow_use_custom_operations_config yolo_v3_tiny_changed_car.json And, Adjust the parameter of "FLAGS_t" = "-t". "-t" option is "confidence threshould". For example, object_detection_demo_yolov3_async -i c:\t\s2\t1.avi c:\t\s1\v2.mp4 -m C:\Intel\computer_vision_sdk_2018.5.445\deployment_tools\model_optimizer\frozen_car_yolov3_model.xml -d MYRIAD -t 0.7
0 Kudos
Lee__Terry
Beginner
1,277 Views

Hi Katsuya,

I follow the steps and still having issue with the MYRIAD option. Please view the results between CPU and MYRIAD. Would you verify if the MYRIAD option replacing the box at the right location for car ? Did I missed some thing ? 

Thanks,

Terry

0 Kudos
Lee__Terry
Beginner
1,277 Views

Hi Katsuya,

Could you let me know the quality of detection is reasonable on MYRIAD option when you try it? I see random results on my custom train data set while the result is reasonable on CPU.

Thanks,

Terry 

0 Kudos
Hyodo__Katsuya
Innovator
1,277 Views
@Lee,Terry I have investigated various possibilities in the last few days. However, As you say, the result seems to be different between CPU and MYRIAD. I do not even know why the result will differ so far so far... I am sorry I can not help you.
0 Kudos
Hyodo__Katsuya
Innovator
1,277 Views
- Same issue https://github.com/PINTO0309/OpenVINO-YoloV3/issues/2 When converting the model using "convert_weights_pb.py" it seems that considerable accuracy degradation has occurred.
0 Kudos
nikos1
Valued Contributor I
1,277 Views

Was also getting similar issues. I found some of this was due to the open issues in https://github.com/mystic123/tensorflow-yolo-v3/issues

 

0 Kudos
Lee__Terry
Beginner
1,277 Views

Thanks a lot for taking the time to investigate this issue. It's good to know that the issue is limited to my program. I'm hopping someone from Intel with more inside of openVino will have a chance to look at the issue. 

Did anybody able to use NCS2 on custom data set on any model ? 

Thanks, Terry 

 

 

 

0 Kudos
Hyodo__Katsuya
Innovator
1,277 Views
@nikos Thank you. I've confirmed. @Lee, Terry I looked at the issue, but it seems that it has not been solved fundamentally yet.
0 Kudos
Lee__Terry
Beginner
1,277 Views

Katsuya, 

You are right. The issue have not been solved. I'm hopping that Intel can have a look at it.

At the mean time, I'm trying to find another model to work with NCS2. 

  

0 Kudos
fu__cfu
Beginner
1,277 Views

I also suffer from this issue when I trained the model with my own dataset, any updates?

0 Kudos
Reply