Maryam Boneh
Maryam Boneh

Reputation: 57

in labelimg, reopening the app resets classes.txt

I have a folder containing 1000 photos. And I tagged 100 photos with labelimg. In three classes: "car", "motorcycle" and "truck". But every time I open the labelimg, the previous tags are deleted from "classes.txt" and there is only the new tag that I created. And when I open the previous tagged photos in the labelimg, it gives list index out of range error and then labelimg will closed.

the error:

label = self.classes[int(class_index)]
IndexError: list index out of range

How can I have previous classes each time?

Thank you for your help🌺

Upvotes: 3

Views: 6490

Answers (2)

nadinCodeHat
nadinCodeHat

Reputation: 103

You have to give the paths for the images folder and classes.txt

If you have build from source:
python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

If you have pip installed labelImg:

labelImg [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

where:
[IMAGE_PATH] is the path to your images folder
[PRE-DEFINED CLASS FILE] is the path to the folder that has your predefined classes.txt and the annotation txt files

Example: labelImg C:\Users\LENOVO\Downloads\images C:\Users\LENOVO\Downloads\Labels\classes.txt

Upvotes: 4

Sajjad Aemmi
Sajjad Aemmi

Reputation: 2615

You can use Label Studio, it is much better than labelImg

Install the packege:

pip install -U label-studio

Lunch it!

label-studio

Upvotes: 3

Related Questions