Loading images in google colab

后端 未结 11 1833
梦如初夏
梦如初夏 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:47

    after you uploaded it to your notebook, do this

    import cv2
    import numpy as np
    from google.colab.patches import cv2_imshow
    
    img = cv2.imread('./your image file.jpg')
    cv2_imshow(img)
    cv2.waitKey()
    

提交回复
热议问题