OpenVINO-YoloV3
OpenVINO-YoloV3 copied to clipboard
Instructions on conversion from a custom YOLOv3 network
I have a trained YOLO network with 5 classes. Steps that I took.
- 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.
- 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!
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.
- NCAPI + NCS2 bug
- Accuracy degradation by FP16 (only a little)
- 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.
I performed the same routine on the new version of OpenVINO (2019) (with my custom network), the performance is greatly improved.
Thank you for providing the information. It will be a great help to other engineers.