Skip to content

Commit 09765a7

Browse files
committed
Clean up a bit
1 parent df0a356 commit 09765a7

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

src/cpp/py_bindings/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
*.whl
22
*.dll
3+
*.so*

src/cpp/py_bindings/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
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
98
docker 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
1918
pip 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
```
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
#!/usr/bin/env python3
22

3-
from vision_api import ClassificationModel, hello
3+
from vision_api import ClassificationModel
44
import cv2
55

66
import sys
77

8-
hello()
9-
108
if 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

1311
model_path = sys.argv[1]
1412
image_path = sys.argv[2]
1513

1614
model = ClassificationModel.create_model(model_path)
1715
image = cv2.cvtColor(cv2.imread(image_path), cv2.COLOR_BGR2RGB)
18-
print(model(image))
16+
model(image)

src/cpp/py_bindings/src/vision_api/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
try:
44
from openvino import Core
5+
56
_ = Core() # Triggers loading of shared libs like libopenvino.so
67
except 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]

0 commit comments

Comments
 (0)