How to work with 4+ channel images in fastai_v1

These are two examples of how to deal with multiple channels images (both based on human atlas competition):

The current version of data block api is very simple to customize: my code that use 4+ channel images is:

...
class MultiChannelImageItemList(ImageItemList):
    def open(self, fn):
        return openMultiChannelImage(fn)

...

il = MultiChannelImageItemList.from_df(path=path, df=train_data_and_labels_df, cols=x_cols)
ils = il.random_split_by_pct()

...

Of course you’ve to adapt your model to accept 4+ channels images…

7 Likes