Skip to content

Commit

Permalink
Add OBB benchmarks to CI (ultralytics#7777)
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Jocher <[email protected]>
  • Loading branch information
glenn-jocher authored Jan 23, 2024
1 parent 1152a06 commit 3c11707
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ jobs:
- name: Benchmark PoseModel
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
- 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
run: |
coverage xml -o coverage-benchmarks.xml
Expand Down
2 changes: 1 addition & 1 deletion docs/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def build_docs(use_languages=False, clone_repos=True):
if not local_dir.exists():
os.system(f"git clone {repo} {local_dir}")
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.rmtree(DOCS / "en/hub/sdk/reference") # temporarily delete reference until we find a solution for this
print(f"Cloned/Updated {repo} in {local_dir}")
Expand Down
2 changes: 1 addition & 1 deletion docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ nav:
- Models: hub/models.md
- Integrations: hub/integrations.md
- Inference API: hub/inference-api.md
- On Premise:
- On-Premise:
- hub/on-premise/index.md
- App:
- hub/app/index.md
Expand Down
2 changes: 1 addition & 1 deletion ultralytics/cfg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"segment": "metrics/mAP50-95(M)",
"classify": "metrics/accuracy_top1",
"pose": "metrics/mAP50-95(P)",
"obb": "metrics/mAP50-95(OBB)",
"obb": "metrics/mAP50-95(B)",
}

CLI_HELP_MSG = f"""
Expand Down
8 changes: 6 additions & 2 deletions ultralytics/utils/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ def benchmark(
for i, (name, format, suffix, cpu, gpu) in export_formats().iterrows(): # index, (name, format, suffix, CPU, GPU)
emoji, filename = "❌", None # export defaults
try:
assert i != 9 or LINUX, "Edge TPU export only supported on Linux"
if i in {5, 10}: # CoreML and TF.js
# Checks
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"
if "cpu" in device.type:
assert cpu, "inference not supported on CPU"
Expand Down

0 comments on commit 3c11707

Please sign in to comment.