tuliq
TuliqComputer VisionGuides
GuideUpdated Sep 12, 2026

How to Remap, Merge, and Clean Up Classes in a YOLO Dataset

Rename, merge, or remove classes across an entire YOLO dataset in one pass, with an impact preview before anything is rewritten and a corrected copy exported rather than touching the original.

A YOLO label file never stores a class name — every box references a class by numeric index, and classes.txt (or data.yaml's names list) maps that index to a name purely by position. That's fine as long as the list never changes. The moment it does — two labelers used different names for the same thing, a rarely-occurring class should fold into a broader one, a class needs removing entirely — hand-editing that list is exactly the kind of mechanical, position-dependent task a text editor makes dangerously easy to get wrong.

Why hand-editing classes.txt breaks a dataset silently

Renaming an entry in place is safe: the index at that position doesn't move, so every label file referencing it still points at the right thing. Reordering, inserting in the middle, or deleting an entry is where it breaks — every class after the changed position now has a different index than the label files still expect, and every box referencing one of those shifted indices is now labeled as something else entirely. Nothing throws an error. The dataset still loads, trains, and produces a model — it's just quietly learning the wrong labels for however many classes came after the edit.

The three actions

The YOLO Class Manager works from the same three operations regardless of how many classes a dataset has:

Seeing the impact before committing

Before anything is written, the tool counts exactly how many boxes and how many files each planned action affects — "merging 'auto' into 'car' affects 342 boxes across 178 files," or "removing 'construction-cone' affects 12 boxes across 9 files" — computed from the dataset actually loaded, not estimated. A merge or removal that turns out to affect far more (or far fewer) of the dataset than expected is worth a second look before exporting, and this is where that shows up.

Nothing is changed until you export

The plan only exists in the browser until you download the result — your original files are read, never written to, and the corrected dataset comes back as a new .zip with every label file rewritten and a new classes.txt/data.yaml alongside it. If a plan turns out wrong, nothing about your original dataset needs undoing — it was never touched.

Where each step happens

Tools mentioned in this guide

Related reading