you can print the type() of variables that you have and understand which variable holds the input PIL and then pass it to transform. Also, please read up more on python programming and different data types. That might help.