ivadomed / model_sc_centerline

Repository for automated spinal cord centerline detection using deep learning
MIT License
2 stars 0 forks source link

Remove CenterCrop during testing #1

Open naga-karthik opened 1 year ago

naga-karthik commented 1 year ago

As suggested in this comment, the CenterCrop parameters used during training might not work for test images as some might be larger than that. To avoid this, it is best to remove center cropping for testing and check if we still get good predictions.

TODO:

naga-karthik commented 1 year ago

It appears that CenterCrop must be used during inference, because without it, we run into this RuntimeError. This is because for inputs with variable sizes, we cannot evenly divide the input volume into multiple sub-volumes hence raising this error.

I expected this error because dealing with variable input sizes during testing is a common problem and CenterCrop is essentially used to make sure that all inputs are uniformly-sized before feeding it to the model for inference.

jcohenadad commented 1 year ago

It appears that CenterCrop must be used during inference

Not necessarily. We've successfully explored inputting larger images at test time, see for example:

Additional digging would be welcome.