Skip to main content

Using Google Drive Datasets

The goal of this tutorial is to use a dataset that was uploaded on Google Drive. First of all the folder must be the zip file containing the data, not be inside another folder. Then it needs to be accessible to "anyone with the link". To do so, right click on the zip folder and then click on “Get Link”.

Docs Version Dropdown

You now need to get the ID of the file, which you can get in the file link.

Finally the URL that you need to provide for the SliceX AI Trainer to work is:

'https://drive.google.com/uc?export=download&confirm=9_s_&id=' + 'FILE ID'

To check that it's working correctly, run the following code, it should download the zip file and you should be able to open it.

Checking dataset URL
import zipfile
import urllib.request

FILE_ID = 'YOUR_FILE_GOOGLE_ID'
path = 'https://drive.google.com/uc?export=download&confirm=9_s_&id=' + FILE_ID

urllib.request.urlretrieve(path, "download.zip")
with zipfile.ZipFile("download.zip", 'r') as zip_ref:
child = zip_ref.namelist()[0].split('/')[0]