一、转换为TF
1.1、下载代码:https://github.com/luxonis/yolo2openvino
1.2、运行:python convert_weights_pb.py --yolo 4 --weights_file best.weights --class_names voc2009.names --output yolov4tiny.pb --tiny --size 416 -a 10,14,23,27,37,58,81,82,135,169,344,319
二、转换为 OpenVINO
2.1、JSON 配置:修改classes=类别数。
2.2、运行:python E:openvinoopenvino_2021.3.394deployment_toolsmodel_optimizermo.py --input_model yolov4tiny.pb --tensorflow_use_custom_operations_config json/yolo_v4_tiny_custom.json --batch 1 --data_type FP16 --reverse_input_channel --model_name yolov4_tiny --output_dir output_dir
三、转换为 blob 以在 OAK 设备上进行推理
运行:https://blobconverter.luxonis.com/,选择OpenVINO 2021.3 > OpenVINO Model > Continue,上传.xml和.bin,shaves=6,然后转换。
四、环境
Python 3.7
Tensorflow 1.14.0
Numpy 1.16.6
OpenVINO 2021.3
Pillow



