labelImg icon indicating copy to clipboard operation
labelImg copied to clipboard

Add IndexWrapper for yolo_io

Open shirok1 opened this issue 2 years ago • 5 comments

shirok1 avatar Apr 07 '22 09:04 shirok1

Could you provide more description about this PR? what is the issue?

tzutalin avatar Apr 15 '22 14:04 tzutalin

labelImg occasionally remove classes in class.txt (the whole line deleted), then labelImg will crash because failed to find corresponding class name from class.txt .

shirok1 avatar Apr 15 '22 15:04 shirok1

I see. I don't think the below solution is to fix the root cause. Instead of catching the index error, do you dive deeper or have other alternatives?

         try:
            result = self.content[index]
        except IndexError:
            return str(index)

Thanks

tzutalin avatar Apr 30 '22 06:04 tzutalin

Well, I think it's inefficient to use try-catch in an __gettitem__ method, which will be called in a loop. Anyway, I believe it is more important to fix the bug of deleting classes...

shirok1 avatar Apr 30 '22 11:04 shirok1

Hi @shirok1 , Thanks. Do you have an idea why/when labelImg occasionally remove classes in class.txt (the whole line deleted)? or how to reproduce it? Does it delete from memory or file? The solution probably work, but I would like to know more if there is another alternative to fix in the root ?

tzutalin avatar Apr 30 '22 16:04 tzutalin