Hello! I am using AddaxAI to annotate my images for training a YOLO model. Is there an option for exporting annotations as .txt instead of .xml to fit YOLO format? I don’t see an option for this, however, in my manual verification window the File tab isn’t clickable for me. I’m guessing this is where I might make that specification if it was possible.
Unfortunately AddaxAI does not support exportation to YOLO format. It will only export to Pascal VOC. Luckily there are many options to convert them yourself:
For Non-Coders
(No programming needed, just drag & drop or click-based conversion tools)
Roboflow:
Upload your dataset, convert formats easily (XML → YOLO).
Requires account but the free tier is very generous.
Also offers visualization and dataset management.
makesense.ai:
Browser-based tool to annotate and export to multiple formats including YOLO.
You can even reimport your VOC annotations and export to YOLO.
(Comfortable writing and editing scripts, working with folders, classes, etc.)
Custom Python Script
Write a parser using xml.etree.ElementTree to walk through all VOC files and convert them to YOLO format:
import xml.etree.ElementTree as ET
import os
def convert_bbox(size, box):
dw = 1. / size[0]
dh = 1. / size[1]
x = (box[0] + box[1]) / 2.0
y = (box[2] + box[3]) / 2.0
w = box[1] - box[0]
h = box[3] - box[2]
return (x * dw, y * dh, w * dw, h * dh)
def convert_annotation(xml_file, classes):
tree = ET.parse(xml_file)
root = tree.getroot()
size = root.find('size')
w = int(size.find('width').text)
h = int(size.find('height').text)
output_lines = []
for obj in root.iter('object'):
cls = obj.find('name').text
if cls not in classes:
continue
cls_id = classes.index(cls)
xmlbox = obj.find('bndbox')
b = (float(xmlbox.find('xmin').text), float(xmlbox.find('xmax').text),
float(xmlbox.find('ymin').text), float(xmlbox.find('ymax').text))
bb = convert_bbox((w, h), b)
output_lines.append(f"{cls_id} " + " ".join([f"{a:.6f}" for a in bb]))
return output_lines
Adapt it as needed, loop over your XML files, and save .txt next to each image.
2. Use albumentations or ultralytics built-in utilities (if you’re already working with YOLOv5/YOLOv8 pipelines):
Some wrappers handle both image augmentations and format conversion.
Hi Peter! Thanks for the detailed reply. This is helpful.
So is this training data used only internally in Addax to tweak the included models? (I had assumed that Addax would output to YOLOv5 txt files since it was fine tuning MegaDetector and other YOLO-based models.)
If so, I assume it’s possible to combine multiple datasets that you manually annotate into a single larger training set as long as you change the folder/filename/path lines in each photos respective XML. Is that right?
So is this training data used only internally in Addax to tweak the included models? (I had assumed that Addax would output to YOLOv5 txt files since it was fine tuning MegaDetector and other YOLO-based models.)
AddaxAI doesn’t use your data for any training or model improvements - it only reads your images to make predictions. Your data remains completely on your computer, and you maintain full ownership.
While I could have implemented YOLO export functionality, I chose PASCAL VOC for better reliability and independence. Here’s why:
YOLO format relies on a separate classes.txt file that defines class names and their order. This creates potential issues when combining datasets from multiple annotation sessions - if the classes.txt files have different class definitions or orderings, you’ll get mismatched labels.
PASCAL VOC embeds all class information directly in each XML file, making it self-contained. This means you can easily merge datasets, split them, or reorganize files without worrying about class mismatches or dependencies on external configuration files.
If so, I assume it’s possible to combine multiple datasets that you manually annotate into a single larger training set as long as you change the folder/filename/path lines in each photos respective XML. Is that right?
Yes, you can absolutely combine multiple PASCAL VOC datasets into a larger training set. Since each XML file contains complete annotation information (including class names).