๐
โก
model.predict()
Real-Time Edge Vision with Ultralytics ๐โก
Onuralp SEZER
Senior ML Engineer @ Ultralytics
Python Pizza Istanbul ๐ 14 November 2026
whoami ๐
Hi, Iโm Onuralp!
Senior ML & Computer Vision Engineer at Ultralytics
๐ I maintain the ultralytics Python package
๐ฆ and ultralytics/inference (Rust) and TrackForge
๐ Co-maintainer of SAHI
๐ง Fedora KDE SIG and Mindshare member

All my links ๐
@onuralpszr
pip install ultralytics ๐ฆ
One package for everything. ๐
from ultralytics import YOLO model = YOLO("yolo26n.pt")results = model.predict("pizza.jpg") # that's it, boxes on your pizza ๐
Same API for every task
๐ฆ Detection๐ญ Instance Segmentation
๐บ๏ธ Semantic Segmentation๐ Depth Estimation
๐ท๏ธ Classification๐บ Pose Estimation๐ OBB
Today we use YOLO26n, the smallest one. It is made for small devices. ๐ฑ
todayโs model ๐
I had zero pizza photos. ๐
๐
๐จ
Generate
2,376 pizza scenes made with ComfyUI
๐ท๏ธ
Auto-label
a detector draws the first boxes for me
๐ ๏ธ
Fix
clean up mistakes on Ultralytics Platform
๐๏ธ
Train
YOLO26n, pizza and pizza_slice, about 20 min
before โ after ๐
What does predict() see?
Real boxes from my pizza model, on images it never trained on. Drag the slider! ๐
๐ 0 pizza๐บ 0 slicesโฑ๏ธ 0 ms
conf0.40
โ reveal / next image B before A after
beforeafter โจ
fun fact ๐งช
I trained 6 different setups.
They all scored 0.856 to 0.863 mAP.
Longer training, a bigger model, AdamW, more augmentation. Almost no change! Better data helps way more than fancy settings. ๐
the problem ๐ข
A .pt file is great for training.
Not so great on a tiny device.
๐
Heavy runtime
Full PyTorch plus Python. A big install for a small box.
๐งฎ
32-bit math
Most chips are much faster with 16-bit or 8-bit numbers.
๐ง
Generic kernels
Nothing is tuned for your exact chip yet.
model.pt
โ
model.export()
โ
ONNX ๐
runs anywhere, CPU
TensorRT โก
NVIDIA GPU, Jetson
CoreML / TFLite ๐ฑ
iPhone and Android
OpenVINO ๐ป
Intel CPU and NPU
the fix โจ
Export is one line.
from ultralytics import YOLOmodel = YOLO("pizza-yolo26n.pt") model.export(format="onnx") # any CPU ๐model.export(format="engine", half=True) # NVIDIA FP16 โกmodel.export(format="engine", int8=True, data="pizza.yaml") # INT8 ๐ขmodel.export(format="coreml") # iPhone ๐model.export(format="tflite") # Android ๐ค YOLO("pizza-yolo26n.engine").predict("pizza.jpg") # same API ๐
smaller = faster ๐๏ธ
Three knobs you can turn.
๐ Model size
Start with nano. Go bigger only if you need it.
26s 1.4 ms, mAP 0.849
26n 1.0 ms, mAP 0.858
๐ผ๏ธ Image size
Fewer pixels, less work. Fine when objects are big.
640px 1.0 ms, mAP 0.858
320px 0.5 ms, mAP 0.807
๐ข Precision
FP32, FP16, INT8. INT8 needs a few calibration images.
FP16 1.0 ms, mAP 0.858
INT8 1.8 ms, mAP 0.846
๐คฏ
Plot twist: INT8 was slower than FP16 here!
1.8 ms vs 1.0 ms. Smaller numbers are not always faster. Always test on your own device.
TensorRT on my laptop (NVIDIA RTX Spark N1X), batch 1, 238 validation images, mAP = mAP50-95
real numbers โฑ๏ธ
Same pizza model, 7 ways to run it. ๐
format
time per image (log scale)
ms
FPS
mAP
PyTorch FP32 (CPU)
298.3 ms
3
0.859
ONNX FP32 (CPU)
18.8 ms
53
0.856
PyTorch FP32 (GPU)
2.9 ms
340
0.859
TensorRT FP16
1.0 ms
1010
0.858
TensorRT INT8
1.8 ms
568
0.846
TensorRT FP16 @320
0.5 ms
1852
0.807
YOLO26s TensorRT FP16
1.4 ms
699
0.849
YOLO26n at 640px unless noted, batch 1, model time only, on my laptop
before โ after ๐
Pizza race! Same model, 10 seconds. ๐
๐ข PyTorch CPUbefore: plain .pt
0pizzas
๐ฅ PyTorch GPUbefore: plain .pt
0pizzas
โก TensorRT FP16after: model.export()
0pizzas
Counters run at the real measured speed: 298 ms, 2.9 ms and 1.0 ms per image. Press R to restart the race.
result ๐
3.0ร faster
than PyTorch on the same GPU.
301ร faster than PyTorch on CPU.
Same accuracy: mAP 0.858 vs 0.859. That is 1010 pizzas per second! ๐๐๐
live ๐ด
Demo time! ๐
python demo.py --model models/pizza-yolo26n.pt
python demo.py --model models/pizza-yolo26n-fp16.engine
npm install @ultralytics/yolo ๐
In the browser! ๐
Grazie! Teลekkรผrler! ๐
1๏ธโฃ Start small
2๏ธโฃ Export for your device
3๏ธโฃ Always measure

๐๏ธ Models
all training runs

๐ Dataset
2,376 pizza images

๐ Me
@onuralpszr