- GitHub下载 https://github.com/mystic123/tensorflow-yolo-v3 项目;
- 使用tensorflow-yolo-v3 转换yolov3.weights 为pb文件:
git clone https://github.com/mystic123/tensorflow-yolo-v3.git
cd tensorflow-yolo-v3
python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3.weights
for tiny yolo:
python3 convert_weights_pb.py --class_names coco.names --data_format NHWC --weights_file yolov3-tiny.weights --tiny
- 使用openvino的工具转成IR模型:
更改文件:
<OPENVINO_INSTALL_DIR>/deployment_tools/model_optimizer/extensions/front/tf
It consists of several attributes:
[
{
"id": "TFYOLOV3",
"match_kind": "general",
"custom_attributes": {
"classes": 80, # 你的class数目
"coords": 4,
"num": 9,
"mask": [0, 1, 2],
"entry_points": ["detector/yolo-v3/Reshape", "detector/yolo-v3/Reshape_4", "detector/yolo-v3/Reshape_8"]
}
}
]
- 进入openvino/deployment_tools/model_optimizer文件夹:
python3 mo_tf.py
--input_model /path/to/yolo_v3.pb
--tensorflow_use_custom_operations_config $MO_ROOT/extensions/front/tf/yolo_v3.json
--batch 1
获得****.xml、****.bin、 *****.mapping文件
- 使用object_detection_demo_yolov3_async加载文件调用hddl核心计算;
- 我测试的速度为每个mx核心4.8FPS。