load image dataset (folder or zip) located in Google Drive to Google Colab?

前端 未结 3 697
礼貌的吻别
礼貌的吻别 2020-12-29 10:36

I have a dataset of images on my Google Drive. I have this dataset both in a compressed .zip version and an uncompressed folder.

I want to train a CNN using Google C

3条回答
  •  离开以前
    2020-12-29 11:16

    Other answers are excellent, but they require everytime to authenticate in Google Drive, that is not very comfortable if you want to run top down your notebook.

    I had the same need, I wanted to download a single zip file containing dataset from Drive to Colab. I preferred to get shareable link of that file and run following cell (substitute drive_url with your shared link):

    import urllib
    
    drive_url = 'https://drive.google.com/uc?export=download&id=1fBVMX66SlvrYa0oIau1lxt1_Vy-XYZWG'
    file_name = 'downloaded.zip'
    
    urllib.request.urlretrieve(drive_url, file_name)
    print('Download completed!')
    

提交回复
热议问题