Loading images in google colab

后端 未结 11 1735
梦如初夏
梦如初夏 2021-01-30 15:01

My Jupyter Notebook has the following code to upload an image to Colab:

from google.colab import files
uploaded = files.upload()

I get prompted

11条回答
  •  遇见更好的自我
    2021-01-30 15:41

    from deepface import DeepFace
    import cv2
    import matplotlib.pyplot as plt
    
    from google.colab import files
    from io import BytesIO
    from PIL import Image
    
    uploaded = files.upload()
    
    
    next line
    
    # im = Image.open(BytesIO(uploaded['img.PNG']))
    img = cv2.imread("theCorona.PNG")
    plt.imshow(img[:,:, ::-1])
    plt.show()
    

提交回复
热议问题