From the course: Advanced AI: Transformers for Computer Vision

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

A transformed image

A transformed image

- [Instructor] Unlike many other machine learning problems one of the best things about working with computer vision problems is that you can see changes to the data for yourself. So now that we've created these image, train, and validation pipelines, let's see whether an image looks any different when applying a train transformation or a validation transformation. So let's take a sample image. And this is an image of tulips, and let's go ahead and run the next cell and we should get an error. Now, the reason we get an error is because the PyTorch tensors has its tensors in a certain format. So it's the number of channels followed by the number of rows, and then the columns. While as a matplotlib, which is our plotting library, expects the images with first, the number of rows, then the number of columns, and finally the number of channels. So we can rejig the format of our PyTorch tensors by using the permute…

Contents