Run `--slow` tests for Raspberry Pi (#10132)

pull/10167/head^2
Glenn Jocher 7 months ago committed by GitHub
parent 0ad01399cd
commit 626309d221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      .github/workflows/ci.yaml
  2. 18
      tests/test_explorer.py

@ -246,8 +246,7 @@ jobs:
pip list
- name: Pytest tests
run: |
# pytest --slow tests/ # WARNING: Slow tests fail on Explorer Tests https://github.com/ultralytics/ultralytics/actions/runs/8715976528/job/23908727539?pr=10097
pytest tests/
pytest --slow tests/
Conda:
if: github.repository == 'ultralytics/ultralytics' && (github.event_name == 'schedule' || github.event.inputs.conda == 'true')

@ -10,18 +10,18 @@ from ultralytics.utils import ASSETS
@pytest.mark.slow
def test_similarity():
"""Test similarity calculations and SQL queries for correctness and response length."""
exp = Explorer()
exp = Explorer(data="coco8.yaml")
exp.create_embeddings_table()
similar = exp.get_similar(idx=1)
assert len(similar) == 25
similar = exp.get_similar(img=ASSETS / "zidane.jpg")
assert len(similar) == 25
similar = exp.get_similar(idx=[1, 2], limit=10)
assert len(similar) == 10
assert len(similar) == 4
similar = exp.get_similar(img=ASSETS / "bus.jpg")
assert len(similar) == 4
similar = exp.get_similar(idx=[1, 2], limit=2)
assert len(similar) == 2
sim_idx = exp.similarity_index()
assert len(sim_idx) > 0
sql = exp.sql_query("WHERE labels LIKE '%person%'")
assert len(sql) > 0
assert len(sim_idx) == 4
sql = exp.sql_query("WHERE labels LIKE '%zebra%'")
assert len(sql) == 1
@pytest.mark.slow

Loading…
Cancel
Save