How to label data for YOLOv3 PyTorch training

Before you can train a computer vision model, you need labeled data on which to train your model. The more accurate the labels, or annotations, are, the higher the performance the model will achieve.

Overview

In this guide, we are going to show how to use Roboflow Annotate, a free tool you can use to create a dataset for YOLOv3 training. You can use data annotated in Roboflow for training a model in Roboflow using Roboflow Train. You can also export your annotations so you can use them in your own YOLOv3 custom training process.

Roboflow offers a robust annotation platform that:

  • Uses state-of-the-art technology
  • Complies with SOC 2 Type 2 requirements
  • Trusted by over 2 million developers

To label data for YOLOv3 PyTorch, you will:

  1. Import data into Roboflow Annotate
  2. Open an image
  3. Label data with bounding boxes or polygons
  4. Try Label Assist (opens in a new tab) for automated labeling
  5. Save the annotated data
  6. (Optional) Train a model or export your data

Let's get started!

Step 1: Import data into Roboflow Annotate

First, create a free Roboflow account. Then, create a new project from the Roboflow dashboard:

The Create Project page in Roboflow, with Object Detection selected for a project named Solar Panels


Once you have created a project, you will be taken to a page where you can upload your images. Drag-and-drop any images into the box:

The Upload Data page of a Roboflow project, with a drop zone for images, annotations, videos, PDFs and zips


You can also drag in annotation files if you want to view or amend annotations in Roboflow Annotate.

When you have uploaded your files, click "Save and Continue".

Your images will be uploaded to Roboflow.

Step 2: Open an Image

After you have uploaded all of your images, click on one to open:

Roboflow Annotate with an image of bees on a hive entrance, each labeled with a bounding box as a worker or drone

Once you have opened an image, you will see the Roboflow Annotate interface, through which you can create bounding boxes, segmentation masks, classification labels, and polygon annotations, depending on your project type.

Since this is an Object Detection project, we can either create bounding box or polygon annotations.

Step 3: Label Data with Boxes or Polygons

To draw a bounding box, select the box tool in the right sidebar of Roboflow Annotate, or press "b" on your keyboard. Then, drag where you want to draw your bounding box:

Your bounding box should be drawn tightly around the object you want to annotate. Tight bounding boxes allow the model you are training to better understand what the specific object is you want to identify. Review our labeling best practices for more data annotation tips.

You can draw a polygon for object detection or semantic segmentation using the Polygon annotation tool. To toggle polygon annotation mode, press "p" on your keyboard, or click on the icon below the bounding box icon in the Roboflow Annotate sidebar.

You can also use Smart Polygon (opens in a new tab) to generate annotations by clicking an object of interest.

To enable Smart Polygon, click the cursor icon in the right sidebar. There are two versions of Smart Polygon:

  1. Standard, which is ideal for small items
  2. Enhanced, which is ideal for most use cases

Let's use Enhanced Smart Polygon to label solar panels.

With Smart Polygon enabled, you can click on an object to create a polygon annotation. Polygon annotations can be used for object detection and segmentation tasks.

Step 4: Annotate Images with Label Assist

Roboflow Annotate comes with a tool called Label Assist with which you can label images. Label Assist lets you use:

  1. A model trained on the Microsoft COCO dataset, that can identify 80 classes
  2. Any of the 250,000+ public trained models on Roboflow Universe (opens in a new tab)
  3. Previous versions of your model

To use Label Assist, click the magic wand icon in the sidebar. Roboflow Annotate will recommend new annotations based on the model you have selected as your assistant.

You can also use Box Prompting (opens in a new tab): label one example of a class, and Roboflow suggests boxes around the similar objects in the image. Its suggestions improve with each image you label.

Step 5: Save Your Annotation

Once you have finished annotating your image, you can move on to the next image you want to annotate! To do so, click the forward or backward arrows at the top of the Annotate interface, or use the forward and backward arrows on your keyboard.

Step 6: Train a Model or Export Data

With all of your data labeled, you are now ready to train a model on Roboflow or export your data elsewhere. To train a model in Roboflow with your data, follow the Train a Model guide (opens in a new tab).

To train YOLOv3 PyTorch outside Roboflow, export your dataset as YOLOv5 PyTorch TXT, the format YOLOv3 PyTorch training reads. Roboflow exports to over 30 other formats too.

Automatically Label Data with Auto Label

Auto Label labels a whole batch of images for you in Roboflow. Name the classes you want, and a foundation model such as SAM 3 draws the boxes or polygons. You can also auto-label with a model you trained in Roboflow, or with a Workflow.

Test the labels on a few images before you run the full batch, then review them before you train YOLOv3 PyTorch. See the Auto Label documentation (opens in a new tab) for the models it supports on each project type.

Start where you are

Speak with an AI expert

Our team will help you start solving business problems on the first call.

  • Solution architecting
  • Live demonstration
  • Pricing and specifications
  • Feasibility assessment

Over 80,000 organizations build with Roboflow.

Rivian
Pella
Chobani
USG Corporation
BNSF Railway
American Woodmark
Outcomes
Patrick Industries
Peer Robotics