Solved by vmirly1 in post #6 
              
              
                I assumed np_arr is just one image, not the entire dataset. Then, you would need to iterate through np_arr to get each image, convert them to image using Image.fromarray() and then apply the transformations on that image. 

Everytime __getitem__ is called, a random transformation will be performed …