OpenVINO-YoloV3 icon indicating copy to clipboard operation
OpenVINO-YoloV3 copied to clipboard

Instructions on conversion from a custom YOLOv3 network

Open hai-h-nguyen opened this issue 5 years ago • 3 comments

I have a trained YOLO network with 5 classes. Steps that I took.

  1. Convert from my YOLO weight file (trained using Darknet C++ model) to IR:

Conversion to pb: python3 convert_weights_pb.py --class_names obj.names --data_format NHWC --weights_file k-yolo-obj_last.weights

My yolo_v3.json file:

  {
    "id": "TFYOLOV3",
    "match_kind": "general",
    "custom_attributes": {
      "classes": 5,
      "coords": 4,
      "num": 9,
      "mask": [0, 1, 2],
      "jitter":0.3,
      "ignore_thresh":0.5,
      "truth_thresh":1,
      "random":1,
      "anchors":[10,13,16,30,33,23,30,61,62,45,59,119,116,90,156,198,373,326],
      "entry_points": ["detector/yolo-v3/Reshape", "detector/yolo-v3/Reshape_4", "detector/yolo-v3/Reshape_8"]
    }
  }
]

Conversion from pb file to IR: python3 /opt/intel/computer_vision_sdk/deployment_tools/model_optimizer/mo_tf.py --input_model ~/tensorflow-yolo-v3/frozen_darknet_yolov3_model.pb --tensorflow_use_custom_operations_config yolo_v3.json --batch 1 --data_type FP16

The conversions were succesful.

  1. Test the IR model: In your script openvino_yolov3_test.py, I changed the class number to 5, and labels into my label names. However, the result when running on NCS2 is very bad compared to the the original weight testing with Darknet commands.

Do I need to make corrections of the test file (m_input_size, camera_width, camera_height) or in any other steps to make it work?

Thanks!

hai-h-nguyen avatar Mar 29 '19 01:03 hai-h-nguyen

However, the result when running on NCS2 is very bad compared to the the original weight testing with Darknet commands.

I know that there are multiple issues.

  1. NCAPI + NCS2 bug
  2. Accuracy degradation by FP16 (only a little)
  3. Calculation bug of frame display position of my test program

https://github.com/PINTO0309/OpenVINO-YoloV3#issue

Especially 1. is serious. I can not solve the problem 1.

PINTO0309 avatar Mar 29 '19 03:03 PINTO0309

I performed the same routine on the new version of OpenVINO (2019) (with my custom network), the performance is greatly improved.

hai-h-nguyen avatar Apr 14 '19 06:04 hai-h-nguyen

Thank you for providing the information. It will be a great help to other engineers.

PINTO0309 avatar Apr 14 '19 06:04 PINTO0309