← Computer vision
Lesson 1 of 4
Image basics
Watch, read the card, then practise. Pixels and channels · Preparing images
The video for this lesson is being recorded.
Meanwhile, the notes below and the 60-second cards cover the same ideas.
Practise this topicPixels and channels
An image is a grid of pixels. A colour image has 3 channels (red, green, blue), each 0 to 255.
Remember: Height comes first in the shape, then width.
Preparing images
Before training, images are resized to one size and their pixel values scaled.
Remember: Prepare images at prediction time exactly as in training.
Try the example in Code Lab
import numpy as np img = np.zeros((224, 224, 3), dtype=np.uint8) print(img.shape, img.size)