Is anyone able to load segmentation masks computed through run-length-encoding, or some function besides reading from disk? FastAI v1 used to have this. It looks like fastai v2 only supports reading seg-masks.
I tried adapting the old RLE code to a label function, but it needs to read from a dataframe to get the encoding, it’s not obvious how to write a get_y
function that’ll look at filename and a CSV. For reference, the v2 docs for high-level and datablock APIs, as well as the walk-with-fastai segmentation example all use functions that read from disk.
My first thought was maybe there’s a way to use .from_df
: take ColReader
and pass its output to a label function for get_y
?
Or would the correct way be to create a modified from_df
method?
SegmentationDataLoaders
does have a .from_label_func
method, but that’d require loading a CSV as dataframe for each label, so that’s out of the question. So maybe what’s needed is a combined .from_label_func
/ .from_df
kind of method.
Why it’s important: as things are you’re potentially doubling the size of your dataset to store segmentation labels.