开始使用

Explorer GUI

社区提示 ⚠️

自 ultralytics>=8.3.12 起,Ultralytics Explorer 已被移除。要使用 Explorer,请安装 pip install ultralytics==8.3.11。你可以在 Ultralytics Platform 使用类似(且功能更丰富)的数据集探索功能。

Explorer GUI 基于 Ultralytics Explorer API 构建。它允许你运行语义/向量相似性搜索和 SQL 查询,并使用由 LLMs 提供支持的 Ask AI 功能执行自然语言查询。

Ultralytics Explorer GUI main dashboard interface



观看: Ultralytics Explorer 仪表板概览

安装#

pip install "ultralytics[explorer]==8.3.11"
注意

Ask AI 功能使用 OpenAI,因此你首次运行 GUI 时,系统会提示你设置 OpenAI API 密钥。 使用 yolo settings openai_api_key="..." 进行设置。

语义搜索是一种根据给定图像查找相似图像的技术。它基于这样一个理念:相似的图像会有相似的嵌入。在 UI 中,你可以选择一张或多张图像,然后搜索与这些图像相似的图像。当你想查找与某张图像或一组表现不如预期的图像相似的图像时,这项功能会很有用。

例如,在这个 VOC 探索仪表板中,用户选择了几张飞机图像:

Explorer selecting airplane images for similarity search

运行相似度搜索后,你应该会看到相似的结果:

Ultralytics Explorer semantic similarity search

Ask AI#

这项功能让你无需编写 SQL,就能使用自然语言筛选数据集。AI 驱动的查询生成器会将你的提示转换为查询,并返回匹配的结果。例如,你可以这样提问:“给我显示 100 张恰好有一个人和 2 只狗的图像。也可以有其他物体”,它就会生成查询并显示相应结果。以下是提问“显示 10 张恰好有 5 个人的图像”时的输出示例:

Explorer Ask AI results for images with 5 persons

注意:此功能使用大型语言模型,因此结果具有概率性,可能不准确。

在你的 CV 数据集上运行 SQL 查询#

你可以在数据集上运行 SQL 查询来筛选数据。也可以只提供 WHERE 子句。例如,以下 WHERE 子句会返回至少包含一个人和一只狗的图像:

WHERE labels LIKE '%person%' AND labels LIKE '%dog%'

Explorer SQL query filtering images with person and dog

这个演示使用 Explorer API 构建,你可以用它创建自己的探索笔记本或脚本,从数据集中获取洞见。要开始使用,请查看 Explorer API 文档。

常见问题#

  • Ultralytics Explorer GUI 是一个基于 Ultralytics Explorer API 构建的浏览器界面,用于探索数据集。它允许你运行语义/向量相似性搜索和 SQL 查询,并使用由大型语言模型(LLMs)提供支持的 Ask AI 功能执行自然语言查询。

    你可以使用 pip 安装 Explorer GUI:

    pip install "ultralytics[explorer]==8.3.11"

    注意:要使用 Ask AI 功能,你需要设置 OpenAI API 密钥:yolo settings openai_api_key="..."。

  • Ultralytics Explorer GUI 中的语义搜索功能可根据嵌入查找与给定图像相似的图像。这项技术适用于识别和探索具有视觉相似性的图像。要使用此功能,请在 UI 中选择一张或多张图像,然后执行相似图像搜索。结果将显示与所选图像高度相似的图像,从而助你高效探索数据集和进行异常检测。

  • 可以。借助由大型语言模型 (LLMs) 驱动的 Ask AI 功能,你可以使用自然语言查询筛选数据集。你不需要精通 SQL。例如,你可以提问:“给我显示 100 张恰好有一个人和 2 只狗的图像。也可以有其他物体”,AI 就会在后台生成合适的查询并返回所需结果。

  • Ultralytics Explorer GUI 支持你直接在数据集上运行 SQL 查询,从而高效筛选和管理数据。要运行查询,请在 GUI 中打开 SQL 查询部分并编写查询。例如,要显示至少包含一个人和一只狗的图像,可以使用:

    WHERE labels LIKE '%person%' AND labels LIKE '%dog%'

    你也可以只提供 WHERE 子句,让查询过程更加灵活。

    更多详情请参阅 SQL 查询部分。

  • Ultralytics Explorer GUI 通过语义搜索、SQL 查询和 Ask AI 自然语言交互等功能,增强了数据探索能力。这些功能让用户能够:

    • 高效查找视觉上相似的图像。
    • 使用复杂的 SQL 查询筛选数据集。
    • 利用 AI 执行自然语言搜索,无需具备高级 SQL 专业知识。

    这些功能有助于开发者、研究人员和数据科学家理解并整理数据集。

评论7

提出问题、分享结果,或帮助其他人。

  1. ws1065GitHub

    I executed yolo Explorer to try to open Explorer dashboard, but it shows that it should be a port monitoring error? I don't know what port it is listening on, and yolo explorer doesn't have a help command?

    1. Glenn JocherUltralytics(已编辑)

      Note: Ultralytics Explorer was removed in ultralytics>=8.3.12; to use it, install ultralytics==8.3.11. Similar dataset exploration features are available in Ultralytics Platform.

      @ws1065 it sounds like you're encountering a port conflict issue when trying to run the Explorer dashboard. By default, the Explorer GUI listens on port 8080. You can specify a different port by using the --port argument when launching the GUI. For example, you can try yolo explorer --port 8081. If the issue persists, please ensure you are using the latest version of the package by updating it with pip install --upgrade ultralytics[explorer]. For further details, you can refer to the Ultralytics Explorer documentation.

    1. Glenn JocherUltralytics(已编辑)

      To run Ultralytics YOLO with your own data and model, you'll need to follow these steps:

      1. Prepare your dataset in a format that YOLO can understand, typically consisting of images and corresponding annotation files.
      2. Train your model using the yolo train command, specifying your dataset and model configuration file.
      3. After training, you can validate, make predictions, or use other features like tracking with your trained model.

      Here's a quick example of how you might train your model:

      from ultralytics import YOLO
      
      # Create a new YOLO model from your custom config
      model = YOLO('path/to/your/model.yaml')
      
      # Train the model on your custom dataset
      model.train(data='path/to/your/dataset.yaml')

      And to make predictions:

      # Load your trained model
      model = YOLO('path/to/your/best.pt')
      
      # Predict on new images
      results = model.predict('path/to/your/images')

      Remember to replace 'path/to/your/...' with the actual paths to your files. If you need more detailed guidance, our documentation is a great place to start. 😊