Back
YOLO Imaging 2

YOLO Series Part 2: Using a Pretrained YOLO Model

Once you understand what YOLO does, the next step is simple: get a version of it running on your own computer and watch it actually spot things in a picture.

The last post explained what YOLO is and why it's useful. This one is about actually using it, no training, no data collection, just picking up a model that already knows how to spot objects and running it on a photo of your own.

You don't need a powerful computer or any machine learning background to follow along. If you can install a program and run a few lines of code, you can do this.

What "Pretrained" Actually Means

Training a YOLO model from scratch means showing it thousands and thousands of labelled photos until it learns to recognise things on its own, cars, people, dogs, whatever you want it to spot. That takes time, a lot of data, and a fair bit of computing power.

A pretrained model skips all of that. Someone else has already done the training, using a huge public collection of labelled photos called COCO (short for Common Objects in Context), and they've shared the finished result for anyone to use. A pretrained YOLO model can already recognise 80 everyday categories of object, people, cars, dogs, chairs, phones, and more, straight out of the box, with no setup beyond installing it.

What You'll Need

Just three things:

  • A computer with Python installed. Nothing special, a normal laptop is fine for this.
  • A photo to test it on, any picture with a few everyday objects in it works well.
  • A few minutes to install one library and run a handful of lines of code.

Never Set Up Python Before?

If terms like "terminal" or "installing a library" are unfamiliar, that's completely normal, and it's genuinely the hardest part for most beginners, harder than anything YOLO itself asks of you. Start with installing Python and VS Code, then come back here once you're set up.

Step 1: Install the Library

Ultralytics is the company that builds and maintains the most widely used version of YOLO, and they've made it genuinely simple to get started. Open a terminal and run:

pip install ultralytics

That single command installs everything needed to load and run a YOLO model.

Step 2: Load a Pretrained Model

Next, in a Python file or notebook:

from ultralytics import YOLO

model = YOLO("yolo11n.pt")

That second line does something worth pausing on: it downloads a small, ready-to-use YOLO model, already trained on those 80 everyday object categories, and loads it into memory. The "n" in the file name stands for "nano," the smallest and fastest version, a good starting point since it runs comfortably on an ordinary laptop with no dedicated graphics card.

Step 3: Run It on a Photo

results = model("your-photo.jpg")
results[0].show()

That's genuinely it. The model looks at your photo, finds everything it recognises, and the second line opens a window showing your photo with boxes drawn around every object it spotted, each one labelled with what it thinks that object is and how confident it is.

What You're Actually Looking At

Each box has a label like "person 0.89." That number is the model's confidence, in this case, 89 percent sure that box really does contain a person. Lower numbers mean the model is less certain, useful to know once you start deciding which detections to trust and which to ignore.

Why This Matters More Than It Looks

What just happened in those three steps is the same basic process behind every real YOLO application, whether that's sorting produce on a conveyor belt or flagging a possible fault on a railway line. The photo changes, the specific objects being looked for change, but loading a model and asking it to find things in an image is the same operation every time.

The gap between what you just did and a real product isn't the detection itself, it's making it fast enough to run continuously, on the right hardware, in real time. That's a separate problem, and it's exactly what the next post covers.


Where This Goes Next

You've now run a real object detection model yourself. The final post in this series takes this further, building something that actually does a job, not just showing boxes on a single photo.

Leave A Reply