Key takeaways
- YOLO (You Only Look Once) detects and locates objects in an image in a single pass, which makes it fast enough for real-time video.
- Modern Ultralytics YOLO models also do classification, segmentation, pose estimation and tracking.
- Ultralytics models are AGPL-3.0 licensed; closed-source commercial products need an enterprise licence or a differently licensed model.
- Choose MediaPipe for ready-made on-device face, hand and pose solutions; choose YOLO to train detectors on your own classes.
- A first custom YOLO model takes an afternoon in Colab: label data, train a small model, evaluate on held-out images.
YOLO, short for You Only Look Once, is a family of deep learning models for real-time object detection: given an image, it predicts boxes around objects and labels them, such as person, car or helmet, in a single pass of the network. That speed made it the default choice for video, robotics and edge devices. This page explains why YOLO is used, how the versions differ, whether it can classify, segment and work on video, the commercial licensing question, how it relates to vision-language models, how it compares with MediaPipe, and how to train one in Colab.
What is YOLO in machine learning?
YOLO is an object detection model that divides an image into a grid and predicts, in one forward pass, bounding boxes, confidence scores and class labels for objects. It was introduced by Joseph Redmon and colleagues in 2016.
Earlier detectors first proposed many candidate regions and then classified each one, which was slow. YOLO framed detection as a single regression problem from image pixels to boxes and classes, trading a little accuracy for a large gain in speed. Later versions improved accuracy with better backbones, multi-scale features, anchor-free heads and training tricks, while keeping real-time performance. The output is a list of boxes with class and confidence, usually cleaned up with non-maximum suppression to remove duplicates.
Why is YOLO used?
YOLO is used because it is fast, accurate enough for most practical tasks, easy to train on custom data and easy to deploy, from GPUs to phones and edge devices.
Also asked as: can yolo be used for commercial use
Typical uses:
- Traffic and vehicle counting from CCTV.
- Safety compliance, such as helmet and vest detection on construction sites.
- Retail shelf monitoring and product counting.
- Crop, pest and fruit detection in agriculture.
- Robotics and drones that must see in real time.
Its ecosystem matters too: tools such as Ultralytics provide training, evaluation and export in a few lines of code, and models export to formats such as ONNX and TensorRT. In FaceVision I ran vision models in the browser with ONNX Runtime Web, and the same export path lets YOLO run client-side.
What is the difference between YOLO versions?
Versions differ in architecture, accuracy, speed and tooling, and they come from different authors. The original author released v1 to v3; later versions came from other researchers and from Ultralytics, which maintains the most widely used library.
A rough map:
- v1 to v3 (2016 to 2018): the original design, adding anchors and multi-scale prediction.
- v4 (2020): many training and architecture improvements.
- v5 and v8: Ultralytics' popular, easy-to-use releases; v8 added an anchor-free head and multiple tasks.
- v6, v7, v9, v10: research and industry releases with their own trade-offs.
- YOLO11 and later: newer Ultralytics models with better accuracy per computation.
For a new project, start with the latest stable Ultralytics model and compare two sizes on your own data.
Can YOLO be used for image classification?
Yes. Ultralytics YOLO models include classification variants that predict a single label for a whole image, alongside detection, segmentation and pose models. Use classification when you only need "what is in this image", not where.
For example, classifying leaf images as healthy or diseased is a classification task; finding every diseased leaf in a field photo is detection. Classification models are smaller and faster, and need simpler labels: just a folder per class. If you might later need locations or counts, label boxes from the start, because converting a classification dataset into a detection dataset means relabelling everything. For pure classification, other architectures, such as EfficientNet or vision transformers, are also strong options.
Can YOLO be used for segmentation?
Yes. YOLO segmentation models predict a pixel mask for each detected object as well as its box, which is instance segmentation. Ultralytics provides segmentation versions of its models.
Segmentation helps when the shape matters: measuring the area of a crack, counting overlapping fruits, separating people from background, or cutting out products. It needs polygon or mask labels, which take longer to create than boxes, though annotation tools with AI assistance speed this up. Segmentation models are a bit slower than detection models of the same size. If boxes are enough for your decision, use detection; add segmentation only when you need precise outlines.
Can YOLO detect objects in video?
Yes. YOLO processes each video frame as an image, fast enough for real-time video on a GPU and often on edge devices with smaller models. Tracking links detections across frames so each object keeps an ID.
Also asked as: can yolo detect objects from video
With Ultralytics, running on a video is one line, and tracking is another:
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
model.predict(source="traffic.mp4", save=True) # boxes on every frame
model.track(source="traffic.mp4", save=True) # adds persistent IDs
For counting objects crossing a line, use tracking IDs rather than raw detections, or you will count the same car many times. Lower resolution and smaller models increase frame rate.
Can YOLO be used commercially?
It depends on the model's licence. Ultralytics YOLO models are released under AGPL-3.0, which requires releasing your source code if you distribute or offer the software as a service; closed-source commercial use needs an Ultralytics enterprise licence.
Other YOLO implementations have different licences, some more permissive, so check the licence of the exact repository and weights you use, including any pretrained weights and datasets. For college projects, research and open-source work, AGPL is usually fine. For a startup product or client work, decide on licensing before you build, because switching models late means retraining and re-validating. When unsure, ask the licensor or a lawyer; this page is not legal advice.
Can YOLO be used with vision-language models?
YOLO itself is not a vision-language model; it predicts boxes for a fixed set of classes. But open-vocabulary detectors such as YOLO-World accept text prompts for classes, and YOLO is often combined with vision-language models in pipelines.
Also asked as: can yolo used for visual language models
Two common patterns: use YOLO to find and crop objects quickly, then ask a vision-language model to describe or reason about each crop; or use a vision-language model to label images automatically, then train a fast YOLO model on those labels for real-time deployment. Open-vocabulary models let you detect "red helmet" or "fire extinguisher" without training a new model, at some cost in speed and accuracy compared with a custom-trained detector.
MediaPipe vs YOLOv8: which should I use?
Use MediaPipe for ready-made, highly optimised on-device solutions such as face detection, face mesh, hand tracking and pose estimation. Use YOLOv8 or newer when you need to detect your own custom objects or want to train and tune the model yourself.
MediaPipe, from Google, provides pipelines that run in real time on phones and in browsers with little setup, and it offers some customisation through model training tools. YOLO gives you more control: custom classes, model sizes, training options and export targets. For a fitness app that counts squats, MediaPipe's pose solution is the quick path. For detecting helmets on a site or pests on leaves, train a YOLO model. Some projects use both.
How do I train YOLOv8 in Google Colab?
Open a Colab notebook with a GPU, install Ultralytics, upload a labelled dataset in YOLO format with a data.yaml file, train a small model, then evaluate and export it.
Also asked as: yolov8 tutorial colab
!pip install ultralytics
from ultralytics import YOLO
model = YOLO("yolov8n.pt") # small pretrained model
model.train(data="data.yaml", epochs=50, imgsz=640)
metrics = model.val() # mAP on the validation set
model.export(format="onnx") # for deployment
Label a few hundred images per class with an annotation tool, keep a separate test set, and check predictions visually, not only the mAP number. Save weights to Google Drive, because Colab sessions reset.
Sources
- Redmon et al., You Only Look Once: Unified, Real-Time Object Detection (2016)arxiv.org
- Ultralytics, YOLO documentationdocs.ultralytics.com
- Ultralytics, licenseultralytics.com
- Cheng et al., YOLO-World: Real-Time Open-Vocabulary Object Detection (2024)arxiv.org
- Google AI Edge, MediaPipe Solutions guideai.google.dev




