You've got a dataset labeled in one format and a training script that expects another — a COCO-trained pipeline that needs YOLO's per-image .txt files, or a Pascal VOC dataset you're moving into a COCO-based framework. This is a mechanical conversion, not a re-annotation, but a few details decide whether it's correct or just technically-valid.
What you need before converting
Two of the three formats — COCO and Pascal VOC — are self-contained: each file already declares the image's pixel width and height alongside the boxes. YOLO is the exception. Its coordinates are normalized to a 0–1 fraction of the image, and the .txt file never records the image's actual size anywhere. So the moment YOLO is on either side of a conversion and the other side isn't also YOLO, you need that pixel size supplied from somewhere else — the Bounding Box Converter asks for it directly rather than guessing or silently producing boxes in the wrong place.
You'll also want your class list in hand if YOLO is involved. YOLO stores classes as plain numeric indices (0, 1, 2...) with the actual names living in a separate classes.txt, index-ordered — COCO and Pascal VOC both store real class names directly in the file. Converting from YOLO needs that list to resolve indices back to names; converting to YOLO needs it to assign the indices in the first place.
Converting to or from YOLO
Take a single YOLO line:
0 0.5 0.5 0.2 0.3
That's class index 0, a box centered at 50% of the image's width and height, spanning 20% of the width and 30% of the height. On a 1000×800px image, that resolves to a 200×240px box centered at (500, 400) — top-left corner at (400, 280).
To convert it: upload the .txt file to the Bounding Box Converter, enter the image's width and height (1000 and 800, in this case), add your class names in index order, and pick COCO or Pascal VOC as the output. The tool does the coordinate math for you and shows the region count before you download.
Going the other way — COCO or Pascal VOC into YOLO — works the same way, and produces two files: the .txt itself, plus a classes.txt companion, since YOLO's .txt format has no field for class names at all. Both are offered as separate downloads, matching how a real YOLO dataset expects them laid out.
Converting between COCO and Pascal VOC directly
This direction is simpler, because neither format needs anything supplied — both already declare the image's pixel size and store class names by their real value, not an index. Upload the file, pick the other format, download. There's no dimensions prompt because there's nothing missing to ask for.
What doesn't survive the conversion
YOLO, COCO, and Pascal VOC all understand exactly one shape: the rectangle. If your source file only ever had rectangles — true for most YOLO and Pascal VOC datasets, and for COCO files built around bounding-box annotation — every region converts cleanly and nothing is lost.
Where this matters is a source annotated with richer shapes (VIA CSV's circles, ellipses, and polygons, for instance): a circle or polygon converting into YOLO, COCO, or Pascal VOC becomes its bounding box — the smallest rectangle that contains it — and a point or polyline has no bounding box at all, so it's dropped entirely rather than exported as a meaningless zero-size or line-thin "box." The Bounding Box Converter always shows exactly how many regions were skipped before you download, so this shows up as a number you see, not a silent gap you discover later.
Converting a whole dataset at once
Everything above is one file at a time. If you're converting an entire dataset folder — hundreds of images and their labels together, not a single .txt — the YOLO Dataset Converter does the same YOLO↔COCO/Pascal VOC conversion in one batch. Since it decodes each image directly, it never needs a width/height typed in by hand the way a single-file conversion does, and it preserves an existing train/val/test split structure in the output.
Confirming the conversion actually worked
A conversion that completes without an error message isn't the same as one that produced correct boxes — a flipped width/height, a coordinate system mix-up, or an off-by-one class index all produce a technically-valid file that's still wrong. The next step is rendering the result on top of its images and looking at it, covered in how to visually verify annotations before training.
Where each step happens
- Converting one file — the Bounding Box Converter handles all twelve directions between YOLO, COCO, Pascal VOC, and VIA CSV, asking for image dimensions only when the conversion actually needs them.
- Converting a whole dataset folder — the YOLO Dataset Converter does the same YOLO↔COCO/Pascal VOC conversion across an entire dataset in one batch, decoding images directly instead of asking for dimensions.
- Checking the result — the Annotation Visualizer draws the converted boxes back on your images so a bad conversion is visible immediately.
- Starting from scratch instead — if you don't have a source annotation file at all yet, the Image Annotator lets you draw and export directly in any of the four formats.