Array that contains face data

I don’t understand the elements of the face data array.
for simplicity, Lets suppose we have only 1 face and we are appending only 1 image data of it in the face data array, so what will be the elements of the array?
the only thing I can figure out is that its a 3d array(bcoz of those 3 channels b g r).
The array has shape (1,100,100,3) & looks like this :-

please make me understand its elements.

hey @muditarya31 ,
Yeah you got it right it to be a 3 dimensional array as of channels.
I guess you are confused what these values are in this array.
These are pixel values of each particular pixel of that image , and as you found a single face section to be of shape 100x100x3 , hence you got the shape as such.

Let me know if you wanted to understand something else.
Thank You :slightly_smiling_face:.

  1. lets just take only 1 pixel then how is that pixel represented as an array?.
  2. Moreover, There are many 2 dimensional subarrays in this 3d array and there are,in turn, many 1d arrays in those 2d arrays as we can see in the snapshot above.
    what are these 2d and 1d arrays?
  3. in short, I know there are 30,000 pixels in total but i am not able to understand how this 3d array is representing each of them. Im not able to visualise in my mind.

hey @muditarya31 ,
Just understand that , every 3D array is combination of multiple 2D arrays and every 2D array is combination of 1D array.
So for a example a single pixel is [ 221 12 150 ] in RGB format. shape (3,)
So if you think of a color cloud then this array of RGB values will represent a particular color in that cloud. Any image is just a representation of such different colors / different pixels placed in such a matrix manner of n rows and m columns and each value of this matrix is called a pixel , a 1D array with 3 values in RGB Format.
So this matrix will be of shape ( n,m,single pixel shape ) = ( n,m,3 ) , with this you get a 3D array of an image.

I hope this helped you understand the concept, if still something is left surely ask me , don’t worry.
Thank You :slightly_smiling_face:.

1 Like

sir, so exactly how many pixels does a single 2d sub array of this 3d array contain?

for example if we assume our image to be of shape 512x256x3, then we will be having 512 2D sub arrays and each of these 512 sub arrays will contain 256 sub arrays of shape (3,) each.

based on above example we will be having 256 pixels in each 2D Sub Array.

I hope this helped you.

1 Like

perfect! thank u sir!

I hope your doubt is now resolved.
So i would request you to kindly mark this doubt as resolved and also provide your valuable feedback as it helps us to improve this platform for better learning experience.

Thank You and Happy Learning :slightly_smiling_face:.