Ultralytics Explorer#
自 ultralytics>=8.3.12 起,Ultralytics Explorer 已被移除。要使用 Explorer,请安装 pip install ultralytics==8.3.11。你可以在 Ultralytics Platform 使用类似(且功能更丰富)的数据集探索功能。
Ultralytics Explorer 是一款用于探索 CV 数据集的工具,支持语义搜索、SQL 查询、向量相似性搜索和自然语言提示。它还提供 Python API,可访问相同功能。
观看: Ultralytics Explorer API | 语义搜索、SQL 查询和 Ask AI 功能
安装可选依赖项#
Explorer 的部分功能依赖外部库。使用 Explorer 时,系统会自动安装这些库。你也可以使用以下命令手动安装这些依赖项:
pip install "ultralytics[explorer]==8.3.11"Explorer API#
这是一个用于探索数据集的 Python API,也为 GUI Explorer 提供支持。你可以用它创建自己的探索性笔记本或脚本,从数据集中获取洞察。
在 Explorer API 文档中了解完整功能和使用示例。
GUI Explorer 使用方法#
GUI 演示可在浏览器中运行,让你为数据集创建嵌入向量、搜索相似图像、运行 SQL 查询并进行语义搜索。你可以使用以下命令运行它:
yolo explorerAsk AI 功能使用 OpenAI,因此首次运行 GUI 时,系统会提示你设置 OpenAI API 密钥。 你可以这样设置 - yolo settings openai_api_key="..."
常见问题#
Ultralytics Explorer 是一款用于探索计算机视觉(CV)数据集的工具,支持语义搜索、SQL 查询、向量相似性搜索和自然语言。它同时提供 GUI 和 Python API。由于它通过 LanceDB 将嵌入存储在磁盘上,因此可以扩展到大型数据集,而不会过度占用内存。
详细了解 Explorer API。
要手动安装 Ultralytics Explorer 所需的可选依赖项,你可以使用以下
pip命令:pip install "ultralytics[explorer]==8.3.11"语义搜索和 SQL 查询需要这些依赖项。其中包括 LanceDB,它能让数据库操作保持高效且易于扩展,即使处理 COCO 等大型数据集也不例外。
Ultralytics Explorer 的 GUI 版本使用起来很简单。安装所需依赖项后,你可以使用以下命令启动 GUI:
yolo explorerGUI 提供易用的界面,可用于创建数据集嵌入、搜索相似图像、运行 SQL 查询和执行语义搜索。由 OpenAI 提供支持的 Ask AI 功能还允许你使用自然语言查询数据集。
有关存储和可扩展性的信息,请查看我们的安装说明。
Ultralytics Explorer 中的 Ask AI 功能允许用户通过自然语言查询与数据集交互。该功能由 OpenAI 提供支持,你可以就数据集提问,而无需编写 SQL 查询或类似命令。要使用此功能,你需要在首次运行 GUI 时设置 OpenAI API 密钥:
yolo settings openai_api_key="YOUR_API_KEY"有关此功能及其集成方式的更多信息,请参阅GUI Explorer 使用方法部分。
可以。在 Colab 笔记本中使用
pip install ultralytics==8.3.11安装指定版本,然后按照 VOC 探索示例在 Google 云资源上构建嵌入向量并运行搜索。更多信息请参阅我们的 Google Colab 指南。
评论13
提出问题、分享结果,或帮助其他人。
pooya-github
Hi,
In colab code after running !pip install ultralytics[explorer] and running: from ultralytics import explorer i got the following error:
ImportError Traceback (most recent call last) in <cell line: 1>() ----> 1 from ultralytics import explorer
ImportError: cannot import name 'explorer' from 'ultralytics' (/usr/local/lib/python3.10/dist-packages/ultralytics/init.py)
how can i fix it?
Glenn JocherUltralytics(已编辑)@pooya-github the
Ultralytics Explorerfeature has been removed as ofultralytics>=8.3.12. To access similar or enhanced functionality, we recommend using Ultralytics Platform, our platform for dataset exploration and management. Let me know if you have further questions!-2
mkutu
how can I set this up with a custom dataset? Could you direct me to any resources. Thanks!
Glenn JocherUltralytics(已编辑)@mkutu hello!
Setting up YOLO26 with a custom dataset can be straightforward! You'd primarily need a data YAML file to describe your dataset structure and then use it in your training command. Here’s a basic guide to get you started:
-
Prepare your data: Organize your dataset into two folders (images and labels), with corresponding files named identically.
-
Create a YAML file: This file should specify the paths to your training and validation data, the number of classes, and class names. Here's an example:
# custom_data.yaml train: path/to/train/images val: path/to/val/images nc: number_of_classes names: ['class1', 'class2', 'class3'] -
Start Training: Use the following command to train your model:
yolo train data=custom_data.yaml model=yolo26n.yaml
For exploring and managing your datasets efficiently, you might consider using the Ultralytics Explorer (removed in
ultralytics>=8.3.12; useultralytics==8.3.11or Ultralytics Platform). This tool offers features like semantic search, SQL queries, and even AI-based querying to derive insights from your data.Hope this helps! If you have any more questions, feel free to ask.
-2-
BABAFAREEDDUDEKULA
how can i run above mentioned AI using yolo v8 previously i have tried yolo v9,v8,v7,rt-detr
AloshkaD
Can you be more specific?
Glenn JocherUltralytics(已编辑)Hey there! 🌟
It sounds like you've got a pretty wide range of experience with various YOLO versions and even RT-DETR! For running AI using YOLO26 specifically, the process is smoothly integrated into the Ultralytics framework, much like the versions you've mentioned.
To get started, make sure you have Ultralytics YOLO26 installed. If not, you can do so via pip:
pip install ultralyticsAnd then, to run your AI model with YOLO26, you can simply use:
from ultralytics import YOLO # Load the model model = YOLO('yolo26n.pt') # Here 'yolo26n.pt' is an example model. Replace it with your model path. # Run inference results = model('path_to_your_image_or_video')Or, if you prefer using the command line:
yolo detect predict model=yolo26n.pt source=path_to_your_image_or_videoRemember to replace 'yolo26n.pt' and 'path_to_your_image_or_video' with the actual paths to your YOLO26 model and the image or video you want to run inference on. 🚀
Since you've used various versions before, the process should feel quite familiar. If there's more specific functionality from the Ultralytics Explorer that you're interested in integrating with YOLO26, such as semantic search or SQL queries, the installation command provided in the documentation will be your first step:
pip install ultralytics[explorer]After that, you can launch the Ultralytics Explorer with:
yolo explorerAnd dive into explore mode (Explorer requires
ultralytics==8.3.11, as it was removed inultralytics>=8.3.12)! For any further details or if you've got a unique use case in mind, feel free to share more specifics. Happy to help further. Happy coding! 🎉1BABAFAREEDDUDEKULA
Thanks a lot my brother
2
Glenn JocherUltralytics(已编辑)Note: Ultralytics Explorer was removed in
ultralytics>=8.3.12; to use it, installultralytics==8.3.11. Similar dataset exploration features are available in Ultralytics Platform.@BABAFAREEDDUDEKULA hey there! 😄
Thanks for reaching out. If you're interested in diving into the Ultralytics Explorer to explore CV datasets with semantic search, SQL queries, vector similarity search, and more, it sounds like you're on the right track!
To get started, ensure you've got the Explorer installed via:
pip install ultralytics[explorer]Once installed, you can jump straight into using the GUI by typing:
yolo explorerThis launches the GUI in your browser, where you can experiment with creating embeddings, conducting image searches, and even using SQL or natural language queries!
If you encounter any issues or have specific questions as you use the Ultralytics Explorer, feel free to drop them here. Happy exploring! 🌟
AloshkaD
The yolo explorer command will open the explorer on the local machine. How would I set it up to work on AWS while I'm connected with my local machine using ssh?
Paula DerrengerUltralytics(已编辑)Note: Ultralytics Explorer was removed in
ultralytics>=8.3.12; to use it, installultralytics==8.3.11. Similar dataset exploration features are available in Ultralytics Platform.To set up the Ultralytics Explorer to work on an AWS instance while you're connected via SSH from your local machine, you can use port forwarding to access the Explorer's web interface. Here's a concise step-by-step guide:
-
SSH into AWS with Port Forwarding: Use the
-Loption to forward a local port to a port on the AWS instance. Replacelocal_portwith a port on your local machine (e.g.,8080), andaws_portwith the port the Explorer runs on (usually5000).ssh -i /path/to/your/key.pem -L local_port:localhost:aws_port user @AloshkaD -
Run Explorer on AWS: Once connected, start the Explorer on the AWS instance:
yolo explorer -
Access Explorer Locally: Open a web browser on your local machine and navigate to
localhost:local_portto access the Explorer interface.
Remember to replace
/path/to/your/key.pemwith the path to your AWS key,userwith your AWS username, andaws_instance_ipwith your AWS instance's IP address. Also, ensure that the AWS security group allows inbound traffic on theaws_port.1-
AloshkaD
Worked with a minor tweak to reference my config file. Thank you!
Paula DerrengerUltralytics@AloshkaD you're welcome! I'm glad to hear that you were able to get it working with your config file. If you have any more questions or need further assistance in the future, don't hesitate to reach out. Happy exploring with Ultralytics Explorer! 🚀😊
1