Open-vocabulary detection: any object described in plain text at inference time, no training or fine-tuning required.
yolov8s-world.pt) — the direct answer to Level 4's vocabulary gap.Detects any object described in plain text at inference time — no training or fine-tuning required, unlike COCO's fixed 80-class list.
model = YOLOWorld("yolov8s-world.pt")
model.set_classes(["forklift", "cardboard box", "pallet", "helmet", "person"])
results = model.predict(image_path, conf=0.08, iou=0.5)imgsz to 1280 (from the default 640) recovered detection of smaller/distant objects (a pallet jack handle) lost to downscaling, at the cost of needing to re-lower conf since scores shifted slightly.
Terminal output
image 1/1 warehouse1.jpg: 864x1280 2 helmets, 4 persons, 2 electrical cabinets, 1 pallet jack, 1251.3ms
Speed: 20.3ms preprocess, 1251.3ms inference, 1.5ms postprocess per image at shape (1, 3, 864, 1280)
warehouse1.jpg -> Total objects detected: 9
person: 4
helmet: 2
electrical cabinet: 2
pallet jack: 1
Saved annotated image as output1.jpg
Terminal output
image 1/1 warehouse3.jpg: 736x1280 (no detections), 1527.6ms
Speed: 23.0ms preprocess, 1527.6ms inference, 1.5ms postprocess per image at shape (1, 3, 736, 1280)
warehouse3.jpg -> Total objects detected: 0
No objects detected - try lowering conf further or rephrasing classes.
Saved annotated image as output3.jpg