diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fd5289f46b..e9b1feee34 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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') diff --git a/tests/test_explorer.py b/tests/test_explorer.py index 296db94978..2348a4dfd2 100644 --- a/tests/test_explorer.py +++ b/tests/test_explorer.py @@ -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