-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for
deepsparse.yolov8.annotate
(#1620)
* Add test for `deepsparse.yolov8.annotate` * Format * Update test-check.yaml * Format test
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |