How does YOLO work? The AI model explained, YOLOv8, people detection, and TensorFlow

What YOLO means in AI, whether it is deep learning, how YOLO and YOLOv8 work step by step, the best model for people, YOLO in TensorFlow, and loading models.

Walking a room through the products he has shipped
Walking a room through the products he has shipped

Key takeaways

  • YOLO, You Only Look Once, is a family of real-time object detection models that find and label objects in one pass.
  • It is a deep learning model: a convolutional backbone extracts features and a head predicts boxes and classes.
  • YOLOv8 is anchor-free with a decoupled head, trained with modern augmentation and loss functions.
  • For people detection, start with a small pretrained YOLO model and fine-tune on your camera's footage.
  • In TensorFlow, use KerasCV or KerasHub detectors, or export YOLO models to TensorFlow formats; save with model.save.

YOLO, short for "You Only Look Once", is a family of AI models for real-time object detection: in a single pass through a neural network, it finds every object in an image, draws a bounding box around each, and labels it, such as person, car or helmet. Its speed made it the standard for video and edge applications. I build browser-based vision in FaceVision, where detection comes before recognition, so this page explains YOLO, how it and YOLOv8 work, people detection, and using TensorFlow to build, train and load models.

Is YOLO an AI model?

Yes. YOLO is an AI model, specifically a family of deep learning models for object detection in computer vision. Given an image or video frame, it outputs bounding boxes, class labels and confidence scores for the objects it recognises.

Versions have evolved since the original 2015 paper by Joseph Redmon and colleagues, with many later releases from different teams, including Ultralytics' popular versions. Pretrained YOLO models detect 80 everyday object classes from the COCO dataset, and you can fine-tune them for custom objects such as defects, products or safety equipment. They run on GPUs, CPUs, phones and edge devices. That flexibility made YOLO a favourite for hackathon demos, traffic counting, retail analytics and safety monitoring.

What does YOLO mean in AI?

In AI, YOLO stands for "You Only Look Once", meaning the model looks at the whole image once and predicts all objects in a single forward pass, instead of running a classifier over many proposed regions. That single pass is why it is fast.

The name plays on the slang phrase "you only live once", but in computer vision it describes the detection approach. Earlier detectors, such as R-CNN, proposed regions first and classified each separately, which was slow. YOLO reframed detection as one regression problem from image pixels to boxes and class probabilities, enabling real-time video detection.

Is YOLO a deep learning model?

Yes. YOLO models are deep convolutional neural networks, with recent versions incorporating attention components, trained end to end on labelled images using backpropagation. They have a backbone that extracts features, a neck that combines features at multiple scales, and a head that predicts boxes and classes.

Training requires images with bounding box labels, typically thousands, though fine-tuning a pretrained model needs far fewer for new classes. Like other deep learning models, YOLO benefits from GPUs for training and data augmentation such as mosaic, flips and colour changes. For deployment, models are exported to formats like ONNX, TensorRT, TFLite or CoreML.

How does YOLO work?

YOLO divides the image into a grid of locations and, at each, predicts bounding boxes, a confidence that an object is present, and class probabilities. Predictions at multiple scales catch small and large objects, and non-maximum suppression removes duplicate boxes for the same object.

Also asked as: how yolo works

The backbone network processes the whole image once, producing feature maps rich in visual patterns. The detection head converts these features into box coordinates and class scores. During training, losses penalise wrong positions, wrong classes and missed objects. At inference, you set a confidence threshold to keep reliable detections, trading recall against false positives.

How does YOLO work step by step?

Step by step: resize and normalise the image, pass it through the backbone to extract features, combine features at different scales in the neck, predict boxes and class scores in the head, filter by confidence, then apply non-maximum suppression to keep the best box per object.

Also asked as: how yolo works step by step

In detail:

  • Preprocess: letterbox-resize to the model's input size, such as 640 by 640.
  • Backbone: convolutional layers detect edges, textures, then object parts.
  • Neck: feature pyramid layers merge fine and coarse features.
  • Head: predicts box coordinates, objectness and classes per location.
  • Post-process: confidence threshold, then non-maximum suppression.
  • Output: boxes, labels and scores mapped back to the original image.

How does YOLO v8 work?

YOLOv8, released by Ultralytics in 2023, uses a CSP-style convolutional backbone, a feature pyramid neck, and an anchor-free, decoupled head that predicts box centres and classes separately, improving accuracy and simplifying training.

Also asked as: how yolo v8 works

Anchor-free detection removes the need for predefined anchor box shapes, adapting better to varied objects. Training uses modern techniques such as mosaic augmentation, task-aligned label assignment and distribution focal loss. YOLOv8 also supports segmentation, pose estimation and classification with the same framework. Newer Ultralytics versions follow similar principles with further efficiency improvements.

What is the best YOLO model for human detection?

For people detection, start with a small pretrained YOLO model, such as a nano or small variant from a recent Ultralytics release, since "person" is one of the COCO classes. Choose larger variants if accuracy matters more than speed.

Then evaluate on footage from your actual cameras, because angle, lighting, crowd density and resolution strongly affect results. Fine-tune with a few hundred labelled frames from your environment to improve accuracy significantly. For tracking people across frames, add a tracker such as ByteTrack. Handle privacy carefully: detecting people raises consent and data protection obligations, so minimise storage and blur faces where possible.

How do I implement a YOLO model using TensorFlow?

Use KerasCV or its successor KerasHub, which provide YOLOv8-style detectors in Keras with TensorFlow, or export an Ultralytics YOLO model to TensorFlow SavedModel or TFLite for inference in TensorFlow environments.

Also asked as: how to implement a yolo model using tensorflow

With Keras, load a pretrained backbone, build the detector, prepare your dataset with bounding boxes in the expected format, compile with the appropriate losses, and train with model.fit. For mobile deployment, convert to TFLite. Exporting from Ultralytics is often simpler: train in PyTorch, then run model.export(format="tflite") or format="saved_model", and verify outputs match before deploying.

How do I train a TensorFlow model?

Prepare data with tf.data, define a model with Keras layers or a pretrained backbone, compile it with an optimiser, loss and metrics, then call model.fit with training and validation data, monitoring results with callbacks such as early stopping.

Also asked as: how to train a tensorflow model

import tensorflow as tf
model = tf.keras.Sequential([tf.keras.layers.Flatten(input_shape=(28, 28)),
                             tf.keras.layers.Dense(128, activation="relu"),
                             tf.keras.layers.Dense(10)])
model.compile(optimizer="adam", loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True), metrics=["accuracy"])
model.fit(x_train, y_train, epochs=5, validation_split=0.1)

For vision tasks, start from a pretrained model and fine-tune; it needs far less data. Use callbacks such as EarlyStopping and ModelCheckpoint to stop when validation loss stops improving and keep the best weights, and use a GPU, locally or on Colab, for anything beyond small datasets.

How do I load a model in TensorFlow?

Save a Keras model with model.save("model.keras") and load it with tf.keras.models.load_model("model.keras"). For deployment, export a SavedModel and load it with tf.saved_model.load, or convert to TFLite for mobile.

Also asked as: how to load model in tensorflow

Common issues: custom layers or losses need to be registered or passed through custom_objects when loading; version mismatches between TensorFlow releases can break loading, so record versions; and saving only weights requires rebuilding the same architecture before calling load_weights. Test the loaded model on a few inputs to confirm predictions match the original.

Sources

  1. Redmon et al., You Only Look Once: Unified, Real-Time Object Detection (2015)arxiv.org
  2. Ultralytics, documentationdocs.ultralytics.com
  3. Keras, KerasCV object detection guidekeras.io
  4. TensorFlow, Save and load modelstensorflow.org
  5. TensorFlow, Beginner quickstarttensorflow.org
  6. COCO datasetcocodataset.org
Pranjul Rathour
Pranjul Rathour
GenAI Engineer · India

GenAI engineer and AI product builder with 2+ years shipping production-grade AI systems: RAG pipelines, fine-tuned LLMs, hybrid retrieval and multi-modal apps across vision, speech and OCR, architected end to end from ingestion to deployment. Leads engineering for SCULT INDIA's 14-member team, founded the 500+ member TechVerse Enclave community and has mentored 200+ students. Three hackathon first prizes: Changethon 2025 (IIT Roorkee), Product Genesis at Vividhotsava 2025 (CSJMU) and BYTEBATTLE (MeetKats).

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way. Email pranjulrathour41@gmail.com.

Keep reading

More on Vision, speech & OCR

All Vision, speech & OCR guides →
Campus talks · hackathon judging · mentoring

Want this as a live session at your college?

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way.

Pranjul Rathour, GenAI engineer in India