BoundingBoxEditor icon indicating copy to clipboard operation
BoundingBoxEditor copied to clipboard

CSV export strategy for Rectangle annotations

Open kaiwinter opened this issue 2 months ago • 4 comments

While I was following this guide I needed BoundingBoxEditor to export the annotations to a CSV file. As the format is pretty specific, I'm not sure if it may be a good addition for this project. But maybe it can be extended to be more flexible in the future. The exporter can only export Rectangle annotations.

What do you think, can this be merged?

I introduced two new dependencies: OpenCSV for writing the CSV file and Jimfs for the unit tests.

kaiwinter avatar Mar 14 '24 21:03 kaiwinter

Hi Kai! This seems to be an ultra-specific CSV annotation format for this particular dataset that isn't used anywhere (?) else. Imho this makes its usefullness very limited.

In a quick search I could find a "Tensorflow Object Detection CSV format" (e.g. here, basically: filename,width,height,class,xmin,ymin,xmax,ymax) that seems to be similar and at least more commonly used (as an intermediate format for Tensorflow's TFRecord). I think this format would be more useful as the "CSV"-export format and it would be trivial to "transform" it into your particular format (filename->name, class->label).

I'd still say we can merge your PR for now and I'll change it to the Tensorflow format in a separate PR later on.

mfl28 avatar Mar 15 '24 18:03 mfl28

Can you run the LicenseFormat Gradle task on your updated branch and push the changes? Some of your new files have missing headers which results in the CI error.

mfl28 avatar Mar 15 '24 18:03 mfl28

Done that. Wow, I didn't know that the CSV format was SO special. That was just a brief excursion into this topic for me.

kaiwinter avatar Mar 15 '24 19:03 kaiwinter

Codecov Report

Attention: Patch coverage is 78.94737% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 86.41%. Comparing base (f7f1d14) to head (917c6f1).

Files Patch % Lines
...mfl28/boundingboxeditor/controller/Controller.java 0.00% 3 Missing :warning:
...28/boundingboxeditor/model/io/CSVSaveStrategy.java 92.30% 2 Missing :warning:
...oxeditor/model/io/ImageAnnotationSaveStrategy.java 50.00% 2 Missing :warning:
...github/mfl28/boundingboxeditor/ui/MenuBarView.java 80.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #122      +/-   ##
============================================
- Coverage     86.46%   86.41%   -0.06%     
- Complexity     1480     1486       +6     
============================================
  Files            95       96       +1     
  Lines          5933     5970      +37     
  Branches        534      540       +6     
============================================
+ Hits           5130     5159      +29     
- Misses          527      535       +8     
  Partials        276      276              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 19 '24 17:03 codecov[bot]