The tool that allows you to covert neural networks to MyriadX blob
Project description
BlobConverter CLI
This tool allows you to convert neural network files (from various sources, like Tensorflow, Caffe or OpenVINO) to MyriadX blob file
Installation
python3 -m pip install blobconverter
Usage
usage: blobconverter [-h] [-zn ZOO_NAME] [-cp CAFFE_PROTO] [-cm CAFFE_MODEL] [-tf TENSORFLOW_PB] [-ox OPENVINO_XML] [-ob OPENVINO_BIN]
[-rawn RAW_NAME] [-rawc RAW_CONFIG] [-sh {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}] [-dt DATA_TYPE] [-o OUTPUT_DIR]
[-v VERSION] [--optimizer-params OPTIMIZER_PARAMS] [--compile-params COMPILE_PARAMS] [--converter-url URL] [--no-cache]
optional arguments:
-h, --help show this help message and exit
-zn ZOO_NAME, --zoo-name ZOO_NAME
Name of a model to download from OpenVINO Model Zoo
-cp CAFFE_PROTO, --caffe-proto CAFFE_PROTO
Path to Caffe .prototxt file
-cm CAFFE_MODEL, --caffe-model CAFFE_MODEL
Path to Caffe .caffemodel file
-tf TENSORFLOW_PB, --tensorflow-pb TENSORFLOW_PB
Path to TensorFlow .pb file
-ox OPENVINO_XML, --openvino-xml OPENVINO_XML
Path to OpenVINO .xml file
-ob OPENVINO_BIN, --openvino-bin OPENVINO_BIN
Path to OpenVINO .bin file
-rawn RAW_NAME, --raw-name RAW_NAME
Name of the converted model (advanced)
-rawc RAW_CONFIG, --raw-config RAW_CONFIG
Path to raw .yml file with model config (advanced)
-sh {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}, --shaves {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
Specifies number of SHAVE cores that converted model will use
-dt DATA_TYPE, --data-type DATA_TYPE
Specifies model data type
-o OUTPUT_DIR, --output-dir OUTPUT_DIR
Directory where the output blob should be saved
-v VERSION, --version VERSION
OpenVINO version to use for conversion
--optimizer-params OPTIMIZER_PARAMS
Additional params to use when converting a model to OpenVINO IR
--compile-params COMPILE_PARAMS
Additional params to use when compiling a model to MyriadX blob
--converter-url URL URL to BlobConverter API endpoint used for conversion
--no-cache Omit .cache directory and force new compilation of the blob
Conversion examples (cli)
OpenVINO Model Zoo
python3 -m blobconverter --zoo-name face-detection-retail-0004 --shaves 6
Caffe
python3 -m blobconverter --caffe-proto /path/to/mobilenet-ssd.prototxt --caffe-model /path/to/mobilenet-ssd.caffemodel --shaves 6
TensorFlow
python3 -m blobconverter --tensorflow-pb /path/to/deeplabv3_mnv2_pascal_train_aug.pb --optimizer-params --reverse_input_channels --input_shape=[1,513,513,3] --input=1:mul_1 --output=ArgMax --shaves 6
OpenVINO IR
python3 -m blobconverter --openvino-xml /path/to/face-detection-retail-0004.xml --openvino-bin /path/to/face-detection-retail-0004.bin --shaves 7
Raw model config (advanced)
python3 -m blobconverter --raw-config /path/to/model.yml --raw-name license-plate-recognition-barrier-0007 --shaves 6
Conversion examples (Python)
OpenVINO Model Zoo
import blobconverter
blob_path = blobconverter.from_zoo(
name="face-detection-retail-0004",
shaves=6,
)
Caffe
import blobconverter
blob_path = blobconverter.from_caffe(
proto="/path/to/mobilenet-ssd.prototxt",
model="/path/to/mobilenet-ssd.caffemodel",
data_type="FP16",
shaves=5,
)
TensorFlow
import blobconverter
blob_path = blobconverter.from_tf(
frozen_pb="/path/to/deeplabv3_mnv2_pascal_train_aug.pb",
data_type="FP16",
shaves=5,
optimizer_params=[
"--reverse_input_channels",
"--input_shape=[1,513,513,3]",
"--input=1:mul_1",
"--output=ArgMax",
],
)
OpenVINO IR
import blobconverter
blob_path = blobconverter.from_openvino(
xml="/path/to/face-detection-retail-0004.xml",
bin="/path/to/face-detection-retail-0004.bin",
data_type="FP16",
shaves=5,
)
Raw model config (advanced)
import blobconverter
blob_path = blobconverter.compile_blob(
blob_name="license-plate-recognition-barrier-0007",
req_data={
"name": "license-plate-recognition-barrier-0007",
"use_zoo": True,
},
req_files={
'config': open('/path/to/model.yml'),
},
data_type="FP16",
shaves=5,
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blobconverter-0.0.2.tar.gz
(7.7 kB
view hashes)
Built Distribution
Close
Hashes for blobconverter-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a246f3f2a91c10396591835ee68a27568691022d1f156fbf42ef1cc7152d077 |
|
MD5 | 3113a69bc60b6b4aff8adc2bfb7b5623 |
|
BLAKE2b-256 | 6d89579178a46077126e56d8c6d79ae8f2b66a59b210b01bcc7fc61bbab3cfdd |