Instead of using the command line interface (i.e. predict script), I'm trying to write a script that constructs a model, loads checkpoint, and make predictions so that I can do custom operation on the network output and data saving. I'm following through https://github.com/DeepRegNet/DeepReg/blob/main/deepreg/predict.py, but I'm stuck with making inputs to the model (e.g. input argument to the function call model.predict()
I was thinking that the inputs would be simply a dictionary containing fixed and moving image tensors, but that seems to be not the case. Would you be able to point me to an example of how to construct an input to the model? Sorry these might be basic questions, but your help would be appreciated since I've only used pytorch before.
why does the predict function need batch_size as an argument (i.e. shouldn't the model be able to infer it from the input tensor)? can this be changed dynamically? I suppose this could be different from the batch size used in training?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
custom data loading for prediction
First, thanks for building this amazing package!
Instead of using the command line interface (i.e. predict script), I'm trying to write a script that constructs a model, loads checkpoint, and make predictions so that I can do custom operation on the network output and data saving. I'm following through https://github.com/DeepRegNet/DeepReg/blob/main/deepreg/predict.py, but I'm stuck with making inputs to the model (e.g. input argument to the function call
model.predict()
I was thinking that the
inputs
would be simply a dictionary containing fixed and moving image tensors, but that seems to be not the case. Would you be able to point me to an example of how to construct an input to the model? Sorry these might be basic questions, but your help would be appreciated since I've only used pytorch before.Also, I was looking at the predict section:
indices
supposed to be?