Skip to content

Commit

Permalink
Merge pull request #35 from luxonis/2021.4.2
Browse files Browse the repository at this point in the history
OpenVINO 2021.4.2 support
  • Loading branch information
SzabolcsGergely authored May 23, 2022
2 parents 57c1563 + 76834e3 commit 829b370
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ WORKDIR websrc/
RUN yarn
RUN yarn build

FROM openvino/ubuntu20_dev:2021.4
FROM openvino/ubuntu20_dev:2021.4.2

COPY --from=openvino/ubuntu20_dev:2021.4.2 /opt/intel/openvino /opt/intel/openvino2021_4
COPY --from=openvino/ubuntu20_dev:2021.3 /opt/intel/openvino /opt/intel/openvino2021_3
COPY --from=openvino/ubuntu18_dev:2021.2 /opt/intel/openvino /opt/intel/openvino2021_2
COPY --from=openvino/ubuntu18_dev:2021.1 /opt/intel/openvino /opt/intel/openvino2021_1
Expand All @@ -17,7 +18,7 @@ COPY --from=openvino/ubuntu18_dev:2020.1 /opt/intel/openvino /opt/intel/openvino
COPY --from=openvino/ubuntu18_dev:2019_R3.1 /opt/intel/openvino /opt/intel/openvino2019_3

USER root
RUN apt-get update && apt-get -y upgrade && apt-get install -y software-properties-common
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get update
RUN apt-get install -y python3-dev nano git python3.7 python3.7-venv
Expand Down
3 changes: 2 additions & 1 deletion cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name='blobconverter',
version='1.2.9',
version='1.3.0',
description='The tool that allows you to convert neural networks to MyriadX blob',
long_description=io.open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
Expand Down Expand Up @@ -37,5 +37,6 @@
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
)
18 changes: 9 additions & 9 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,19 +214,19 @@ def parse_config(config_path, name, data_type, env):


def prepare_compile_config(shaves, env):
if env.version.startswith('2021'):
config_file_content = {
'MYRIAD_NUMBER_OF_SHAVES': shaves,
'MYRIAD_NUMBER_OF_CMX_SLICES': shaves,
'MYRIAD_THROUGHPUT_STREAMS': 1
}
else:
if env.version.startswith('2020'):
config_file_content = {
'VPU_MYRIAD_PLATFORM': 'VPU_MYRIAD_2480',
'VPU_NUMBER_OF_SHAVES': shaves,
'VPU_NUMBER_OF_CMX_SLICES': shaves,
'VPU_MYRIAD_THROUGHPUT_STREAMS': 1
}
else:
config_file_content = {
'MYRIAD_NUMBER_OF_SHAVES': shaves,
'MYRIAD_NUMBER_OF_CMX_SLICES': shaves,
'MYRIAD_THROUGHPUT_STREAMS': 1
}
config_file_path = env.workdir / "myriad_compile_config.txt"
with open(config_file_path, "w") as f:
f.writelines(
Expand Down Expand Up @@ -331,7 +331,7 @@ def compile():
f.seek(60)
f.write(int(major).to_bytes(4, byteorder="little"))
f.write(int(minor).to_bytes(4, byteorder="little"))

if not download_ir:
f.seek(0)
bucket.put_object(Body=f.read(), Key='{}.blob'.format(req_hash))
Expand All @@ -348,7 +348,7 @@ def compile():
def remove_dir(response):
shutil.rmtree(env.workdir, ignore_errors=True)
return response

response = make_response(send_file(out_path, as_attachment=True, attachment_filename=out_path.name))
response.headers['X-HASH'] = req_hash
return response
Expand Down
4 changes: 3 additions & 1 deletion patch_openvino.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import sys
from pathlib import Path

# need to patch older openvino version
# due to migration of some model from gdrive to openvino server

versions = {
"2021_4": Path("/opt/intel/openvino_2021"),
"2021_3": Path("/opt/intel/openvino2021_3"),
"2021_2": Path("/opt/intel/openvino2021_2"),
"2021_1": Path("/opt/intel/openvino2021_1"),
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Flask==1.1.2
PyYAML==5.3.1
Flask==2.1.0
PyYAML==5.4.1
boto3==1.17.39
gunicorn==20.1.0
2 changes: 1 addition & 1 deletion setup_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from pathlib import Path

versions = {
"2021_4": Path("/opt/intel/openvino_2021"),
"2021_4": Path("/opt/intel/openvino2021_4"),
"2021_3": Path("/opt/intel/openvino2021_3"),
"2021_2": Path("/opt/intel/openvino2021_2"),
"2021_1": Path("/opt/intel/openvino2021_1"),
Expand Down

0 comments on commit 829b370

Please sign in to comment.