Ultralytics Explorer
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.
Ultralytics Explorer là công cụ khám phá bộ dữ liệu CV bằng tìm kiếm ngữ nghĩa, truy vấn SQL, tìm kiếm tương đồng vector và prompt ngôn ngữ tự nhiên. Công cụ này cũng cung cấp Python API để truy cập các chức năng tương tự.
Xem: Ultralytics Explorer API | Tìm kiếm ngữ nghĩa, truy vấn SQL và tính năng Ask AI
Cài đặt các dependency tùy chọn#
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"Explorer hỗ trợ tìm kiếm embedding/ngữ nghĩa và truy vấn SQL, dựa trên LanceDB, một cơ sở dữ liệu vector serverless. Khác với DB truyền thống lưu trong bộ nhớ, dữ liệu được lưu trên ổ đĩa mà không ảnh hưởng đến hiệu năng, nhờ đó bạn có thể mở rộng quy mô cục bộ với các bộ dữ liệu lớn như COCO mà không hết bộ nhớ.
Explorer API#
Đây là Python API để khám phá các bộ dữ liệu của bạn. API này cũng là nền tảng cho GUI Explorer. Bạn có thể dùng API này để tạo notebook hoặc script khám phá của riêng mình nhằm thu thập thông tin chuyên sâu về bộ dữ liệu.
Khám phá đầy đủ các tính năng và ví dụ sử dụng trong tài liệu Explorer API.
Cách sử dụng GUI Explorer#
Bản demo GUI chạy trong trình duyệt, cho phép bạn tạo embedding cho bộ dữ liệu, tìm kiếm hình ảnh tương tự, chạy truy vấn SQL và thực hiện tìm kiếm ngữ nghĩa. Có thể chạy bằng lệnh sau:
yolo explorerTính năng Ask AI sử dụng OpenAI, vì vậy khi chạy GUI lần đầu, bạn sẽ được nhắc thiết lập API key cho OpenAI. Bạn có thể thiết lập như sau - yolo settings openai_api_key="..."
Câu hỏi thường gặp#
Ultralytics Explorer là công cụ khám phá bộ dữ liệu thị giác máy tính (CV) thông qua tìm kiếm ngữ nghĩa, truy vấn SQL, tìm kiếm tương đồng vector và ngôn ngữ tự nhiên. Công cụ cung cấp cả GUI lẫn Python API. Vì lưu embedding trên ổ đĩa bằng LanceDB, công cụ có thể mở rộng để xử lý các bộ dữ liệu lớn mà không tiêu tốn quá nhiều bộ nhớ.
Tìm hiểu thêm về Explorer API.
Để cài đặt thủ công các dependency tùy chọn cần thiết cho Ultralytics Explorer, bạn có thể dùng lệnh
pipsau:pip install "ultralytics[explorer]==8.3.11"Các dependency này cần thiết cho tìm kiếm ngữ nghĩa và truy vấn SQL. Trong đó có LanceDB, giúp các thao tác cơ sở dữ liệu luôn hiệu quả và có khả năng mở rộng, ngay cả với các bộ dữ liệu lớn như COCO.
Cách sử dụng phiên bản GUI của Ultralytics Explorer rất đơn giản. Sau khi cài đặt các dependency cần thiết, bạn có thể khởi chạy GUI bằng lệnh sau:
yolo explorerGUI cung cấp giao diện thân thiện với người dùng để tạo embedding cho bộ dữ liệu, tìm kiếm ảnh tương tự, chạy truy vấn SQL và thực hiện tìm kiếm ngữ nghĩa. Tính năng Ask AI, được hỗ trợ bởi OpenAI, cũng cho phép bạn truy vấn bộ dữ liệu bằng ngôn ngữ tự nhiên.
Để biết thông tin về lưu trữ và khả năng mở rộng, hãy xem hướng dẫn cài đặt của chúng tôi.
Tính năng Ask AI trong Ultralytics Explorer cho phép người dùng tương tác với bộ dữ liệu bằng truy vấn ngôn ngữ tự nhiên. Được hỗ trợ bởi OpenAI, tính năng này cho phép bạn đặt câu hỏi về bộ dữ liệu mà không cần viết truy vấn SQL hay các lệnh tương tự. Để sử dụng tính năng này, bạn cần thiết lập khóa API OpenAI trong lần đầu chạy GUI:
yolo settings openai_api_key="YOUR_API_KEY"Để tìm hiểu thêm về tính năng này và cách tích hợp, hãy xem phần Cách sử dụng GUI Explorer.
Có. Cài đặt bản phát hành đã ghim bằng
pip install ultralytics==8.3.11trong notebook Colab và làm theo Ví dụ khám phá VOC để tạo embedding và chạy tìm kiếm trên tài nguyên đám mây của Google. Tìm hiểu thêm trong Hướng dẫn Google Colab của chúng tôi.
Bình luận13
Đặt câu hỏi, chia sẻ kết quả hoặc giúp đỡ người khác.
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(đã chỉnh sửa)@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(đã chỉnh sửa)@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(đã chỉnh sửa)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(đã chỉnh sửa)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(đã chỉnh sửa)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