diff --git a/.github/workflows/test-check.yaml b/.github/workflows/test-check.yaml index 91068101db..55887c290f 100644 --- a/.github/workflows/test-check.yaml +++ b/.github/workflows/test-check.yaml @@ -45,7 +45,7 @@ jobs: - name: "Clean sparsezoo directory" run: rm -r sparsezoo/ - name: ⚙️ Install dependencies - run: pip install .[dev,server,image_classification,transformers,clip] + run: pip install .[dev,server,image_classification,yolov8,transformers,clip] - name: Run base tests run: make test cli-smoke-tests: diff --git a/tests/deepsparse/pipelines/test_yolov8_pipeline.py b/tests/deepsparse/pipelines/test_yolov8_pipeline.py new file mode 100644 index 0000000000..8c36195c1d --- /dev/null +++ b/tests/deepsparse/pipelines/test_yolov8_pipeline.py @@ -0,0 +1,44 @@ +# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from typing import Dict, List + +import pytest +from tests.helpers import run_command + + +@pytest.mark.smoke +def test_yolov8_annotate(cleanup: Dict[str, List]): + sample_img_path = f"{os.path.dirname(__file__)}/sample_images/basilica.jpg" + cmd = [ + "deepsparse.yolov8.annotate", + "--source", + sample_img_path, + "--model_filepath", + "zoo:yolov8-n-coco-base_quantized", + ] + expected_output_path = "annotation-results/deepsparse-annotations/result-0.jpg" + + cleanup["files"].append(expected_output_path) + print(f"\n==== test_yolov8_annotate command ====\n{' '.join(cmd)}") + res = run_command(cmd) + if res.stdout is not None: + print(f"\n==== test_yolov8_annotate output ====\n{res.stdout}") + assert res.returncode == 0 + assert "error" not in res.stdout.lower() + assert "fail" not in res.stdout.lower() + + # check output file exists + assert os.path.exists(expected_output_path)