it’s hard to share my exact code because I have a bunch of custom stuff for 3D volumes, but as an example we could take:
which is doing 2D segmentation.
In the dataset section, my code is similar to
src = (SegmentationItemList.from_folder(path_img)
after that line you can see that fastai is calling his own transform
data = (src.transform(get_transforms(), size=size, tfm_y=True)
I’d like to call torchio instead.
_rndaffine = RandomAffine(scales=(0.9, 1.1), degrees=10)
rndaffine = Transform(_rndaffine)
but it doesn’t work because fastai seems to be expecting a callable with
~/Documents/Dev/miniconda3/envs/fastai10/lib/python3.7/site-packages/fastai/vision/image.py in __init__(self, func, order)
458 if order is not None: self.order=order
--> 460 self.func.__name__ = func.__name__[1:] #To remove the _ that begins every transform function.
461 functools.update_wrapper(self, self.func)
462 self.func.__annotations__['return'] = Image
AttributeError: 'RandomAffine' object has no attribute '__name__'
Also, I dont think parse_sample() from torchio is going to be compatible with fastai code?