使用openvino加载yolov3-darknet53

  1. GitHub下载 https://github.com/mystic123/tensorflow-yolo-v3 项目;
  2. 使用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
  1. 使用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"]
    }
  }
]
  1. 进入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文件

  1. 使用object_detection_demo_yolov3_async加载文件调用hddl核心计算;
  2. 我测试的速度为每个mx核心4.8FPS。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值