fastai unet from binary data rather than files?
perdigao1 opened this issue · 0 comments
perdigao1 commented
Hi,
I was wondering if it possible to run unet image segmentation training in fastai.
All the code I have found sets up fastai with 2D files of data and labels. For my particular application I would like to avoid creation of PNG file images with 3 channels, and just use a numpy style 2D array for each image, essentially greyscale.
There appears to be two potiential routes:
- subclass Dataset class, and create two objects for train (data and segmentation) and validation (data and segmentation). Then
DataBunch.create(train_ads, validation_ads)
and use this databunch to create the unet. See example in a googlecolab here.
Although the unet seems to be successfully created, the learn() function fails, not sure why
- subclass ItemBase and ItemList. I have made some attempts but the fastai code seems to rely a lot in the usage of paths in for ItemList. Instructions do not seem to be sufficient. In particular the issue is about linking the data with the respective segmentations. User can define a class for the labels. What this means is not very clear but it probably tries the open function in it, with some pathname parameters. As such databunch() function fails, and this is needed to setup unet.
Any help is appreciated.
Regards
L