Best way to deal with 1 channel images

Instead of filling the additional channels with zeros you could convert the grayscale image to an RGB one with Image.open('PATH').convert('RGB').
This might work in most use cases.
Alternatively, you could keep your grayscale image and add a conv layer in front of your model, which outputs 3 channels. For this approach you would need to train this layer though.

4 Likes