Convert annotation formats

How To Convert Tensorflow Object Detection CSV to YOLO Darknet TXT

In this guide, we show you how to convert data between the Tensorflow CSV and YOLO Darknet formats for free. You can use your converted data to train YOLOv3 PyTorch models and other models that support the YOLO Darknet format.

Convert with an AI agent

Paste this prompt into your coding agent

Claude Code, Cursor, Codex or any agent with the Roboflow MCP uploads your Tensorflow Object Detection CSV dataset to Roboflow, generates a version and downloads it as YOLO Darknet TXT.

No Roboflow MCP yet? The prompt has your agent set it up first, or connect your agent before you paste it.

Rather convert it by hand? Follow the steps below

Tensorflow Object Detection CSV

The intermediate human-readable format prior to creating a TFRecord.

Below, learn the structure of Tensorflow Object Detection CSV.

tensorflow.csv
filename,width,height,class,xmin,ymin,xmax,ymax
000001.jpg,500,375,helmet,111,144,134,174
000001.jpg,500,375,helmet,178,84,230,143
000007.jpg,500,466,helmet,115,139,180,230
000007.jpg,500,466,helmet,174,156,201,219
000007.jpg,500,466,helmet,197,177,231,227
000007.jpg,500,466,helmet,247,124,294,203
000007.jpg,500,466,helmet,280,127,337,208
000007.jpg,500,466,helmet,336,148,387,223
000007.jpg,500,466,helmet,375,152,410,219

YOLO Darknet TXT

The favored annotation format of the Darknet family of models.

Below, learn the structure of YOLO Darknet TXT.

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

class_id center_x center_y width height
img0001.txt
1 0.408 0.30266666666666664 0.104 0.15733333333333333
1 0.245 0.424 0.046 0.08
darknet.labels
head
helmet
person

Step 1: Create a free Roboflow account

Roboflow is a universal conversion tool for computer vision annotation formats. To convert your dataset, start by creating a free Roboflow account.

Step 2: Upload your data into Roboflow

Once your account has been created, click Create New Project. (opens in a new tab)

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

Upload your data to Roboflow by dragging and dropping your Tensorflow Object Detection 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 YOLO Darknet TXT 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 Tensorflow Object Detection CSV format to YOLO Darknet TXT 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 Tensorflow Object Detection CSV data into the YOLO Darknet TXT 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
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
Create free Roboflow account