labelImg icon indicating copy to clipboard operation
labelImg copied to clipboard

Saving Yolo labels, corrupts classes.txt

Open LukeAI opened this issue 5 years ago • 6 comments

Trying to save labels in Yolo format corrupts classes.txt

To reproduce:

Run labelImg in the docker as described in the readme I check classes.txt (coco - so 80 lines) it is correct. I use "Open Dir" to open my directory of images and Yolo labels (1.png, 1.txt, 2.png, 2.txt) I click the tickbox on an incorrect label to drop the bounding box. I click 'Next Image' and then 'Prev Image' and note that my change has not persisted. (Do I have to manually save every individual change one at a time?) I make my change, click "save as" => "save" => "yes" to overwrite the original label file. The terminal output confirms that the annotation has been saved. I check "classes.txt" and find that it has been overwritten with a seemingly random subset of the original labels, this means all sorts of weird stuff happens to the annotations later on. but all of that weirdness can be traced back to this. (16 in total, they are mostly not labels that appear in my data).

This is surely a bug? If needed I can provide some specific data to reproduce.

Ideally, my workflow would be: Open directory of images and labels click through all images, editing labels after reviewing all images, click "save all changes" and have all labels be updated at the same time without me having to go through and save every individual change.

Is this possible? If not in Yolo, is it possible in VOC?

LukeAI avatar Apr 18 '19 10:04 LukeAI

before corruption, classes.txt contains: https://github.com/pjreddie/darknet/blob/master/data/coco.names After corruption it is: classes.txt

LukeAI avatar Apr 18 '19 10:04 LukeAI

edit data/pre...txt file

jamessmith90 avatar Oct 01 '19 12:10 jamessmith90

I have the save problem

dorbodwolf avatar Dec 19 '20 01:12 dorbodwolf

I have this same issue now. Very frustrating that this always occurs when trying to label with multiple classes in YOLO format.

christianepedersen avatar Feb 24 '22 19:02 christianepedersen

Same happens to me

cagatayp0 avatar Jul 23 '22 13:07 cagatayp0

Bump

Interpause avatar Sep 12 '22 07:09 Interpause