jveitchmichaelis / deeplabel

A cross-platform desktop image annotation tool for machine learning
205 stars 39 forks source link

src/darknetexporter.cpp: Do not write empty rectangles #8

Closed andviane closed 4 years ago

andviane commented 4 years ago

I have observed lines with 0 0 0 0 as the location of rectangle in files, exported for the DarkNet. A zero area label does not make any sense and may crash machine learning tools downstream. The provided patch that I use discards zeros from the output.

jveitchmichaelis commented 4 years ago

Thanks, I'll take a look at this - possibly this is a regression as we saw this problem before and I seem remember fixing it somewhere else.

jveitchmichaelis commented 4 years ago

It think it would be better to fix this at source, eg in the LabelProject class so that you can't store a zero area box in the first place? If it still occurs then maybe it's coming from somewhere else. Otherwise we have to make this fix for every exporter and importer.

Trying to figure out where this comes from too, have you been using box tracker?

andviane commented 4 years ago

No, I was only using mouse and keyboard to draw the annotation rectangles. I agree best place is to prevent writing such data into the database, so maybe should be fixed somewhere else.

andviane commented 4 years ago

While this patch is definitely better than to make everyone to write a Python script for data fixup, I agree it may be better to fix where it is created or written. Please consider this as a bug report then.

jveitchmichaelis commented 4 years ago

Should be fixed going forward: https://github.com/jveitchmichaelis/deeplabel/commit/ecc24c5d6c36818f6ab29c4817a4b045dc25c5c8