Bắt đầu

Ultralytics Explorer API

Ghi chú cộng đồng ⚠️

Kể từ ultralytics>=8.3.12, Ultralytics Explorer đã bị gỡ bỏ. Để sử dụng Explorer, hãy cài đặt pip install ultralytics==8.3.11. Các tính năng khám phá bộ dữ liệu tương tự (và được mở rộng) hiện có trên Ultralytics Platform.

Giới thiệu#

Explorer API là Python API dùng để khám phá bộ dữ liệu của bạn. API hỗ trợ lọc và tìm kiếm bộ dữ liệu bằng truy vấn SQL, tìm kiếm tương đồng vector và tìm kiếm ngữ nghĩa.



Xem: Tổng quan về Ultralytics Explorer API

Cài đặt#

Explorer phụ thuộc vào các thư viện bên ngoài để cung cấp một số chức năng. Các thư viện này sẽ được cài đặt tự động khi bạn sử dụng Explorer. Để cài đặt thủ công các dependency này, hãy dùng lệnh sau:

pip install "ultralytics[explorer]==8.3.11"

Cách sử dụng#

from ultralytics import Explorer

# Tạo đối tượng Explorer
explorer = Explorer(data="coco128.yaml", model="yolo11n.pt")

# Tạo embedding cho bộ dữ liệu
explorer.create_embeddings_table()

# Tìm kiếm hình ảnh tương tự với một hoặc nhiều hình ảnh cho trước
df = explorer.get_similar(img="path/to/image.jpg")

# Hoặc tìm kiếm hình ảnh tương tự với một hoặc nhiều chỉ mục cho trước
df = explorer.get_similar(idx=0)
Lưu ý

Bảng embedding cho một cặp bộ dữ liệu và model nhất định chỉ được tạo một lần rồi tái sử dụng. Các bảng này sử dụng LanceDB ở bên dưới, có khả năng mở rộng trên ổ đĩa, nhờ đó bạn có thể tạo và tái sử dụng embedding cho các bộ dữ liệu lớn như COCO mà không bị hết bộ nhớ.

Để buộc cập nhật bảng embedding, hãy truyền force=True vào phương thức create_embeddings_table.

Bạn có thể truy cập trực tiếp đối tượng bảng LanceDB để thực hiện phân tích nâng cao. Tìm hiểu thêm trong phần Làm việc với bảng Embedding.

Tìm kiếm tương đồng, còn gọi là tìm kiếm vector, là kỹ thuật tìm ảnh tương tự với một ảnh cho trước. Kỹ thuật này dựa trên ý tưởng rằng các ảnh tương tự sẽ có embedding tương tự. Sau khi tạo bảng embedding, bạn có thể thực hiện tìm kiếm tương đồng theo một trong các cách sau:

  • Trên một chỉ mục hoặc danh sách chỉ mục nhất định trong bộ dữ liệu: exp.get_similar(idx=[1,10], limit=10)
  • Trên bất kỳ hình ảnh hoặc danh sách hình ảnh nào không thuộc bộ dữ liệu: exp.get_similar(img=["path/to/img1", "path/to/img2"], limit=10)

Nếu có nhiều đầu vào, hệ thống sẽ sử dụng embedding tổng hợp của chúng.

Bạn nhận được một pandas DataFrame chứa limit điểm dữ liệu tương tự nhất với đầu vào, cùng với khoảng cách giữa chúng trong không gian embedding. Bạn có thể dùng bộ dữ liệu này để tiếp tục lọc.

Tìm kiếm ngữ nghĩa
from ultralytics import Explorer

# tạo đối tượng Explorer
exp = Explorer(data="coco128.yaml", model="yolo11n.pt")
exp.create_embeddings_table()

similar = exp.get_similar(img="https://ultralytics.com/images/bus.jpg", limit=10)
print(similar.head())

# Tìm kiếm bằng nhiều hình ảnh
similar = exp.get_similar(
    img=["https://ultralytics.com/images/bus.jpg", "https://ultralytics.com/images/bus.jpg"],
    limit=10,
)
print(similar.head())

Vẽ hình ảnh tương tự#

Bạn cũng có thể vẽ các hình ảnh tương tự bằng phương thức plot_similar. Phương thức này nhận các tham số giống như get_similar và vẽ các hình ảnh tương tự theo dạng lưới.

Vẽ hình ảnh tương tự
from ultralytics import Explorer

# tạo đối tượng Explorer
exp = Explorer(data="coco128.yaml", model="yolo11n.pt")
exp.create_embeddings_table()

plt = exp.plot_similar(img="https://ultralytics.com/images/bus.jpg", limit=10)
plt.show()

2. Ask AI (Truy vấn bằng ngôn ngữ tự nhiên)#

Tính năng này cho phép bạn lọc bộ dữ liệu bằng ngôn ngữ tự nhiên mà không cần viết SQL. Trình tạo truy vấn sử dụng AI chuyển prompt của bạn thành truy vấn và trả về các kết quả phù hợp. Ví dụ, bạn có thể yêu cầu: "hiển thị 100 ảnh có chính xác một người và 2 con chó. Có thể có các đối tượng khác nữa"; hệ thống sẽ tạo truy vấn và hiển thị các kết quả đó. Lưu ý: Tính năng này sử dụng LLM, vì vậy kết quả mang tính xác suất và có thể không chính xác.

Ask AI
from ultralytics.data.explorer import plot_query_result

from ultralytics import Explorer

# tạo đối tượng Explorer
exp = Explorer(data="coco128.yaml", model="yolo11n.pt")
exp.create_embeddings_table()

df = exp.ask_ai("show me 100 images with exactly one person and 2 dogs. There can be other objects too")
print(df.head())

# vẽ kết quả
plt = plot_query_result(df)
plt.show()

3. Truy vấn SQL#

Bạn có thể chạy truy vấn SQL trên bộ dữ liệu bằng phương thức sql_query. Phương thức này nhận truy vấn SQL làm đầu vào và trả về pandas DataFrame chứa kết quả.

Truy vấn SQL
from ultralytics import Explorer

# tạo đối tượng Explorer
exp = Explorer(data="coco128.yaml", model="yolo11n.pt")
exp.create_embeddings_table()

df = exp.sql_query("WHERE labels LIKE '%person%' AND labels LIKE '%dog%'")
print(df.head())

Vẽ kết quả truy vấn SQL#

Bạn cũng có thể vẽ kết quả của truy vấn SQL bằng phương thức plot_sql_query. Phương thức này nhận các tham số giống như sql_query và vẽ kết quả theo dạng lưới.

Vẽ kết quả truy vấn SQL
from ultralytics import Explorer

# tạo đối tượng Explorer
exp = Explorer(data="coco128.yaml", model="yolo11n.pt")
exp.create_embeddings_table()

# vẽ Truy vấn SQL
exp.plot_sql_query("WHERE labels LIKE '%person%' AND labels LIKE '%dog%' LIMIT 10")

4. Làm việc với bảng Embedding#

Bạn cũng có thể làm việc trực tiếp với bảng embedding. Sau khi tạo bảng embedding, bạn có thể truy cập bảng bằng Explorer.table.

Mẹo

Explorer sử dụng các bảng LanceDB ở bên trong. Bạn có thể truy cập trực tiếp bảng này bằng đối tượng Explorer.table và chạy truy vấn thô, đẩy các bộ lọc trước và sau xuống tầng dưới, v.v.

from ultralytics import Explorer

exp = Explorer()
exp.create_embeddings_table()
table = exp.table

Dưới đây là một số ví dụ về những việc bạn có thể thực hiện với bảng:

Lấy embedding thô#

Ví dụ
from ultralytics import Explorer

exp = Explorer()
exp.create_embeddings_table()
table = exp.table

embeddings = table.to_pandas()["vector"]
print(embeddings)

Truy vấn nâng cao với bộ lọc trước và sau#

Ví dụ
from ultralytics import Explorer

exp = Explorer(model="yolo11n.pt")
exp.create_embeddings_table()
table = exp.table

# Embedding giả
embedding = [i for i in range(256)]
rs = table.search(embedding).metric("cosine").where("").limit(10)

Tạo chỉ mục vector#

Khi sử dụng các bộ dữ liệu lớn, bạn cũng có thể tạo chỉ mục vector chuyên dụng để truy vấn nhanh hơn. Thực hiện việc này bằng phương thức create_index trên bảng LanceDB.

table.create_index(num_partitions=..., num_sub_vectors=...)

5. Ứng dụng của Embedding#

Bạn có thể dùng bảng embedding để thực hiện nhiều loại phân tích khám phá. Dưới đây là một số ví dụ:

Chỉ số độ tương đồng#

Explorer có sẵn thao tác similarity_index:

  • Thao tác này ước tính mức độ tương đồng của từng điểm dữ liệu với phần còn lại của bộ dữ liệu.
  • Thao tác này đếm số embedding hình ảnh nằm gần hình ảnh hiện tại hơn max_dist trong không gian embedding được tạo, đồng thời xét top_k hình ảnh tương tự mỗi lần.

Thao tác này trả về pandas DataFrame với các cột sau:

  • idx: Chỉ mục của hình ảnh trong bộ dữ liệu
  • im_file: Đường dẫn đến tệp hình ảnh
  • count: Số hình ảnh trong bộ dữ liệu nằm gần hình ảnh hiện tại hơn max_dist
  • sim_im_files: Danh sách đường dẫn đến count hình ảnh tương tự
Mẹo

Với một bộ dữ liệu, model, max_dist và top_k nhất định, chỉ mục tương đồng sau khi được tạo sẽ được tái sử dụng. Nếu bộ dữ liệu đã thay đổi hoặc bạn cần tạo lại chỉ mục tương đồng, hãy truyền force=True.

Chỉ số độ tương đồng
from ultralytics import Explorer

exp = Explorer()
exp.create_embeddings_table()

sim_idx = exp.similarity_index()

Bạn có thể dùng chỉ mục tương đồng để xây dựng các điều kiện tùy chỉnh nhằm lọc bộ dữ liệu. Ví dụ, đoạn code sau liệt kê các ảnh có hơn 30 ảnh tương tự trong bộ dữ liệu; đây là những ứng viên phù hợp để loại bỏ ảnh gần trùng lặp:

import numpy as np

sim_count = np.array(sim_idx["count"])
sim_idx["im_file"][sim_count > 30]

Trực quan hóa không gian Embedding#

Bạn cũng có thể trực quan hóa không gian embedding bằng công cụ vẽ tùy chọn. Sau đây là ví dụ đơn giản dùng PCA để giảm chiều embedding và vẽ bằng Matplotlib:

import matplotlib.pyplot as plt
from sklearn.decomposition import PCA

# Giảm số chiều xuống còn 3 thành phần bằng PCA để trực quan hóa trong không gian 3D
pca = PCA(n_components=3)
reduced_data = pca.fit_transform(embeddings)

# Tạo biểu đồ phân tán 3D bằng Matplotlib Axes3D
fig = plt.figure(figsize=(8, 6))
ax = fig.add_subplot(111, projection="3d")

# Biểu đồ phân tán
ax.scatter(reduced_data[:, 0], reduced_data[:, 1], reduced_data[:, 2], alpha=0.5)
ax.set_title("3D Scatter Plot of Reduced 256-Dimensional Data (PCA)")
ax.set_xlabel("Component 1")
ax.set_ylabel("Component 2")
ax.set_zlabel("Component 3")

plt.show()

Bắt đầu tạo báo cáo khám phá bộ dữ liệu CV của riêng bạn bằng Explorer API. Để tham khảo ý tưởng, hãy xem Ví dụ khám phá VOC.

Ứng dụng được xây dựng bằng Ultralytics Explorer#

GUI Explorer được xây dựng dựa trên Explorer API.

Câu hỏi thường gặp#

  • Ultralytics Explorer API được thiết kế để khám phá bộ dữ liệu. API cho phép bạn lọc và tìm kiếm bộ dữ liệu bằng truy vấn SQL, tìm kiếm tương đồng vector và tìm kiếm ngữ nghĩa, đồng thời mở rộng quy mô để xử lý các bộ dữ liệu lớn cho tác vụ thị giác máy tính với model Ultralytics.

  • Để cài đặt Ultralytics Explorer API cùng các dependency, hãy sử dụng lệnh sau:

    pip install "ultralytics[explorer]==8.3.11"

    Lệnh này sẽ tự động cài đặt tất cả thư viện bên ngoài cần thiết cho chức năng của Explorer API. Để biết thêm chi tiết về thiết lập, hãy tham khảo phần cài đặt trong tài liệu của chúng tôi.

  • Bạn có thể sử dụng Ultralytics Explorer API để thực hiện tìm kiếm tương đồng bằng cách tạo bảng embeddings và truy vấn bảng để tìm các hình ảnh tương tự. Đây là ví dụ cơ bản:

    from ultralytics import Explorer
    
    # Tạo đối tượng Explorer
    explorer = Explorer(data="coco128.yaml", model="yolo11n.pt")
    explorer.create_embeddings_table()
    
    # Tìm hình ảnh tương tự với một hình ảnh đã cho
    similar_images_df = explorer.get_similar(img="path/to/image.jpg")
    print(similar_images_df.head())

    Để biết thêm chi tiết, vui lòng truy cập phần Tìm kiếm tương đồng.

  • LanceDB, được Ultralytics Explorer sử dụng ở bên dưới, cung cấp các bảng embeddings có khả năng mở rộng và lưu trên ổ đĩa. Nhờ đó, bạn có thể tạo và tái sử dụng embeddings cho các dataset lớn như COCO mà không hết bộ nhớ. Các bảng này chỉ cần tạo một lần và có thể tái sử dụng, giúp nâng cao hiệu quả xử lý dữ liệu.

  • Tính năng Ask AI cho phép người dùng lọc dataset bằng các truy vấn ngôn ngữ tự nhiên. Tính năng này tận dụng LLM để chuyển đổi các truy vấn đó thành truy vấn SQL ở phía sau. Đây là một ví dụ:

    from ultralytics import Explorer
    
    # Tạo đối tượng Explorer
    explorer = Explorer(data="coco128.yaml", model="yolo11n.pt")
    explorer.create_embeddings_table()
    
    # Truy vấn bằng ngôn ngữ tự nhiên
    query_result = explorer.ask_ai("show me 100 images with exactly one person and 2 dogs. There can be other objects too")
    print(query_result.head())

    Để xem thêm ví dụ, hãy tham khảo phần Ask AI.

Bình luận2

Đặt câu hỏi, chia sẻ kết quả hoặc giúp đỡ người khác.

  1. Jie Liu

    I have downloaded ultralytics-8.3.118 github zip package and install it with pip install -e .. Then I use pip install ultralytics[explorer] to install explorer, but I got a error as followed

    Requirement already satisfied: ultralytics[explorer] in /data/miniconda3/envs/app/lib/python3.10/site-packages (8.3.118)
    WARNING: ultralytics 8.3.118 does not provide the extra 'explorer'
    Requirement already satisfied: numpy<=2.1.1,>=1.23.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (1.26.4)
    Requirement already satisfied: matplotlib>=3.3.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (3.10.1)
    Requirement already satisfied: opencv-python>=4.6.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (4.11.0.86)
    Requirement already satisfied: pillow>=7.1.2 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (11.2.1)
    Requirement already satisfied: pyyaml>=5.3.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (6.0.2)
    Requirement already satisfied: requests>=2.23.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (2.32.3)
    Requirement already satisfied: scipy>=1.4.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (1.15.2)
    Requirement already satisfied: torch>=1.8.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (2.3.1)
    Requirement already satisfied: torchvision>=0.9.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (0.18.1)
    Requirement already satisfied: tqdm>=4.64.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (4.67.1)
    Requirement already satisfied: psutil in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (7.0.0)
    Requirement already satisfied: py-cpuinfo in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (9.0.0)
    Requirement already satisfied: pandas>=1.1.4 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (2.2.3)
    Requirement already satisfied: seaborn>=0.11.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (0.13.2)
    Requirement already satisfied: ultralytics-thop>=2.0.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from ultralytics[explorer]) (2.0.14)
    Requirement already satisfied: contourpy>=1.0.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (1.3.2)
    Requirement already satisfied: cycler>=0.10 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (0.12.1)
    Requirement already satisfied: fonttools>=4.22.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (4.57.0)
    Requirement already satisfied: kiwisolver>=1.3.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (1.4.8)
    Requirement already satisfied: packaging>=20.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (24.2)
    Requirement already satisfied: pyparsing>=2.3.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (3.2.3)
    Requirement already satisfied: python-dateutil>=2.7 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from matplotlib>=3.3.0->ultralytics[explorer]) (2.9.0.post0)
    Requirement already satisfied: pytz>=2020.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics[explorer]) (2022.7.1)
    Requirement already satisfied: tzdata>=2022.7 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from pandas>=1.1.4->ultralytics[explorer]) (2025.2)
    Requirement already satisfied: charset-normalizer<4,>=2 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics[explorer]) (3.4.1)
    Requirement already satisfied: idna<4,>=2.5 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics[explorer]) (3.10)
    Requirement already satisfied: urllib3<3,>=1.21.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics[explorer]) (1.26.20)
    Requirement already satisfied: certifi>=2017.4.17 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from requests>=2.23.0->ultralytics[explorer]) (2025.4.26)
    Requirement already satisfied: filelock in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (3.18.0)
    Requirement already satisfied: typing-extensions>=4.8.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (4.13.2)
    Requirement already satisfied: sympy in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (1.13.3)
    Requirement already satisfied: networkx in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (3.4.2)
    Requirement already satisfied: jinja2 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (3.1.6)
    Requirement already satisfied: fsspec in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (2025.3.2)
    Requirement already satisfied: nvidia-cuda-nvrtc-cu12==12.1.105 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (12.1.105)
    Requirement already satisfied: nvidia-cuda-runtime-cu12==12.1.105 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (12.1.105)
    Requirement already satisfied: nvidia-cuda-cupti-cu12==12.1.105 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (12.1.105)
    Requirement already satisfied: nvidia-cudnn-cu12==8.9.2.26 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (8.9.2.26)
    Requirement already satisfied: nvidia-cublas-cu12==12.1.3.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (12.1.3.1)
    Requirement already satisfied: nvidia-cufft-cu12==11.0.2.54 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (11.0.2.54)
    Requirement already satisfied: nvidia-curand-cu12==10.3.2.106 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (10.3.2.106)
    Requirement already satisfied: nvidia-cusolver-cu12==11.4.5.107 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (11.4.5.107)
    Requirement already satisfied: nvidia-cusparse-cu12==12.1.0.106 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (12.1.0.106)
    Requirement already satisfied: nvidia-nccl-cu12==2.20.5 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (2.20.5)
    Requirement already satisfied: nvidia-nvtx-cu12==12.1.105 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (12.1.105)
    Requirement already satisfied: triton==2.3.1 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from torch>=1.8.0->ultralytics[explorer]) (2.3.1)
    Requirement already satisfied: nvidia-nvjitlink-cu12 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from nvidia-cusolver-cu12==11.4.5.107->torch>=1.8.0->ultralytics[explorer]) (12.8.93)
    Requirement already satisfied: six>=1.5 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib>=3.3.0->ultralytics[explorer]) (1.17.0)
    Requirement already satisfied: MarkupSafe>=2.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from jinja2->torch>=1.8.0->ultralytics[explorer]) (3.0.2)
    Requirement already satisfied: mpmath<1.4,>=1.1.0 in /data/miniconda3/envs/app/lib/python3.10/site-packages (from sympy->torch>=1.8.0->ultralytics[explorer]) (1.3.0)

    when run code

    from ultralytics import Explorer
    
    # Create an Explorer object
    explorer = Explorer(data="coco128.yaml", model="yolo11n.pt")
    
    # Create embeddings for your dataset
    explorer.create_embeddings_table()
    
    # Search for similar images to a given image/images
    dataframe = explorer.get_similar(img="path/to/image.jpg")
    
    # Or search for similar images to a given index/indices
    dataframe = explorer.get_similar(idx=0)

    The error has arisen

    Traceback (most recent call last):
      File "/data/liujie/data/ultralytics-8.3.13/tutorial/debug/explorer.py", line 1, in <module>
        from ultralytics import Explorer
    ImportError: cannot import name 'Explorer' from 'ultralytics' (/data/liujie/data/ultralytics-8.3.118/ultralytics/__init__.py)

    please help me to install and use explorer

    1. Glenn JocherUltralytics(đã chỉnh sửa)

      Hi @keeper-jie,

      The issue you're experiencing is because Ultralytics Explorer has been removed since version 8.3.12, and you're using version 8.3.118. That's why you're seeing the warning that the 'explorer' extra is not provided and why you can't import the Explorer class.

      As noted in our documentation, we've moved this functionality to Ultralytics Platform, our platform that offers similar and enhanced capabilities for exploring, visualizing, and managing your datasets without writing code.

      If you specifically need the Explorer API functionality in your code, you would need to downgrade to a version prior to 8.3.12. However, we recommend trying Ultralytics Platform instead, as it provides an improved experience with all the dataset exploration features you're looking for.

      Let me know if you need any further assistance with Ultralytics Platform or if you have any other questions.