File size: 195 Bytes
c3b7cfb
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
from PIL import Image

# Open the image
image = Image.open('uploads/B0001_rgb.jpg')

# Get the number of channels
num_channels = len(image.getbands())

print("Number of channels:", num_channels)