Cartucho / OpenLabeling

Label images and video for Computer Vision applications
Apache License 2.0
926 stars 265 forks source link

Add VOC format #6

Closed MattKleinsmith closed 6 years ago

MattKleinsmith commented 6 years ago

YOLO is the default and python run.py will still work normally.

To enable VOC: python run.py --format voc

Users will likely have to further process the bounding box text files to match their pipeline, but this should make it easier for them, since they won't have to undo YOLO normalization.

Cartucho commented 6 years ago

@MattKleinsmith Cool! According to the VOC official documentation "The top-left pixel in the image has coordinates (1, 1)." Do you think we should take this in consideration?

screenshot from 2018-02-16 13-16-03

MattKleinsmith commented 6 years ago

Whoa, nice catch. Yeah, we might as well add 1 to each coordinate. I'll make the change now.

MattKleinsmith commented 6 years ago

I should see if popular VOC pipelines don't also account for this, so we don't end up adding two. It would be funny if each part of the community added one and we ended up with +5 (well, only funny if we found out before bad stuff happened).

Cartucho commented 6 years ago

@MattKleinsmith Ahah it's true! It's a very specific detail, anyway it shouldn't make a huge difference since it's only 1 pixel. My guess is that most people ignore it / don't know about it.

MattKleinsmith commented 6 years ago

I looked at ChainerCV's pipeline and didn't see anything. I don't think training pipelines would be concerned with it either since they're not creating labels.

At your new comment: I agree. I think a one-pixel difference is more precise than the eyes of people creating bounding boxes (e.g. me).

MattKleinsmith commented 6 years ago

Adding this commit has a danger: the user must click the top left point first, otherwise their label will be malformed silently. This danger isn't there for the YOLO format.

Do you know where in the code we can make sure point_1 is the top left point, and if not, swap it with point_2? I'm not sure how the callbacks work yet.

Cartucho commented 6 years ago

@MattKleinsmith When we save the bbox save_bb() if the VOC option is select it should save in the order: x_min, y_min, x_max, y_max

I will try your code now

MattKleinsmith commented 6 years ago

There's a merge conflict. I'm willing to resolve the conflict but I need to know that there won't be another merge conflict waiting for me.

We can probably split run.py into modules to reduce the number of merge conflicts in the future.

Cartucho commented 6 years ago

@MattKleinsmith Sorry for the conflict, next time I will merge the code first. Splitting run would be pretty useful, making the code more clear.

MattKleinsmith commented 6 years ago

A fresh pull request: https://github.com/Cartucho/yolo-boundingbox-labeler-GUI/pull/8

I made a fresh pull request so that only my changes are highlighted.