Fix usage in yoloe.md FAQ section (#20307)

Co-authored-by: Laughing-q <1185102784@qq.com>
This commit is contained in:
Muhammad Rizwan Munawar 2025-04-23 21:09:35 +05:00 committed by GitHub
parent f8de027be6
commit 7765d0ec83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -768,21 +768,16 @@ Quickly set up YOLOE with Ultralytics by following these steps:
- **Quick inference** (prompt-free):
```bash
yolo predict model=yoloe-s.pt source="image.jpg"
yolo predict model=yoloe-11s-seg-pf.pt source="image.jpg"
```
- **Prompted detection** (text prompt example):
```bash
yolo predict model=yoloe-s.pt source="kitchen.jpg" classes="bowl,apple"
```
In Python:
```python
from ultralytics import YOLO
model = YOLO("yoloe-s.pt")
model.set_classes(["bowl", "apple"])
model = YOLO("yoloe-11s-seg.pt")
names = ["bowl", "apple"]
model.set_classes(names, model.get_text_pe(names))
results = model.predict("kitchen.jpg")
results[0].save()
```
@ -853,10 +848,11 @@ Similar to [YOLO-World](yolo-world.md), YOLOE supports a "prompt-then-detect" st
from ultralytics import YOLO
# Initialize a YOLOE model
model = YOLO("yoloe-s.pt")
model = YOLO("yoloe-11s-seg.pt")
# Define custom classes
model.set_classes(["person", "bus"])
names = ["person", "bus"]
model.set_classes(names, model.get_text_pe(names))
# Execute prediction on an image
results = model.predict("path/to/image.jpg")