Hey, what exactly is the error you are facing. Looks like you have the input images as an array. Dont see any problem there. If your data is too big to have it loaded into one array. You could loops over the path and load one at a time.
This works and you are predicting one at a time.

You could also just pass the whole array of dim [n_samples, n_channels, height, width] if data fits into memory or iterate over few samples at one.
or just write a dataset and dataloader, and change batchsize to load and compute many samples at once efficiently.

I hope this answers