So let's move forward and visualize the data we have.
So here I'm visualizing some of the traffic signs from the dataset.
And let's see how it looks.
So here are some of the images from the dataset.
And as you can see here, the dimension of the images are not the same for all the images, so as the
size of the images are different, we have to make them equal.
So we will take the mean of these images here.
I'm finding out the meaning of these images.
So if you can see, we already know that there are 43 glasses in this graphic same dataset, so I'm
running a our loop from zero to 40.
That is 40 glasses.
And I'll take each image and find out the meaning of that image, Dimension one and Dimension two.
And we distorted.
Let's run this and store that dimension of these images to find out the mean of these images.
It's running right now.
So we have stored this.
Next, we will find out that many of these dimensions and print them out.
So here we can see that 50 by 50 is the average ship for all the majors.
Here we can see that the damage and one win is fifty point three to Andamans I two minutes 23.
So we can conclude that 50 50 is the average ship.
Now we will convert all these images into this ship 50 by 50.
For that, I'm using images, an empty list.
Also, our neighbor lady is an activist and we ship all these images and also still in the early label.
And for this, we have we are running a for loop here for 43 classes and storing all the images, resizing
them and also their IDs.
Also Mr Anderson and convert these images or resize these images into the desired dimensions that is
50 by 50.
And also storing that, ladies, when it's done.
So the next step would be to convert these images into number edit and also to normalize them.
So in order to normalize an image, we will divide it by 255 because the pixel value of each image ranges
from zero to 255.
So we'll divide each image by two fifty five to normalize them and to convert them into edit will simply
use the function.
And if we don't edit, so let's run this in, and the converter image isn't to no edit and normalize
them.
So it's done.
Similarly, we'll store the label, I listen to no edit and we'll see the shape of it.
So here we can observe that there are three nine two zero nine zero ladies.
Similarly, will print the shape of the images.
So here we can see that there are three nine two zero nine images with a shape of fifty two fifty to
three.
So here three is the channel, which means that their color images and AGP format.
Let's move forward now will visualize the number of the glasses.
To find out if the data is unbalanced or not.
So here we can see that it is around twenty two hundred in each class, so we can see that the data
is not imbalanced.
That is balanced.
We do not need to balance the data.
Data is already balanced.
Now we'll split that data using the best transmit.
Into a ratio of 80 percent.
Training data and 20 percent validation data.
Similarly, will convert the training data that will convert that label, that is which class it belongs
to and do not encoding using two categorical function.
So why not encoding is important because if we don't apply, one not including the machine will prioritize
it.
So to avoid prioritization, we apply AV1 encoding, so we'll apply.
We're not encoding on the training and the validation data.
The target variable that is Weitering categorical and viral categorical it.