torchxrayvision icon indicating copy to clipboard operation
torchxrayvision copied to clipboard

autoencoder input size

Open chiragnagpal opened this issue 3 years ago • 3 comments

I understand that the native autoencoder AE101 is a resnet autoencoder, but I wanted to clarify what is the expected input dimensionality for this?

is it 224x224 or 512x512 ? Also like the resnet model, if one inputs the wrong dimensionality does the model upscale it automatically?

chiragnagpal avatar Jul 01 '22 01:07 chiragnagpal

Yes it is a resnet. The shape is 224x244. I tried a 512x522 one but it didn't work well (maybe you saw that in the code somewhere?)

The pretrained model doesn't resize automatically. It would be nice but I didn't get around to it. At a minimum it should error when passed the wrong size. Sorry about that! I'll leave this open until that feature is implemented.

ieee8023 avatar Jul 01 '22 02:07 ieee8023

thanks for the super quick turn around, No problem, 224x224 actually is better for my intended application.

Another followup, all the models (Densent and autoencoders) expect the input to be single channel between [-1024, 1024] .. is that correct?

chiragnagpal avatar Jul 01 '22 02:07 chiragnagpal

Yes everything expects the same input size (single channel and [-1024,1024]. You can prepare images following this code: https://github.com/mlmed/torchxrayvision/blob/master/scripts/process_image.py

ieee8023 avatar Jul 01 '22 03:07 ieee8023

PR for raising an error if you use the image size for a set of weights done! #111

ieee8023 avatar Nov 16 '22 04:11 ieee8023