OpenVINO model to MyriadX blob converter

Compiler version

Thu Jan 23 19:14:14 MSK 2020

d349c3ba4a2508be72f413fa4dee92cc0e4bc0e1

releases_2020_1_InferenceEngine_37988

==============================================

×

API integration guide

Convert OpenVINO model

import requests

url = "69.164.214.171:8080"  # change if running against other URL

payload = {
    'compiler_params': '-ip U8 -VPU_MYRIAD_PLATFORM VPU_MYRIAD_2480 -VPU_NUMBER_OF_SHAVES 4 -VPU_NUMBER_OF_CMX_SLICES 4',
    'compile_type': 'myriad'
}
files = [
    ('definition', open('/path/to/definition.xml', 'rb')),
    ('weights', open('/path/to/weights.bin', 'rb'))
]
headers = {
    'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

Convert Caffe / TensorFlow model

import requests

url = "69.164.214.171:8080"  # change if running against other URL
payload = {
    'compile_type': 'model',
    'model_type': 'caffe',
    'intermediate_compiler_params': '--data_type=FP16 --mean_values [127.5,127.5,127.5] --scale_values [255,255,255]',
    'compiler_params': '-ip U8 -VPU_MYRIAD_PLATFORM VPU_MYRIAD_2480 -VPU_NUMBER_OF_SHAVES 4 -VPU_NUMBER_OF_CMX_SLICES 4'
}
files = [
    ('model', open('/path/to/mobilenet-ssd.caffemodel', 'rb')),
    ('proto', open('/path/to/mobilenet-ssd.prototxt', 'rb'))
]
headers = {
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)

Download model from model zoo

import requests

url = "69.164.214.171:8080"  # change if running against other URL
payload = {
    'compile_type': 'zoo',
    'model_name': 'mobilenet-ssd',
    'model_downloader_params': '--precisions FP16 --num_attempts 5',
    'intermediate_compiler_params': '--data_type=FP16 --mean_values [127.5,127.5,127.5] --scale_values [255,255,255]',
    'compiler_params': '-ip U8 -VPU_MYRIAD_PLATFORM VPU_MYRIAD_2480 -VPU_NUMBER_OF_SHAVES 4 -VPU_NUMBER_OF_CMX_SLICES 4'
}
headers = {
    'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)