waldo-seg / waldo

image-segmentation and text-localization
Apache License 2.0
13 stars 13 forks source link

Compressed image with mask #34

Closed danpovey closed 6 years ago

danpovey commented 6 years ago

@desh2608

Could you please work on something for us.. @YiwenShaoStephen realized that there is a big opportunity for improvement in the image_with_mask format, in terms of the size on disk.

Can you please define (in data_types.py, with a validation function) a format 'compressed_image_with_mask' which will use uint8 (from 0 to 255) for the image; and for the mask, will use uint8 if the largest object-id in the image is less than 256, and otherwise uint16?

We'll need functions to convert from image_with_mask to compressed_image_with_mask and vice versa (don't do it in-place; make the function have a return value; you can put these in data_manipulation.py).

The reason we're doing it as a separate compressed format and not a modification of the image_with_mask format is because we want to handle images with >256 objects efficiently, which means having variable types in the mask array, and we don't want the rest of the code to have to deal with different cases.

desh2608 commented 6 years ago

@danpovey Okay I'll get started on this right away.

desh2608 commented 6 years ago

Completed. https://github.com/waldo-seg/waldo/pull/36