Docs updates: Add Explorer to tab, YOLOv5 in Guides and Usage in Quickstart (#7438)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: Haixuan Xavier Tao <tao.xavier@outlook.com>
This commit is contained in:
Ayush Chaurasia 2024-01-10 04:20:26 +05:30 committed by GitHub
parent 53150a925b
commit a92adf8231
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 227 additions and 105 deletions

View file

@ -1,8 +1,11 @@
import PIL
from ultralytics import Explorer
from ultralytics.utils import ASSETS
def test_similarity():
"""Test similarity calculations and SQL queries for correctness and response length."""
exp = Explorer()
exp.create_embeddings_table()
similar = exp.get_similar(idx=1)
@ -18,6 +21,7 @@ def test_similarity():
def test_det():
"""Test detection functionalities and ensure the embedding table has bounding boxes."""
exp = Explorer(data='coco8.yaml', model='yolov8n.pt')
exp.create_embeddings_table(force=True)
assert len(exp.table.head()['bboxes']) > 0
@ -25,27 +29,26 @@ def test_det():
assert len(similar) > 0
# This is a loose test, just checks errors not correctness
similar = exp.plot_similar(idx=[1, 2], limit=10)
assert similar is not None
similar.show()
assert isinstance(similar, PIL.Image.Image)
def test_seg():
"""Test segmentation functionalities and verify the embedding table includes masks."""
exp = Explorer(data='coco8-seg.yaml', model='yolov8n-seg.pt')
exp.create_embeddings_table(force=True)
assert len(exp.table.head()['masks']) > 0
similar = exp.get_similar(idx=[1, 2], limit=10)
assert len(similar) > 0
similar = exp.plot_similar(idx=[1, 2], limit=10)
assert similar is not None
similar.show()
assert isinstance(similar, PIL.Image.Image)
def test_pose():
"""Test pose estimation functionalities and check the embedding table for keypoints."""
exp = Explorer(data='coco8-pose.yaml', model='yolov8n-pose.pt')
exp.create_embeddings_table(force=True)
assert len(exp.table.head()['keypoints']) > 0
similar = exp.get_similar(idx=[1, 2], limit=10)
assert len(similar) > 0
similar = exp.plot_similar(idx=[1, 2], limit=10)
assert similar is not None
similar.show()
assert isinstance(similar, PIL.Image.Image)