File tree Expand file tree Collapse file tree 4 files changed +17
-20
lines changed
Expand file tree Collapse file tree 4 files changed +17
-20
lines changed Original file line number Diff line number Diff line change 11* .whl
22* .dll
3+ * .so *
Original file line number Diff line number Diff line change 11# Vision SDK
22
3+ ## Test building dependencies
34
4- ## Test building dependencies:
5+ You can build the package in docker by running from root model_api path.
56
6- You can build the package in docker by running from root model_api path
7-
8- ``` sh
7+ ``` sh
98docker build -t vision-api-build -f src/cpp/py_bindings/Dockerfile.ubuntu .
10- docker run --volume < path-to-data-folder> :/data -it vision-api-build bash
11- python src/cpp/py_bindings/scratch .py /data/classification_model_with_xai_head.xml /data/sheep.jpg
9+ docker run --volume < path-to-data-folder> :/data -it vision-api-build bash
10+ python src/cpp/py_bindings/run .py /data/classification_model_with_xai_head.xml /data/sheep.jpg
1211```
1312
1413## Test dependencies to run python package
1514
16- You can test that the python package runs by running from this path:
15+ You can test that the python package runs by running from this path.
1716
18- ``` sh
17+ ``` sh
1918pip wheel .
20- docker build -t vision-api-test -f Dockerfile_test.ubuntu .
21- docker run --volume < path-to-data-folder> :/data -it vision-api-test bash
22- python scratch .py /data/classification_model_with_xai_head.xml /data/sheep.jpg
19+ docker build -t vision-api-test -f Dockerfile_test.ubuntu .
20+ docker run --volume < path-to-data-folder> :/data -it vision-api-test bash
21+ python run .py /data/classification_model_with_xai_head.xml /data/sheep.jpg
2322```
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22
3- from vision_api import ClassificationModel , hello
3+ from vision_api import ClassificationModel
44import cv2
55
66import sys
77
8- hello ()
9-
108if len (sys .argv ) != 3 :
11- raise RuntimeError (f"Usage: { sys .argv [0 ]} <path_to_model> <path_to_image>" )
9+ raise RuntimeError (f"Usage: { sys .argv [0 ]} <path_to_model> <path_to_image>" )
1210
1311model_path = sys .argv [1 ]
1412image_path = sys .argv [2 ]
1513
1614model = ClassificationModel .create_model (model_path )
1715image = cv2 .cvtColor (cv2 .imread (image_path ), cv2 .COLOR_BGR2RGB )
18- print ( model (image ) )
16+ model (image )
Original file line number Diff line number Diff line change 22
33try :
44 from openvino import Core
5+
56 _ = Core () # Triggers loading of shared libs like libopenvino.so
67except Exception as e :
78 raise ImportError (f"Failed to initialize OpenVINO runtime: { e } " )
89
9- from ._vision_api import Classification , ClassificationModel
10-
10+ from ._vision_api import ClassificationModel
1111
12- def hello ():
13- print ("World!" )
12+ __all__ = [ClassificationModel ]
You can’t perform that action at this time.
0 commit comments