HumanSignal / labelImg

LabelImg is now part of the Label Studio community. The popular image annotation tool created by Tzutalin is no longer actively being developed, but you can check out Label Studio, the open source data labeling tool for images, text, hypertext, audio, video and time-series data.
https://youtu.be/p0nR2YsCY_U
MIT License
22.77k stars 6.31k forks source link

All files saved with the extension ".xml.xml" #252

Closed benguyer closed 6 years ago

benguyer commented 6 years ago

Hi, small usability issue here. When I save annotation files, they are given the file extension ".xml.xml", so saving "foo" would result in "foo.xml.xml". This results in the images not automatically loading their annotations. This is easily fixed by renaming the files.

sglvladi commented 6 years ago

I can confirm coming across the same issue on Windows 10, using python 3.6 and Qt4.

lechatthecat commented 6 years ago

Linux mint 64bit, python3.5, same problem.

lechatthecat commented 6 years ago

Seems like, if the mode is YOLO, the file is saved as filename.xml.txt.

benguyer commented 6 years ago

I was able to fix this problem for my use case by commenting out line 759 in labelImg.py, "annotationFilePath += XML_EXT"

I'm not sure whether this will work for everyone though. There appears to be another bug that causes the opposite behavior -- files get saved without any extension #256.

sglvladi commented 6 years ago

@benguyer, I tried reverse-engineering the code and reached the conclusion that I don't want to mess with it.

What worked for me was to Change the default saved annotation folder by clicking the respective menu button on the left.

I do this every time I start a new labelImg session and haven't had the same issue since.

Hope it helps.

Git-David commented 6 years ago

I wrote a little python script to remove the extra '.xml'. paste the code into a empty .py file say 'tool.py', and put this tool.py file in the same folder of your .xml.xml files, and run the script from a command line: python tool.py, problem solved! feel free to try :) @benguyer @sglvladi @lechatthecat @xblaster @rflynn

import os for file in os.listdir("."): if file.endswith(".xml.xml"): os.rename(file,file[:-4])

CHLAI0410 commented 6 years ago

Mac osX High Siera here having same issue, the file first saved with double extension, then normal one if you saved again. The issue usually pop up if the dialog for file name input came out.

Hope this helps. ps:It's ok to not fixing it. The extension can be changed manually anyway.

vdalv commented 6 years ago

This issue should be fixed now. Please download the latest release or code and let us know if you continue to experience it.

Thanks,

-Vlad

kalavathi007 commented 1 year ago

Change Pascal voc to yolo mode in labelImg window. (Pascal vo files will save in .xml, yolo annotation files in .txt