how to import image to google colab code example
Example: how to import image to google colab
Try this instead.
from io import BytesIO
uploaded = files.upload()
im = Image.open(BytesIO(uploaded['test.png']))
This is because the upload() command doesn't save the file. It stores the content in uploaded dictionary.
Or you can this use this function to upload files. It will both upload and save them.
def upload_files():
from google.colab import files
uploaded = files.upload()
for k, v in uploaded.items():
open(k, 'wb').write(v)
return list(uploaded.keys())