A new state-of-the-art in computer vision, supporting object detection, classification, and segmentation tasks.
Experiment with a YOLOv8 model trained on the Microsoft COCO dataset.
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.
Count airplanes photographed using aerial imagery techniques.
Detect forklifts, pallets, and small load carriers, among other items you would find in a warehouse environment.
Identify license plates in an image.
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:
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.
You can use the YOLOv8 model in your Python code or via the model CLI.
To train a model with the YOLOv8 CLI, use this command:
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!
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.
To load a custom model into your project, use the following code:
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.
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:
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
YOLOv8 was built by Ultralytics. The code for YOLOv8 is open source and licensed under an AGPL-3.0 license.
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.
Find the source code used in the YOLOv8 model as well as a quick-start guide to help you start using YOLOv8.
In this guide, you'll learn how to train a YOLOv8 model from scratch. You'll work through gathering data, preparing a dataset, and training a model using your data.
This guide discusses how to track and count objects using YOLOv8, ByteTrack, and Supervision.