Cartucho / OpenLabeling

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

Draw bounding boxes based on the Darknet YOLO format #59

Closed tomasr8 closed 4 years ago

tomasr8 commented 5 years ago

Hello, we use OpenLabeling in a team of students to label image data and we use the Darknet YOLO format. Recently, I wanted to check some labeled images using this tool, but I found out that the bounding boxes use the PASCAL_VOC folder by default. Since I only have the Darknet data, the PASCAL_VOC folder gets auto-populated with empty files, meaning that no bounding boxes get shown even though I have them in the YOLO_darknet folder.

I solved this problem by simply reading the bb data from the Darknet folder, but I thought we could maybe add a switch somewhere in the code that would draw bounding boxes from the YOLO_darknet folder in case the PASCAL_VOC folder does not exist. What do you think about this? I could submit a PR if you're interested.

Cartucho commented 5 years ago

Oh yeah, that would be great!

Ideally, the code would check if the two folders have the same bounding boxes or not. And if not it should create the appropriate file instead of creating an empty one.

Anyway, I agree with you! We should have an argsparse parameter where one can set if they want to draw from PASCAL_VOC or from YOLO_darknet.

tomasr8 commented 5 years ago

Awesome! What name should the parameter have? Something like --draw-dir or maybe --bbox-dir?

Cartucho commented 5 years ago

--dar-dir is more clear about what it does in my opinion

enesyuceyurt commented 5 years ago

Hello, we use OpenLabeling in a team of students to label image data and we use the Darknet YOLO format. Recently, I wanted to check some labeled images using this tool, but I found out that the bounding boxes use the PASCAL_VOC folder by default. Since I only have the Darknet data, the PASCAL_VOC folder gets auto-populated with empty files, meaning that no bounding boxes get shown even though I have them in the YOLO_darknet folder.

I solved this problem by simply reading the bb data from the Darknet folder, but I thought we could maybe add a switch somewhere in the code that would draw bounding boxes from the YOLO_darknet folder in case the PASCAL_VOC folder does not exist. What do you think about this? I could submit a PR if you're interested.

Could you give more explanations on how you do this? Maybe a sample code? I tried to change the function draw_bboxes_from_file but I am having a lot of problems.

Cartucho commented 5 years ago

@tomasr8 any update on this?