Add OBB benchmarks to CI (#7777)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Glenn Jocher 2024-01-23 19:40:41 +01:00 committed by GitHub
parent 1152a06cbc
commit 3c1170769a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 5 deletions

View File

@ -127,6 +127,9 @@ jobs:
- name: Benchmark PoseModel - name: Benchmark PoseModel
shell: bash shell: bash
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-pose.pt' imgsz=160 verbose=0.185 run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-pose.pt' imgsz=160 verbose=0.185
- name: Benchmark OBBModel
shell: bash
run: coverage run -a --source=ultralytics -m ultralytics.cfg.__init__ benchmark model='path with spaces/${{ matrix.model }}-obb.pt' imgsz=160 verbose=0.360
- name: Merge Coverage Reports - name: Merge Coverage Reports
run: | run: |
coverage xml -o coverage-benchmarks.xml coverage xml -o coverage-benchmarks.xml

View File

@ -48,7 +48,7 @@ def build_docs(use_languages=False, clone_repos=True):
if not local_dir.exists(): if not local_dir.exists():
os.system(f"git clone {repo} {local_dir}") os.system(f"git clone {repo} {local_dir}")
os.system(f"git -C {local_dir} pull") # update repo os.system(f"git -C {local_dir} pull") # update repo
shutil.rmtree(DOCS / "en/hub/sdk") shutil.rmtree(DOCS / "en/hub/sdk", ignore_errors=True) # delete if exists
shutil.copytree(local_dir / "docs", DOCS / "en/hub/sdk") shutil.copytree(local_dir / "docs", DOCS / "en/hub/sdk")
shutil.rmtree(DOCS / "en/hub/sdk/reference") # temporarily delete reference until we find a solution for this shutil.rmtree(DOCS / "en/hub/sdk/reference") # temporarily delete reference until we find a solution for this
print(f"Cloned/Updated {repo} in {local_dir}") print(f"Cloned/Updated {repo} in {local_dir}")

View File

@ -351,7 +351,7 @@ nav:
- Models: hub/models.md - Models: hub/models.md
- Integrations: hub/integrations.md - Integrations: hub/integrations.md
- Inference API: hub/inference-api.md - Inference API: hub/inference-api.md
- On Premise: - On-Premise:
- hub/on-premise/index.md - hub/on-premise/index.md
- App: - App:
- hub/app/index.md - hub/app/index.md

View File

@ -51,7 +51,7 @@ TASK2METRIC = {
"segment": "metrics/mAP50-95(M)", "segment": "metrics/mAP50-95(M)",
"classify": "metrics/accuracy_top1", "classify": "metrics/accuracy_top1",
"pose": "metrics/mAP50-95(P)", "pose": "metrics/mAP50-95(P)",
"obb": "metrics/mAP50-95(OBB)", "obb": "metrics/mAP50-95(B)",
} }
CLI_HELP_MSG = f""" CLI_HELP_MSG = f"""

View File

@ -83,8 +83,12 @@ def benchmark(
for i, (name, format, suffix, cpu, gpu) in export_formats().iterrows(): # index, (name, format, suffix, CPU, GPU) for i, (name, format, suffix, cpu, gpu) in export_formats().iterrows(): # index, (name, format, suffix, CPU, GPU)
emoji, filename = "", None # export defaults emoji, filename = "", None # export defaults
try: try:
assert i != 9 or LINUX, "Edge TPU export only supported on Linux" # Checks
if i in {5, 10}: # CoreML and TF.js if i == 9:
assert LINUX, "Edge TPU export only supported on Linux"
elif i == 7:
assert model.task != "obb", "TensorFlow GraphDef not supported for OBB task"
elif i in {5, 10}: # CoreML and TF.js
assert MACOS or LINUX, "export only supported on macOS and Linux" assert MACOS or LINUX, "export only supported on macOS and Linux"
if "cpu" in device.type: if "cpu" in device.type:
assert cpu, "inference not supported on CPU" assert cpu, "inference not supported on CPU"