I've been experimenting on MedMNIST data and I noticed that the default loader produces 28x28x3 images. I wanted to resize all images via cv2 to 32x32x3 I previously tried this method but my CNN models fail to achieve good accuracy.
def regen(generate):
for i, j in generate:
a= np.zeros((64, 32, 32, 3))
a[:,2:30,2:30,:]=i
b = a/255
yield b, j
Here is a link to the original dataset https://medmnist.com/