Closed hoangkhoiLE closed 3 years ago
For custom model,you need to modify following files:
(1) When running convert_weights_pb.py use your .names file,the default is coco.names
(2) Modify "classes" in yolov4.json https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/cc0245aaf258a9c8578d2f5ed32e595aedd41266/yolo_v4_tiny.json#L6
Optional: (3)anchors:https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/cc0245aaf258a9c8578d2f5ed32e595aedd41266/yolo_v4_tiny.json#L7 It is the same with https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/cc0245aaf258a9c8578d2f5ed32e595aedd41266/cfg/yolov4-tiny.cfg#L219
If you cluster your own dataset, you need to modify it. Otherwise, there is no need to modify anchors
There is no need to modify the following lines:
https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/cc0245aaf258a9c8578d2f5ed32e595aedd41266/yolo_v4_tiny.json#L10-L11 This tells OpenVINO the location of yolo layer
"entry_points": ["detector/yolo-v4-tiny/Reshape", "detector/yolo-v4-tiny/Reshape_4"] is defined by TF model's namespace.
"masks": [[3, 4, 5]
corresponds to "detector/yolo-v4-tiny/Reshape"
corresponds to
https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/cc0245aaf258a9c8578d2f5ed32e595aedd41266/cfg/yolov4-tiny.cfg#L218
"masks": [1, 2, 3]]
corresponds to"detector/yolo-v4-tiny/Reshape_4"
corresponds to https://github.com/TNTWEN/OpenVINO-YOLOV4/blob/cc0245aaf258a9c8578d2f5ed32e595aedd41266/cfg/yolov4-tiny.cfg#L267
Other lines are parameters required by mo.py or inference demo.There is no need to modify.
Thank you for your kind response
Hello,
I very appreciate your excellent work. Now I want to train the yolo_v4 on my custom dataset but I don't know how to get the json file for the step convert to openvino like you did. Can you show me the way to get file "yolo_v4_tiny.json" by your file "yolo-tiny.weights" ? Thank you in advance.
Best regards