3

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

Maryam Boneh
  • 59
  • 1
  • 6

2 Answers2

3

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

Install the packege:

pip install -U label-studio

Lunch it!

label-studio
Sajjad Aemmi
  • 2,120
  • 3
  • 13
  • 25
3

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

nadinCodeHat
  • 83
  • 1
  • 7