Explore Ultralytics YOLOv8

A new state-of-the-art in computer vision, supporting object detection, classification, and segmentation tasks.

Try Out YOLOv8

Experiment with a YOLOv8 model trained on the Microsoft COCO dataset.

Drag a file here.

Explore YOLOv8 Models

Using Roboflow Universe, you can explore models trained to solve a vast range of problems, from identifying planes in aerial imagery to identifying forklifts and pallets in work areas.

Selected YOLOv8 Models

Explore more YOLOv8 models

What is YOLOv8?

YOLOv8 is a new state-of-the-art computer vision model built by Ultralytics, the creators of YOLOv5. The YOLOv8 model contains out-of-the-box support for object detection, classification, and segmentation tasks, accessible through a Python package as well as a command line interface.

To install YOLOv8, run the following command:

How do you install YOLOv8?

pip install ultralytics

This command will install the latest version of the YOLOv8 library. You can then use the model with the "yolo" command line program or by importing the model into your script using the following python code.

How do you use YOLOv8?

You can use the YOLOv8 model in your Python code or via the model CLI.

Use the CLI

To train a model with the YOLOv8 CLI, use this command:

yolo predict model=yolov8s.pt source="image.png"

Add the source to the image on which you want to run inference. This will use the default YOLOv8s model weights to make a prediction. To learn more about training a custom model on YOLOv8, keep reading!

Use the Python Package

To use the Python CLI, first import the "ultralytics" package into your code. Then, you can use the package to load, train, and use a model.

Load a Custom Model

To load a custom model into your project, use the following code:


from ultralytics import YOLO
model = YOLO("yolov8s.pt") # load the model
results = model.train(data="coco128.yaml", epochs=100)
results = model("./image.png")

This code loads the default YOLOv8n model weights and trains a model using the COCO dataset for 100 epochs. You may want to run this code in a Google Colab so that you can keep your trained model in memory for experimentation.

You can replace the "yolov8s" text with the name of the model you want to use. You can learn more about the different model sizes available in the Ultralytics YOLOv8 GitHub repository.

Create a New Model (Advanced)

While loading a model using the default YOLOv8n weights is recommended, you can train a new model from scratch using the Python package too. To do so, provide a YOLOv5 PyTorch TXT file that contains information about the dataset on which you want to train your model:


from ultralytics import YOLO
model = YOLO("dataset.yaml")
model.train(data=coco128.yaml, epochs=100)
prediction_results = model("image.jpg")
model.export(format="onnx") # export the model you have trained

What are the main features in YOLOv8?

YOLOv8 comes with both architectural and developer experience improvements.

Compared to YOLOv8's predecessor, YOLOv5, YOLOv8 comes with:

1. A new anchor-free detection system.
2. Changes to the convolutional blocks used in the model.
3. Mosaic augmentation applied during training, turned off before the last 10 epochs.

Furthermore, YOLOv8 comes with changes to improve developer experience with the model. First, the model now comes packaged as a library you can install in your Python code. A quick "pip install ultralytics" will give you the

Who created YOLOv8?

YOLOv8 was built by Ultralytics. The code for YOLOv8 is open source and licensed under an AGPL-3.0 license.

YOLOv8 Learning Resources

Ready to start training your first model? Curious about how YOLOv8 works and want to dive deeper? The resources curated below will help guide you through understanding YOLOv8 in greater depth and building models.