- YOLO V1 😄
- YOLO V2 😄
- YOLO V3 😄
- OpenVINO R4
convert YOLOv1
and YOLOv2
.cfg
and .weights
to .pb
.
-
git clone darkflow
-
python3 setup.py build_ext --inplace
AssertionError: expect 44948596 bytes, found 44948600
-
modify the line self.offset = 16 in the ./darkflow/utils/loader.py file and replace with self.offset = 20 [error solution ref]
-
Copy
coco.names
indarknet/data
tolabels.txt
indarkflow
. -
flow --model cfg/yolo.cfg --load bin/yolo.weights --savepb
- Create
yolo_v1.json
[
{
"id": "TFYOLO",
"match_kind": "general",
"custom_attributes": {
"classes": 20,
"coords": 4,
"num": 2,
"do_softmax": 1
}
}
]
-
Convert
.pb
to IRPS: Can only convert yolo-tiny version currently.
./mo_tf.py
--input_model <path_to_model>/<model_name>.pb \
--batch 1 \
--tensorflow_use_custom_operations_config <yolo_v1.json PATH> \
--output_dir <IR_PATH>
-
mkdir build && cd build
-
cmake .. && make
-
./yolov1 -m <IR.XML_PATH> -w <IR.BIN_PATH> -image <IMG_PATH>
- Create
yolo_v2.json
[
{
"id": "TFYOLO",
"match_kind": "general",
"custom_attributes": {
"classes": 80,
"coords": 4,
"num": 5,
"do_softmax": 1
}
}
]
- Convert
.pb
to IR
./mo_tf.py
--input_model <path_to_model>/<model_name>.pb \
--batch 1 \
--tensorflow_use_custom_operations_config <yolo_v2.json PATH> \
--output_dir <IR_PATH>
-
mkdir build && cd build
-
cmake .. && make
-
./yolov2 -m <IR.XML_PATH> -w <IR.BIN_PATH> -image <IMG_PATH>
-
Using
v3ConvertTool
Dump YOLOv3 TenorFlow* Model.python3 dump.py \ --class_names ../common/coco.names \ --weights_file <yolov3.weights_paht> \ --size <302 or 416 or 608>
-
Convert
.pb
to IRmo_tf.py --input_model /path/to/yolo_v3.pb --output_dir <OUTPUT_PATH> --tensorflow_use_custom_operations_config $MO_ROOT/extensions/front/tf/yolo_v3.json --batch 1
-
mkdir build && cd build
-
cmake .. && make
-
./yolov3 -m <IR.XML_PATH> -w <IR.BIN_PATH> -image <IMG_PATH>