Visual Intelligence Summit: Oct 22 in San Francisco Get your ticket

Convert annotation formats

How To Convert VGG Image Annotator CSV to YOLOv5 Oriented Bounding Boxes

In this guide, we show you how to convert data between the VIA and YOLOv5 OBB formats for free. You can use your converted data to train YOLOv5 Oriented Bounding Boxes models and other models that support the YOLOv5 OBB format.

VGG Image Annotator CSV

The VGG Image Annotator tool's CSV format.

Below, learn the structure of VGG Image Annotator CSV.

via_export_csv.csv
filename,file_size,file_attributes,region_count,region_id,region_shape_attributes,region_attributes
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,0,"{""name"":""rect"",""x"":238,""y"":34,""width"":59,""height"":87}","{""name"":""helmet"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,1,"{""name"":""rect"",""x"":89,""y"":143,""width"":87,""height"":128}","{""name"":""person"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,2,"{""name"":""rect"",""x"":236,""y"":244,""width"":52,""height"":73}","{""name"":""person"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,3,"{""name"":""rect"",""x"":356,""y"":-1,""width"":55,""height"":80}","{""name"":""person"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,4,"{""name"":""rect"",""x"":315,""y"":287,""width"":54,""height"":88}","{""name"":""helmet"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,5,"{""name"":""rect"",""x"":554,""y"":94,""width"":73,""height"":119}","{""name"":""helmet"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,6,"{""name"":""rect"",""x"":384,""y"":297,""width"":42,""height"":74}","{""name"":""helmet"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
1be.jpg,46626,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",8,7,"{""name"":""rect"",""x"":507,""y"":244,""width"":53,""height"":64}","{""name"":""helmet"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"
0af.jpg,49656,"{""caption"":"""",""public_domain"":""no"",""image_url"":""""}",13,0,"{""name"":""rect"",""x"":116,""y"":35,""width"":61,""height"":86}","{""name"":""person"",""type"":""unknown"",""image_quality"":{""good"":true,""frontal"":true,""good_illumination"":true}}"

YOLOv5 Oriented Bounding Boxes

A modified version of YOLO Darknet annotations that allows for rotated bounding boxes.

Below, learn the structure of YOLOv5 Oriented Bounding Boxes.

Each image has one txt file with a single line for each bounding box. The format of each row is

x1 y1 x2 y2 x3 y3 x4 y4 label

where fields are space delimited, and the coordinates are measured in pixels.

001.txt
236 267 271 267 271 306 236 306 helmet 0
188 230 216 230 216 257 188 257 helmet 0
169 146 200 146 200 174 169 174 helmet 0
201 114 230 114 230 140 201 140 helmet 0
247 245 272 245 272 268 247 268 helmet 0
261 231 285 231 285 257 261 257 helmet 0
146 150 172 150 172 179 146 179 head 0

The `data.yaml` file contains configuration values used by the model to locate images and map class names to class_id's.

data.yaml
path: ../datasets/roboflow

train: train/images
val: valid/images
test: test/images

nc: 3
names: ['head', 'helmet', 'person']

Step 1: Create a free Roboflow public workspace

Roboflow is a universal conversion tool for computer vision annotation formats. The Public plan is the best way for those exploring personal projects, class assignments, and other experiments to try Roboflow. To convert your dataset, start by creating a free workspace on the Public plan.

Step 2: Upload your data into Roboflow

Once your account has been created, click Create New Project.

Roboflow's create project form, with Object Detection selected as the project type

Upload your data to Roboflow by dragging and dropping your VGG Image Annotator CSV images and annotations into the upload space.

Roboflow's upload page, with a drag-and-drop area for images, annotations, videos and PDFs

Step 3: Generate Dataset Version

Next, click "Generate New Version" to generate a new version of your dataset:

Roboflow's Generate a Dataset Version page, showing the source images and train/test split for a new version

You can then apply any preprocessing or augmentation steps to your dataset:

The augmentation step of a new dataset version, with 90° Rotate and Brightness added

Step 4: Export Dataset Version

After generating, you will be prompted to Export your dataset. You can choose to receive your dataset as a .zip file or a curl download link. Choose YOLOv5 Oriented Bounding Boxes when asked in what format you want to export your data. You will see a dropdown with various options like this:

Roboflow's Download dialog, with the export format list open and COCO highlighted

Congratulations, you have successfully converted your dataset from VGG Image Annotator CSV format to YOLOv5 Oriented Bounding Boxes format!

Video Tutorial

Convert Computer Vision Annotation Formats Tutorial

Want to dive deeper into converting annotation formats with Roboflow? In the tutorial below, we explore how to convert your data in the Roboflow dashboard. We also discuss rejecting annotations and train-test-validation splits.

Frequently Asked Questions

Yes! It is free to convert VGG Image Annotator CSV data into the YOLOv5 Oriented Bounding Boxes format on the Roboflow platform.

If you have between a few and a few thousand images, converting data between these formats will be quick. But, the time it takes to convert between data formats increases with the more images you have.

Show guide

Convert other formats to YOLOv5 Oriented Bounding Boxes

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 16,000 organizations build with Roboflow.

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