Get startedGet started for free

RGB, grayscale, or alpha?

Your team obtained a new image dataset for training. Before designing a model, you want to check if the images are RGB, grayscale, or with a transparency alpha channel. Assuming all the images in the dataset are the same, you only need to check one sample image.

The torchvision.transforms.functional module has been imported as F. The sample image to check has been loaded as image.

What kind of images does the dataset consist of?

This exercise is part of the course

Deep Learning for Images with PyTorch

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise