diff --git a/.github/workflows/test_precommit.yml b/.github/workflows/test_precommit.yml index 8abd69e4..cb7f3295 100644 --- a/.github/workflows/test_precommit.yml +++ b/.github/workflows/test_precommit.yml @@ -149,10 +149,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-20.04, ubuntu-22.04, macos-12] - python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] + python-version: [3.8, 3.9, '3.10', '3.11'] exclude: - - os: macos-12 - python-version: 3.7 - os: macos-12 python-version: 3.9 - os: macos-12 diff --git a/README.md b/README.md index e881a52e..40522240 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,8 @@ Model API searches for additional information required for model inference, data from openvino.model_api.models import DetectionModel # Create a model (downloaded and cached automatically for OpenVINO Model Zoo models) -# Use URL to work with served model, e.g. "localhost:9000/models/ssd300" -ssd = DetectionModel.create_model("ssd300") +# Use URL to work with served model, e.g. "localhost:9000/models/ssdlite_mobilenet_v2" +ssd = DetectionModel.create_model("ssdlite_mobilenet_v2") # Run synchronous inference locally detections = ssd(image) # image is numpy.ndarray @@ -63,7 +63,7 @@ print(f"Detection results: {detections}") #include // Load the model fetched using Python API -auto model = DetectionModel::create_model("~/.cache/omz/public/ssd300/FP16/ssd300.xml"); +auto model = DetectionModel::create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml"); // Run synchronous inference locally auto result = model->infer(image); // image is cv::Mat @@ -81,13 +81,13 @@ Model's static method `create_model()` has two overloads. One constructs the mod There are usecases when it is not possible to modify an internal `ov::Model` and it is hidden behind `InferenceAdapter`. For example the model can be served using [OVMS](https://github.com/openvinotoolkit/model_server). `create_model()` can construct a model from a given `InferenceAdapter`. That approach assumes that the model in `InferenceAdapter` was already configured by `create_model()` called with a string (a path or a model name). It is possible to prepare such model using C++ or Python: C++ ```Cpp -auto model = DetectionModel::create_model("~/.cache/omz/public/ssd300/FP16/ssd300.xml"); +auto model = DetectionModel::create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml"); const std::shared_ptr& ov_model = model->getModel(); ov::serialize(ov_model, "serialized.xml"); ``` Python ```python -model = DetectionModel.create_model("~/.cache/omz/public/ssd300/FP16/ssd300.xml") +model = DetectionModel.create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml") model.save("serialized.xml") ``` After that the model can be constructed from `InferenceAdapter`: @@ -107,7 +107,7 @@ For more details please refer to the [examples](https://github.com/openvinotoolk - [OpenVINO Model Zoo models](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md#classification-models) - Object Detection: - [OpenVINO Model Zoo models](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md#object-detection-models): - - SSD-based models (e.g. "ssd300", "ssdlite_mobilenet_v2", etc.) + - SSD-based models (e.g. "ssdlite_mobilenet_v2", etc.) - YOLO-based models (e.g. "yolov3", "yolov4", etc.) - CTPN: "ctpn" - DETR: "detr-resnet50" @@ -127,7 +127,7 @@ For more details please refer to the [examples](https://github.com/openvinotoolk - Image Classification: - [OpenVINO Model Zoo models](https://github.com/openvinotoolkit/open_model_zoo/blob/master/models/public/index.md#classification-models) - Object Detection: - - SSD-based models (e.g. "ssd300", "ssdlite_mobilenet_v2", etc.) + - SSD-based models (e.g. "ssdlite_mobilenet_v2", etc.) - YOLO-based models (e.g. "yolov3", "yolov4", etc.) - CenterNet: "ctdet_coco_dlav0_512" - FaceBoxes: "faceboxes-pytorch" diff --git a/examples/python/synchronous_api/run.py b/examples/python/synchronous_api/run.py index 75150925..deb154b0 100755 --- a/examples/python/synchronous_api/run.py +++ b/examples/python/synchronous_api/run.py @@ -18,7 +18,6 @@ import sys import cv2 -import openvino.runtime as ov from openvino.model_api.models import ( ClassificationModel, DetectionModel, diff --git a/model_api/python/openvino/model_api/adapters/openvino_adapter.py b/model_api/python/openvino/model_api/adapters/openvino_adapter.py index 0b029af0..9e69e91c 100644 --- a/model_api/python/openvino/model_api/adapters/openvino_adapter.py +++ b/model_api/python/openvino/model_api/adapters/openvino_adapter.py @@ -185,7 +185,7 @@ def __init__( self.model = core.read_model(self.model_path, weights_path) return if isinstance(model, str): - from openvino.model_zoo.models import OMZModel, list_models + from omz_tools.models import OMZModel, list_models if model in list_models(): omz_model = OMZModel.download( diff --git a/model_api/python/requirements.txt b/model_api/python/requirements.txt index 65f29ffa..ee075cd2 100644 --- a/model_api/python/requirements.txt +++ b/model_api/python/requirements.txt @@ -1,5 +1,7 @@ numpy>=1.16.6 opencv-python scipy>=1.5.4 -openvino>=2023.0.0 +# TODO: set 2024.0 after the release +openvino>=2023.3 openvino-dev>=2023.0.0 +omz_tools @ git+https://github.com/openvinotoolkit/open_model_zoo.git@master#egg=omz_tools&subdirectory=tools/model_tools diff --git a/tests/cpp/precommit/public_scope.json b/tests/cpp/precommit/public_scope.json index 373803bb..1e617a05 100644 --- a/tests/cpp/precommit/public_scope.json +++ b/tests/cpp/precommit/public_scope.json @@ -1,8 +1,4 @@ [ - { - "name": "ssd300", - "type": "DetectionModel" - }, { "name": "ssd_mobilenet_v1_fpn_coco", "type": "DetectionModel" diff --git a/tests/python/accuracy/public_scope.json b/tests/python/accuracy/public_scope.json index 77c3c2e5..cc56e529 100644 --- a/tests/python/accuracy/public_scope.json +++ b/tests/python/accuracy/public_scope.json @@ -70,16 +70,6 @@ } ] }, - { - "name": "ssd300", - "type": "DetectionModel", - "test_data": [ - { - "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["0, 13, 169, 338, 2 (bicycle): 0.870; 58, 275, 360, 384, 12 (dog): 0.998; 324, 98, 344, 148, 15 (person): 0.652; [0]; [0]"] - } - ] - }, { "name": "ssd_mobilenet_v1_fpn_coco", "type": "DetectionModel", @@ -142,12 +132,12 @@ ] }, { - "name": "se-resnext-50", + "name": "mobilenet-v3-large-1.0-224-tf", "type": "ClassificationModel", "test_data": [ { "image": "coco128/images/train2017/000000000074.jpg", - "reference": ["175 (Labrador_retriever): 0.616, [0], [0], [0]"] + "reference": ["208 (Labrador_retriever): 0.166, [0], [0], [0]"] } ] }, diff --git a/tests/python/precommit/test_save.py b/tests/python/precommit/test_save.py index 4ffedf5a..e26052f0 100644 --- a/tests/python/precommit/test_save.py +++ b/tests/python/precommit/test_save.py @@ -3,7 +3,8 @@ def test_detector_save(tmp_path): downloaded = Model.create_model( - "ssd300", configuration={"mean_values": [0, 0, 0], "confidence_threshold": 0.6} + "ssd_mobilenet_v1_fpn_coco", + configuration={"mean_values": [0, 0, 0], "confidence_threshold": 0.6}, ) assert True == downloaded.get_model().get_rt_info( ["model_info", "embedded_processing"]