Introduces a new class TiledMaskHandler for handing mask loading and exporting calls. Currently this includes some legacy file-based code to be removed in the future.
With that new class, seperates data access into input data, masks, and segmentation results (all of which may live on different Tiled servers)
Pixelated masks are written to Tiled under MASK_TILED_URI + /USER_NAME/project_name/annotation_hash. This uri holds the meta data and an additional mask child contains the actual pixelated mask. This was original done to support writing annotations meta data for loading, without having to write pixelated masks. The writing happens upon job submission for model training.
To avoid writing the same mask again (e.g. if no changes have been made to the mask and the user only wants to run a different model), the key under which the mask is saved is a hash of the annotation meta-data (annotation classes with their names and colors, and annotation shapes)
Resolves #169 by generating a color map from the current set of classes and colors. Note, if the number of classes changed between result writing and visualization, this can lead to inconsistencies. We may choose to instead use the metadata from writing masks in the future.
Adds a script examples/plot_mask.py to save a colored mask slice based on meta-data. This function could be used to generate a sample image for SciCat.
An example for mask meta data with two annotated slices containing some rectangles and a freeform is given below.
This PR makes the following changes:
TiledMaskHandler
for handing mask loading and exporting calls. Currently this includes some legacy file-based code to be removed in the future.MASK_TILED_URI
+/USER_NAME/project_name/annotation_hash
. This uri holds the meta data and an additionalmask
child contains the actual pixelated mask. This was original done to support writing annotations meta data for loading, without having to write pixelated masks. The writing happens upon job submission for model training.examples/plot_mask.py
to save a colored mask slice based on meta-data. This function could be used to generate a sample image for SciCat.An example for mask meta data with two annotated slices containing some rectangles and a freeform is given below.
with the second exported colored slice as
This partially resolves #160, but annotation export still relies on files.