Use the widget below to experiment with YOLOv5 Classification. You can detect COCO classes such as people, vehicles, animals, household items.
YOLOv5 was released by Glenn Jocher on June 9, 2020 for object detection. Recently, YOLOv5 added support for classification (August 2022) and instance segmentation (September 2022).
Classification assigns a given image to an array of possible classes and can be binary or multi-class. Using classification to identify one particular class could mean you could train a model to identify a specific fruit and then pass images of plants through the model to identify what fruit is in the image. With multi-class classification, you may want to know each class represented in the image.
Classification do not localize in the image where the objects of interest are, how many there are, or their size.
Find a free classification dataset to try YOLOv5 for classification.
If you have your own data, label your images for free using Roboflow Annotate.
YOLOv5 is regarded as smaller and generally easier to use in production thanks to being implemented in Pytorch. This means you can use YOLOv5 classification on the edge on devices like iPhones or cameras. Read more about YOLOv5 performance.
YOLOv5 Classification
is licensed under a
AGPL-3.0
license.
You can use Roboflow Inference to deploy a
YOLOv5 Classification
API on your hardware. You can deploy the model on CPU (i.e. Raspberry Pi, AI PCs) and GPU devices (i.e. NVIDIA Jetson, NVIDIA T4).
Below are instructions on how to deploy your own model API.
You can run fine-tuned YOLOv5 classification models with Inference.
First, install Inference:
pip install inference
Retrieve your Roboflow API key and save it in an environment variable called ROBOFLOW_API_KEY
:
export ROBOFLOW_API_KEY="your-api-key"
To use your model, run the following code:
import inference
model = inference.load_roboflow_model("model-name/version")
results = model.infer(image="YOUR_IMAGE.jpg")
Above, replace:
YOUR_IMAGE.jpg
with the path to your image.model_id/version
with the YOLOv5 model ID and version you want to use. Learn how to retrieve your model and version ID