It looks like the channel dimension is missing in your input.
Could it be you’re loading a grayscale image?
If so, try to load your image as an RGB image using:
image = Image.open(imagepath).convert('RGB')