YOLOE Found a Double-Decker Bus That Wasn't There: Text-Prompt Detection, Tested
Open-vocabulary detection with YOLOE-26 on a plain CPU: what text prompts get right, where they confidently lie, and how to ship them without the 254 MB encoder.

The pitch for open-vocabulary detection is irresistible: skip the labeling, skip the training run, just type what you want to find. “Person.” “Bus.” “Spool of filament.” The model draws boxes around it.
YOLOE is the most practical version of that idea right now, because it lives inside the normal Ultralytics package and runs at YOLO speeds. Ultralytics ships it in the YOLO26 generation as YOLOE-26. I spent a session poking at it on a two-core cloud machine with no GPU, and the short version is that it works, it’s fast, and it will answer the question you asked even when the honest answer is “there isn’t one.”
This guide covers the setup, a set of prompt experiments with real numbers, how to ship your prompts without dragging a 254 MB text encoder along, and the export trap that bakes your classes in for good.
Tested with: Python 3.13.18, ultralytics 8.4.210, torch 2.15.0 (CPU only), onnxruntime 1.31.1, on Linux x86_64 with 2 vCPUs (Intel Xeon @ 2.30GHz), 11 November 2026.
What YOLOE actually is
YOLOE comes from the paper YOLOE: Real-Time Seeing Anything. It’s a YOLO detector and segmenter whose class head is matched against embeddings instead of a fixed list of labels. You can feed it those embeddings three ways, per the Ultralytics YOLOE docs:
- Text prompts. You call
set_classes(["bus", "person"]). A MobileCLIP text encoder turns each phrase into an embedding. - Visual prompts. You draw example boxes on an image and it finds more things like them.
- Prompt-free. The
-pfcheckpoints carry a built-in vocabulary of 4,585 names and label everything they recognize.
The YOLOE-26 checkpoints come in n, s, m, l and x sizes, all as -seg models, so you get masks as well as boxes. This guide sticks to text prompts and prompt-free, because those are the ones you can use without drawing anything.
Setup
A fresh virtual environment and one install:
python3 -m venv .venv && . .venv/bin/activate
pip install ultralytics
That pulls in PyTorch too, so expect a big download. Then the example from the docs, pointed at the sample photo that ships inside the package (a blue electric minibus on a Madrid street, with a few pedestrians):
from ultralytics import YOLOE
model = YOLOE("yoloe-26s-seg.pt")
model.set_classes(["double-decker bus", "person"])
results = model.predict("bus.jpg")
for b in results[0].boxes:
print(results[0].names[int(b.cls)], round(float(b.conf), 2))
On first run it downloads the 29.6 MB yoloe-26s-seg.pt from GitHub. The first set_classes() call then downloads mobileclip2_b.ts, the text encoder, into your current directory. On my machine that file was 253,794,476 bytes, so the text encoder is about eight times the size of the detector. Hold that thought.
The output:
image 1/1 /root/yoloe/bus.jpg: 640x480 1 double-decker bus, 4 persons, 218.8ms
person 0.89
person 0.88
person 0.87
person 0.59
double-decker bus 0.29
Four people, correct. One double-decker bus, which is a problem, because the bus in that photo has exactly one deck.
The bus that grew a second deck
Here’s the thing about open-vocabulary detection: each class you give it is a question, and there’s no “none of the above” option. Ask only for a double-decker bus while a single-decker bus sits in frame, and the closest thing on your list gets the label, just at lower confidence. The default confidence threshold is 0.25, so 0.29 squeaks through.
So I ran the same photo with a handful of prompt lists and printed what came back:
from ultralytics import YOLOE
model = YOLOE("yoloe-26s-seg.pt")
prompt_sets = [["bus"], ["double-decker bus"], ["bus", "double-decker bus"],
["single-decker bus", "double-decker bus"], ["electric bus"],
["giraffe"], ["stop sign"], ["stop sign", "traffic sign"],
["glasses"], ["sunglasses"], ["bollard"]]
for classes in prompt_sets:
model.set_classes(classes)
r = model.predict("bus.jpg", verbose=False)[0]
print(classes, "->", [(r.names[int(b.cls)], round(float(b.conf), 2)) for b in r.boxes])
['bus'] -> [('bus', 0.9)]
['double-decker bus'] -> [('double-decker bus', 0.29)]
['bus', 'double-decker bus'] -> [('bus', 0.9)]
['single-decker bus', 'double-decker bus'] -> [('single-decker bus', 0.6)]
['electric bus'] -> [('electric bus', 0.9)]
['giraffe'] -> []
['stop sign'] -> [('stop sign', 0.69)]
['stop sign', 'traffic sign'] -> [('stop sign', 0.69), ('traffic sign', 0.37), ('traffic sign', 0.33)]
['glasses'] -> [('glasses', 0.65), ('glasses', 0.35)]
['sunglasses'] -> []
['bollard'] -> []
What the numbers say:
- Give it an exit. Asking for “bus” and “double-decker bus” together, the right label won at 0.90 and the wrong one vanished. Adding a plausible alternative is the cheapest fix there is.
- Absent things mostly stay absent. “Giraffe” returned nothing, even when I dropped the threshold to
conf=0.05. - Look-alikes don’t. “Stop sign” hit 0.69 on a small round blue street sign at the left edge of the frame. It isn’t a stop sign. Adding “traffic sign” to the list didn’t fix it either: the stop-sign box stayed at 0.69 and two other signs got picked up as traffic signs. The exit trick isn’t guaranteed.
- Wording matters more than you’d think. “Glasses” found both pairs of sunglasses. “Sunglasses” found nothing. Bollards, which are plainly visible in the photo, didn’t register at all.
A confidence of 0.69 on a wrong answer is the part to remember. You can’t threshold your way out of a confusable class.
Speed on a plain CPU
I timed the nano and small checkpoints with three classes, averaging ten runs after a warm-up:
import time
from ultralytics import YOLOE
names = ["person", "bus", "traffic sign"]
for w in ("yoloe-26n-seg.pt", "yoloe-26s-seg.pt"):
m = YOLOE(w)
t = time.perf_counter(); m.set_classes(names); t_set = time.perf_counter() - t
m.predict("bus.jpg", verbose=False) # warm-up
t = time.perf_counter()
for _ in range(10): r = m.predict("bus.jpg", verbose=False)[0]
print(f"{w}: set_classes {t_set:.2f}s, predict {(time.perf_counter()-t)/10*1000:.0f} ms/img,",
[(r.names[int(b.cls)], round(float(b.conf), 2)) for b in r.boxes])
m.save_prompt_embeddings("street.npz")
yoloe-26n-seg.pt: set_classes 1.30s, predict 85 ms/img, [('person', 0.91), ('person', 0.9), ('person', 0.86), ('bus', 0.82), ('person', 0.62)]
yoloe-26s-seg.pt: set_classes 0.36s, predict 215 ms/img, [('bus', 0.9), ('person', 0.89), ('person', 0.88), ('person', 0.87), ('person', 0.59), ('traffic sign', 0.37), ('traffic sign', 0.33)]
I ran this twice. Nano came in at 85 to 90 ms per image and small at 215 to 269 ms, on two shared CPU cores with no GPU, so treat those as ballparks, not benchmarks. Nano found the bus and the people but missed the signs entirely. The first set_classes() took about 1.3 s because it loads the text encoder; the second, with the encoder already loaded, took under 0.4 s. That’s fine once at startup and silly to do per frame.
Ship the prompts, not the encoder
That last line of the script, save_prompt_embeddings, is the most useful thing in this guide. Your class list turns into a tiny file of vectors, and a fresh process can load it without ever touching MobileCLIP. On my machine street.npz was 6,436 bytes.
To prove the encoder really wasn’t needed, I moved mobileclip2_b.ts out of the directory first, then ran:
from ultralytics import YOLOE
m = YOLOE("yoloe-26s-seg.pt")
m.load_prompt_embeddings("street.npz")
r = m.predict("bus.jpg", verbose=False)[0]
print(r.names, [(r.names[int(b.cls)], round(float(b.conf), 2)) for b in r.boxes])
{0: 'person', 1: 'bus', 2: 'traffic sign'} [('bus', 0.9), ('person', 0.89), ('person', 0.88), ('person', 0.87), ('person', 0.59), ('traffic sign', 0.37), ('traffic sign', 0.33)]
Same detections, same confidences, no 254 MB download. For a small edge box, or a container you’d like to keep slim, this is the move: tune your prompts on a workstation, save the .npz, deploy that.
Exporting bakes the classes in
ONNX export works from the loaded embeddings:
from ultralytics import YOLOE
m = YOLOE("yoloe-26s-seg.pt")
m.load_prompt_embeddings("street.npz")
print("exported:", m.export(format="onnx"))
ONNX: export success ✅ 1.5s, saved as 'yoloe-26s-seg.onnx' (39.8 MB)
exported: yoloe-26s-seg.onnx
The docs say prompted classes “are baked into the exported weights.” Here’s what that looks like from the other side:
from ultralytics import YOLO
m = YOLO("yoloe-26s-seg.onnx", task="segment")
r = m.predict("bus.jpg", verbose=False)[0]
print(r.names, [(r.names[int(b.cls)], round(float(b.conf), 2)) for b in r.boxes])
try:
m.set_classes(["giraffe"])
except Exception as e:
print(type(e).__name__, e)
{0: 'person', 1: 'bus', 2: 'traffic sign'} [('person', 0.91), ('bus', 0.9), ('person', 0.88), ('person', 0.87), ('person', 0.75), ('traffic sign', 0.37)]
AttributeError 'str' object has no attribute 'set_classes'
Two things to notice. First, the error doesn’t say “classes are fixed in exports.” It says something about a string, which is not a helpful message at 11 p.m. If you see it, the fix is to go back to the .pt and export again. Second, the ONNX run isn’t identical to the PyTorch one: one person came back at 0.75 instead of 0.59, and one of the two traffic signs dropped out. Small, but if you tuned a threshold on the .pt, check it again on the export. I didn’t benchmark the ONNX file separately; the point here is behavior, not speed.
Prompt-free: a free label audit
The -pf checkpoint doesn’t take prompts at all. It labels everything it knows:
from collections import Counter
from ultralytics import YOLOE
m = YOLOE("yoloe-26s-seg-pf.pt")
print("vocabulary size:", len(m.names))
r = m.predict("bus.jpg", verbose=False)[0]
print(Counter(r.names[int(b.cls)] for b in r.boxes).most_common())
try:
m.set_classes(["bus"])
except Exception as e:
print(type(e).__name__, e)
vocabulary size: 4585
[('person', 4), ('glasses', 2), ('traffic sign', 2), ('bus', 1), ('boardwalk', 1), ('stop sign', 1), ('helmet', 1), ('clip art', 1)]
AssertionError Prompt-free model does not support setting classes. Please try with Text/Visual prompt models.
Same stop-sign mistake, same 0.69, so that confusion lives in the model and not in my wording. It also called the paved sidewalk a “boardwalk” and the leaf logo painted on the bus “clip art,” which is honestly fair. The prompt-free model makes a good scouting tool: run it over a few of your own images, see which words the model already associates with your objects, then use those words as text prompts.
One surprise, though. The docs say prompt-free checkpoints don’t need a text encoder, and for loading and predicting that held up: no encoder file appeared. But the set_classes() call that gets rejected downloads one first. I checked after each line: after the failed call, a 599,764,649-byte mobileclip_blt.ts (the older encoder used by YOLOE-11) was sitting in my directory. So the error message costs you 600 MB. Don’t call set_classes() on a -pf model, not even to see what happens. I did, so you don’t have to.
What went wrong when I tested it
- “AutoUpdate skipped (offline)”, then
ModuleNotFoundError: No module named 'clip'. Text prompts need Ultralytics’ fork of CLIP, which it normally installs on the fly. My test machine only reaches PyPI and GitHub, so Ultralytics decided it was offline and skipped the install. Fix:pip install "git+https://github.com/ultralytics/CLIP.git". On a normal connection you probably won’t see this, but on a locked-down box you will. - The docs’ sample image URL failed with “Download failure… Environment may be offline,” for the same reason. The image ships inside the package at
ultralytics/assets/bus.jpg, so I copied it from there. - ONNX export failed with
No module named 'onnx'. Same auto-install skip.pip install onnx onnxslim onnxruntimefixed it. - A mystery 600 MB file. Re-running every block in a clean folder, a
mobileclip_blt.tsshowed up that I never asked for. Running the prompt-free script line by line traced it to the rejectedset_classes()call, as described above. - Timings moved between runs. The small model measured 269 ms per image the first time and 215 ms the second, on the same machine. Shared cloud CPUs do that. Measure on your own hardware before promising anyone a frame rate.
When to use this, and when not to
Reach for YOLOE text prompts when:
- You need a working detector today for objects in common vocabulary, and “good enough with a human glancing at it” is the bar.
- You’re prototyping. Prompting first tells you whether the problem is even visible to a model before you spend a weekend labeling.
- The list of things you look for changes often. Re-saving a 6 KB embeddings file beats retraining.
Don’t rely on it when:
- Your classes are look-alikes: stop sign versus round sign, M3 bolt versus M4 bolt, a good print versus one with a slight layer shift. That 0.69 stop sign is your warning.
- You only ever ask about one class. Always include the plausible alternatives so the wrong answer has somewhere else to go.
- Accuracy has to be measured, not felt. At that point, label a few hundred images and fine-tune a regular detector, then use YOLOE’s guesses to speed up the labeling.
If your setup is already a box in the basement running models locally, as in the brain in the basement, the embeddings trick is what makes YOLOE fit beside everything else. And if you want a reminder of why “the model did something nobody asked it to” deserves a test, not a shrug, I hid the light switch from my AI is the cautionary tale.
Sources
- YOLOE: Real-Time Open-Vocabulary Detection and Segmentation, Ultralytics docs
- YOLOE: Real-Time Seeing Anything (Wang et al., arXiv 2503.07465)
- Ultralytics YOLO26 docs
- ultralytics on PyPI
- Ultralytics CLIP fork on GitHub
How this was made: researched and drafted with AI assistance, with every code sample run and tested before publishing, then reviewed by Colby.

