The YOLOv8 COCO class list contains 80 object categories that pretrained YOLOv8 detection models can recognize. These classes come from the COCO dataset and include common objects such as people, cars, animals, furniture, food items, sports equipment, and household objects. Each class has a unique ID from 0 to 79, which YOLOv8 uses internally during detection.
Introduction to the YOLOv8 COCO Class List
YOLOv8 pretrained object detection models are commonly trained on the COCO dataset, which contains 80 standard object categories. These classes cover many everyday objects found in real-world images and videos.
When a pretrained YOLOv8 model detects an object, it predicts a bounding box, class ID, class name, and confidence score. For example, a detected person is assigned class ID 0, while a detected car uses class ID 2.
Understanding the COCO class list is useful when filtering detections, building object-specific applications, or deciding whether a custom YOLOv8 model is required.
What Is the COCO Dataset in YOLOv8?
COCO stands for Common Objects in Context. It is a widely used computer vision dataset containing images with labeled objects, bounding boxes, segmentation annotations, and other visual information.
YOLOv8 pretrained detection models use the 80-category COCO object detection class set.
These categories represent objects commonly found in everyday environments, including people, transportation, animals, kitchen items, furniture, electronics, and sports equipment.
Why YOLOv8 Uses COCO Classes
COCO provides a large and diverse collection of annotated images, making it useful for training general-purpose object detectors.
Because its classes cover many common real-world objects, a YOLOv8 model trained on COCO can perform useful detection immediately without requiring users to train a model from scratch.
For example, pretrained YOLOv8 models can recognize people, bicycles, cars, dogs, chairs, laptops, bottles, and many other common objects.
How COCO Classes Are Used in Object Detection
During detection, YOLOv8 analyzes an image and generates predictions for objects it recognizes.
Each prediction is associated with a COCO class ID. The model maps this numerical ID to a readable class label.
For example:
- Class ID 0 represents person.
- Class ID 1 represents bicycle.
- Class ID 2 represents car.
- Class ID 16 represents dog.
Along with the class label, YOLOv8 predicts the position of the object using a bounding box and provides a confidence score indicating how certain the model is about the prediction.
How Many Classes Does YOLOv8 COCO Have?
YOLOv8 models trained on the standard COCO detection dataset support 80 object classes.
These classes are indexed from 0 through 79.
The class numbering is important when working with predictions programmatically because YOLOv8 often returns a numeric class ID that can then be mapped to the corresponding class name.
Understanding the 80 COCO Object Classes
The 80 COCO categories cover multiple types of objects.
They include:
- people,
- transportation,
- animals,
- outdoor objects,
- sports equipment,
- kitchen items,
- food,
- furniture,
- electronics,
- indoor household objects.
This variety makes COCO-trained YOLOv8 models suitable for many general object detection applications.
COCO Class IDs and Labels
Every COCO category used by YOLOv8 has a unique numerical class ID.
The first class has ID 0 and the final class has ID 79.
For example, YOLOv8 maps:
0 → person
2 → car
15 → cat
16 → dog
39 → bottle
56 → chair
63 → laptop
These IDs remain useful when filtering or processing predictions in code.
Complete YOLOv8 COCO Class List
The complete YOLOv8 COCO class mapping is:
| Class ID | Class Name |
|---|---|
| 0 | person |
| 1 | bicycle |
| 2 | car |
| 3 | motorcycle |
| 4 | airplane |
| 5 | bus |
| 6 | train |
| 7 | truck |
| 8 | boat |
| 9 | traffic light |
| 10 | fire hydrant |
| 11 | stop sign |
| 12 | parking meter |
| 13 | bench |
| 14 | bird |
| 15 | cat |
| 16 | dog |
| 17 | horse |
| 18 | sheep |
| 19 | cow |
| 20 | elephant |
| 21 | bear |
| 22 | zebra |
| 23 | giraffe |
| 24 | backpack |
| 25 | umbrella |
| 26 | handbag |
| 27 | tie |
| 28 | suitcase |
| 29 | frisbee |
| 30 | skis |
| 31 | snowboard |
| 32 | sports ball |
| 33 | kite |
| 34 | baseball bat |
| 35 | baseball glove |
| 36 | skateboard |
| 37 | surfboard |
| 38 | tennis racket |
| 39 | bottle |
| 40 | wine glass |
| 41 | cup |
| 42 | fork |
| 43 | knife |
| 44 | spoon |
| 45 | bowl |
| 46 | banana |
| 47 | apple |
| 48 | sandwich |
| 49 | orange |
| 50 | broccoli |
| 51 | carrot |
| 52 | hot dog |
| 53 | pizza |
| 54 | donut |
| 55 | cake |
| 56 | chair |
| 57 | couch |
| 58 | potted plant |
| 59 | bed |
| 60 | dining table |
| 61 | toilet |
| 62 | tv |
| 63 | laptop |
| 64 | mouse |
| 65 | remote |
| 66 | keyboard |
| 67 | cell phone |
| 68 | microwave |
| 69 | oven |
| 70 | toaster |
| 71 | sink |
| 72 | refrigerator |
| 73 | book |
| 74 | clock |
| 75 | vase |
| 76 | scissors |
| 77 | teddy bear |
| 78 | hair drier |
| 79 | toothbrush |
Person and Vehicle Classes
The COCO dataset includes one person class and several transportation-related categories.
Important examples include:
- person — 0
- bicycle — 1
- car — 2
- motorcycle — 3
- airplane — 4
- bus — 5
- train — 6
- truck — 7
- boat — 8
These classes make pretrained YOLOv8 models useful for traffic monitoring, vehicle counting, pedestrian detection, and transportation analysis.
Animal Classes
YOLOv8 can recognize several common animal categories from the COCO dataset.
These include bird, cat, dog, horse, sheep, cow, elephant, bear, zebra, and giraffe.
For example, cat uses class ID 15, dog uses 16, and horse uses 17.
These categories can be useful for wildlife monitoring, pet detection, farm applications, and general image analysis.
Household and Indoor Object Classes
Many common indoor objects are also included in the COCO classes.
Examples include chair, couch, bed, toilet, television, laptop, mouse, keyboard, cell phone, microwave, refrigerator, book, clock, vase, and toothbrush.
These categories make YOLOv8 useful for smart-home systems, indoor scene analysis, inventory detection, and assistive computer vision applications.
Food and Kitchen Object Classes
COCO includes several food and kitchen-related classes.
Kitchen objects include bottle, wine glass, cup, fork, knife, spoon, and bowl.
Food classes include banana, apple, sandwich, orange, broccoli, carrot, hot dog, pizza, donut, and cake.
These classes can be used in food recognition, restaurant applications, kitchen monitoring, and automated image classification workflows.
Sports and Outdoor Object Classes
Sports-related COCO categories include frisbee, skis, snowboard, sports ball, kite, baseball bat, baseball glove, skateboard, surfboard, and tennis racket.
Outdoor objects such as traffic lights, fire hydrants, stop signs, parking meters, benches, and umbrellas are also represented.
These categories allow YOLOv8 to support sports analysis, street-scene detection, and outdoor monitoring applications.
YOLOv8 COCO Class IDs
Class IDs are numerical identifiers used internally to represent object categories.
Instead of storing the word “person” directly in every prediction operation, the model can return ID 0, which is then mapped to the class name.
Class ID Mapping from 0 to 79
YOLOv8 COCO classes follow a zero-based numbering system.
This means:
First class: 0 — person
Last class: 79 — toothbrush
There are 80 total values because the range starts at zero.
Class IDs should not be confused with category identifiers used in every raw COCO annotation format, because YOLO training configurations commonly remap the selected 80 classes into a continuous range from 0 to 79.
How to Find the Class ID of an Object
You can find an object’s class ID by checking the COCO class mapping used by your YOLOv8 model.
For example:
- person = 0
- car = 2
- dog = 16
- backpack = 24
- bottle = 39
- pizza = 53
- laptop = 63
- cell phone = 67
When processing predictions through Python, the predicted numerical ID can be mapped to the model’s class-name dictionary.
How YOLOv8 Predicts COCO Classes
When YOLOv8 receives an image, the backbone first extracts visual features. The neck combines features at multiple scales, and the detection head produces class and bounding box predictions.
The output is then processed to identify the most relevant detections.
Class Confidence Scores
For each potential object, YOLOv8 produces classification scores representing the model’s confidence in different classes.
A stronger score indicates that the model has greater confidence that the detected object belongs to a particular category.
For example, if an object strongly resembles a car, the class score associated with the car category may become the highest prediction.
Confidence thresholds can be used to remove weak detections.
Bounding Boxes and Class Labels
Each final object detection combines localization and classification information.
A typical prediction contains:
- bounding box coordinates,
- class ID,
- class name,
- confidence score.
The bounding box identifies where the object appears in the image, while the class label indicates what the model believes the object is.
For example, YOLOv8 might return a bounding box around a vehicle together with class ID 2 and the label “car.”
Using the COCO Class List in YOLOv8 Projects
You do not always need to detect all 80 COCO classes.
Many applications only require a small subset of categories. YOLOv8 allows predictions to be filtered so that your application focuses only on relevant objects.
Filtering Specific Classes
Class IDs can be used to filter detections.
For example, a traffic application might only need:
- person — 0
- bicycle — 1
- car — 2
- motorcycle — 3
- bus — 5
- truck — 7
Other detections can be ignored even though the pretrained model is capable of recognizing them.
This makes downstream processing simpler and allows an application to focus on its intended objects.
Detecting Only Selected COCO Objects
Selected class IDs can be provided when running YOLOv8 inference.
For example, in Ultralytics Python usage:
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
results = model("image.jpg", classes=[0, 2, 5])
This example limits the desired detections to class IDs 0, 2, and 5, corresponding to person, car, and bus.
The exact available inference options can depend on the Ultralytics version being used.
Using Class Names in Python Predictions
YOLOv8 also provides access to the mapping between numerical class IDs and readable class names.
A typical example is:
from ultralytics import YOLO
model = YOLO("yolov8n.pt")
results = model("image.jpg")
for result in results:
for box in result.boxes:
class_id = int(box.cls[0])
class_name = model.names[class_id]
print(class_id, class_name)
This makes it easy to convert numerical predictions into labels that can be displayed or used elsewhere in an application.
YOLOv8 COCO Classes vs Custom Classes
Pretrained COCO classes are useful for general-purpose object detection, but they do not cover every object a user may want to detect.
For specialized tasks, YOLOv8 can be trained or fine-tuned on a custom dataset containing different classes.
When to Use Pretrained COCO Classes
Use pretrained COCO classes when the objects you need are already included among the standard 80 categories.
For example, a pretrained model may be sufficient if your project focuses on:
- people,
- cars,
- buses,
- animals,
- furniture,
- common household objects.
Using a pretrained model avoids the need to collect and annotate a new dataset for common detection tasks.
When to Train YOLOv8 on Custom Classes
Custom training is necessary when your target objects are not represented by the COCO class list or when the standard model is not specialized enough for your environment.
For example, you may need custom training to detect:
- industrial machine components,
- specific product models,
- plant diseases,
- medical objects,
- custom logos,
- specialized tools.
A custom dataset defines its own class names, so the resulting YOLOv8 model is no longer limited to the standard 80 COCO categories.
FAQs About the YOLOv8 COCO Class List
How many COCO classes are available in YOLOv8?
Standard YOLOv8 models pretrained on COCO support 80 object classes. Their class IDs range from 0 to 79.
What are the 80 classes in YOLOv8?
The 80 classes include person, bicycle, car, motorcycle, airplane, animals, sports equipment, food, furniture, electronics, kitchen objects, and other common real-world categories. The complete list is provided above with corresponding IDs.
What is class 0 in YOLOv8 COCO?
Class ID 0 represents person in the standard YOLOv8 COCO class mapping.
What is the class ID range in YOLOv8?
For a standard COCO-trained YOLOv8 detection model, class IDs range from 0 to 79.
Can YOLOv8 detect objects outside the COCO class list?
A standard COCO-pretrained YOLOv8 model does not automatically recognize arbitrary objects outside its trained classes. To reliably detect additional categories, the model should be trained or fine-tuned using a custom dataset containing those objects.
Can I use only selected COCO classes in YOLOv8?
Yes. You can filter YOLOv8 predictions by class IDs so that only specific COCO categories are returned or processed by your application.
How can I add custom classes to YOLOv8?
To use custom classes, create a labeled dataset containing your target categories, define the class names in the dataset configuration, and train or fine-tune a YOLOv8 model on that dataset. The trained model will then use the custom class mapping instead of being limited to the standard COCO list.
Conclusion
The YOLOv8 COCO class list contains 80 object categories, numbered from class ID 0 to 79. These classes include common people, vehicles, animals, food, sports equipment, furniture, electronics, and household objects.
Understanding the class mapping is useful when reading predictions, filtering detections, or building applications that only need certain object categories.
For objects already covered by COCO, pretrained YOLOv8 models provide a convenient starting point. When a project requires specialized categories outside these 80 classes, YOLOv8 can be trained on a custom dataset with its own class names and IDs.
I’m Jane Austen, a skilled content writer with the ability to simplify any complex topic. I focus on delivering valuable tips and strategies throughout my articles.