showgan's picture
Training in progress, step 1000
09b13b3 verified
|
raw
history blame
1.57 kB

🤗 Upload custom image dataset to the hub

This directory contains an example script that showcases how to upload a custom image dataset to the hub programmatically (using Python).

In this example, we'll upload all available datasets shared by the CycleGAN authors to the hub.

It leverages the ImageFolder and push_to_hub functionalities of the 🤗 Datasets library.

It can be run as follows:

1. Make sure to have git-LFS installed on your system:

First, verify that you have git-LFS installed. This can be done by running:

git-lfs -v

If you get "command not found", then install it as follows:

sudo apt-get install git-lfs

2. Login with your HuggingFace account:

Next, one needs to provide a token for authentication with the hub. This can be done by either running:

huggingface-cli login

or

from huggingface_hub import notebook_login

notebook_login()

in case you're running in a notebook.

3. Upload!

Finally, uploading is as easy as:

python push_to_hub_example.py --dataset horse2zebra

The result can be seen here.

Note that it's not required to programmatically upload a dataset to the hub: you can also do it in your browser as explained in this guide.