How to Label Images for Object Detection: A Beginner's Guide
What annotations are, how to draw consistent boxes and polygons, YOLO, COCO and Pascal VOC formats explained, and how pre-labelling speeds things up.

How to Label Images for Object Detection: A Beginner's Guide
Every object detection model learns from labelled examples: images in which people have drawn boxes around the objects and named them. The quality of those labels limits how good the model can become. This guide covers the essentials of labelling a dataset well.
Boxes or polygons?
- Bounding boxes are rectangles around each object. They are fast to draw and enough for most detection tasks, such as counting people or finding products on shelves.
- Polygons trace the outline of each object. They take longer but are needed for segmentation models, which predict the exact shape of objects, for example measuring leaf damage or cutting out products.
Define your classes first
Decide exactly which classes you need and write a one-line definition for each. Is a van a car or a separate class? Does "person" include reflections and posters of people? Ambiguity in the definitions becomes inconsistency in the labels, which confuses the model.
Labelling rules for consistency
- Draw boxes tight to the visible edges of the object.
- Label every instance of every class in each image, not just the obvious ones.
- Label partly hidden objects, drawing the box around the visible part.
- Decide a minimum size below which objects are ignored, and stick to it.
- Treat crowds and tiny repeated objects consistently.
Write these rules down and share them with anyone helping.
How many images?
Simple, distinctive objects can work with a few hundred labelled examples per class; varied, subtle objects need thousands. Variety matters more than volume: different lighting, angles, backgrounds, distances and seasons. Include images without any objects too, so the model learns what the background looks like.
Pre-labelling saves time
A pretrained detector can propose boxes for common objects such as people, cars, animals and household items. Correcting a suggestion is much faster than drawing from scratch. Always review pre-labels: detectors miss small or unusual objects and sometimes assign the wrong class.
Export formats explained
- YOLO: one text file per image, each line holding a class number and the box centre, width and height as fractions of the image size. Used by the popular YOLO family of models. Segmentation uses polygon points in the same normalised form.
- COCO JSON: one file listing all images, categories and annotations, with boxes in pixels and optional polygons. Used by many research frameworks.
- Pascal VOC: one XML file per image with pixel box corners. An older but still widely supported format.
Most training tools can convert between them, but exporting directly avoids mistakes.
Splitting the data
Divide the dataset into training (about 70 to 80 percent), validation (10 to 15 percent) and test (10 to 15 percent) sets. Keep similar images, such as frames from the same video, in the same split; otherwise test results look better than real-world performance.
Quality control
Review a random sample of labelled images regularly. Look for missing objects, loose boxes and wrong classes. A second person checking a portion of the labels catches systematic mistakes early.
Keyboard workflow
Labelling speed comes from keeping your hands in position: number keys switch classes, a single key changes tools, arrow keys move between images, and Delete removes a mistake. Labellers working this way often reach several hundred boxes an hour while keeping quality high.
Iterate with your model
After training a first model on a few hundred images, use it to pre-label the next batch. Correcting your own model's mistakes shows where it is weak, and focusing new labels on those cases improves it fastest.
Privacy and rights
Images of people may be personal data. Labelling locally keeps them off third-party servers, but you still need a lawful basis to collect and use them, and permission to use images you did not take.
Careful, consistent labels are the foundation of a good model. Spend time on clear rules and quality checks, and the training itself becomes the easy part.


&c=%237c3aed&k=images)
