Hello,
I am currently working on the following notebook.
While creating a DataBlock, I wanted to add the resize the TensorImages (very last part of the notebook):
db = DataBlock(blocks=(TransformBlock(type_tfms=partial(MSTensorImage.create, chnls_first=True),
item_tfms=Resize(100)),
TransformBlock(type_tfms=[get_lbl_fn, partial(open_npy, cls=TensorMask)],
item_tfms=[Resize(100), AddMaskCodes(codes=['clear', 'water', 'shadow'])]),
),
get_items=partial(get_files, extensions='.npy'),
splitter=RandomSplitter(valid_pct=0.1)
)
In the end I would expect my TensorImage objects to be resized to 100x100.
However, if I print out the summary db.summary(source=imgs_path)
, I see that the image size before and after the resize stays the same:
(MSTensorImage of size 13x366x366, TensorMask of size 366x366)
applying Resize -- {'size': (100, 100), 'method': 'crop', 'pad_mode': 'reflection', 'resamples': (2, 0), 'p': 1.0} gives
(MSTensorImage of size 13x366x366, TensorMask of size 366x366)
Basically, 366x366 before and 366x366 after.
There I have two questions:
- Why doesn’t it resize?
- How to resize?
Thank you!