HumanSignal / label-studio-sdk

Label Studio SDK
https://api.labelstud.io
77 stars 50 forks source link

feat: Export brush label masks with matching file base name #254

Open PhillipRDI opened 1 week ago

PhillipRDI commented 1 week ago

…nd masks with base filenames that match images

Previously it was impossible with the exported ZIP file to utilize exported brush data. It was not possible to determine with the mask filename which mask corresponded to which original image you uploaded.

The proposed change exports 2 folders: images and masks. The images folder simply contains the original images with filename manipulations done by Label Studio. The masks folder contains masks according to IMAGEBASE-CLASS-SEQUENCE.png where the original image is just IMAGEBASE.IMAGEXTENSION.

You could potentially work around this issue with multiple exports including (1) Brush Labels to PNG, (2) JSON, and (3) YOLO. You'd have to copy the images from the YOLO export and then write a JSON parser to figure out which original image maps to which annotation in the JSON file. This seemed overly complicated and also inefficient since there's encoded masks in the JSON already.