How do I speed up YOLO inference and get more FPS?
To speed up YOLO, export the model to ONNX or TensorRT, use a smaller variant (n or s), lower the image size, and enable half precision (FP16) or INT8 on supported hardware. Each of these trades a little accuracy for a large jump in FPS, so measure both.
Speed comes from several independent levers. Pull the cheap ones first, then the ones that cost accuracy.
1. Export to an optimised runtime
Running the raw PyTorch model is the slow path. Exporting gives a large, near-free speedup:
- TensorRT (NVIDIA GPUs) is usually the fastest.
- ONNX Runtime is a strong, portable default.
- OpenVINO for Intel CPUs, CoreML for Apple devices.
from ultralytics import YOLO
model = YOLO("yolo11n.pt")
model.export(format="engine", half=True) # TensorRT FP16
# or: model.export(format="onnx")2. Use a smaller model
yolo11n and yolo11s are dramatically faster than l or x. If n hits your accuracy target, ship n.
3. Lower the image size
Inference cost scales with imgsz squared. Dropping from 1280 to 640 is roughly a 4x speedup, at the cost of small-object accuracy. Find the smallest size that still detects what you need.
4. Half or INT8 precision
FP16 (half=True) is nearly free accuracy-wise and much faster on modern GPUs. INT8 is faster still but needs a calibration set and can cost more accuracy, verify it.
5. Batch and use the GPU
If you process many streams or images, batch them. Make sure you are actually on the GPU (device=0), and decode video efficiently so the camera or disk is not the bottleneck.
Always measure
Time end-to-end FPS on your real hardware and footage, not just the model forward pass. Pre- and post-processing and video decoding are often the hidden cost.
Related questions
Hands-on tutorials
Stuck on this in a real project?
Book a free call and I’ll give you a straight answer on your specific case.
Book a consultation