DVC offers git-like experience to track your datasets. DVC allows tracked the dataset to be uploaded to a various storage systems also known as "remotes".
We are using DagsHub (which in turn uses S3) as a remote for our DVC. DagsHub is a platform that allows data scientists and ML developers to manage and collaborate on data, models and experiments.
To use DVC with DagsHub, we have to setup the credentials related to DVC remote. This helps DVC know where to store and version the datasets.
The GIF below shows the required credentials to be setup locally. Run the commands at the root of the project corresponding to the Add a DagsHub DVC remote and Setup credentials sections.
If the DVC authentication is setup correctly, downloading dataset from DagsHub is as easy as running the following command.
dvc pull -r originWe can also pull a particular dataset. For example, we run the following command to pull only the training_dataset from DagsHub using DVC.
dvc pull -r origin training_dataWe follow a particular workflow to upload and version our datasets to the DagsHub repository.
- Create a new branch using git.
- Track the dataset to be versioned using
dvc addcommand. - Add a clear git commit message related to this new data version.
- Push the data to remote using
dvc push -r origincommand. - Similarly, track the new
.dvcfolder usinggit push origin <branch_name>command.
Raw Dataset: For steps required to push raw dataset from Jetson device to DagsHub, refer to the step 5 Upload benchmark data to DagsHub from Jetson from the current working directory in the jetson readme.
Training Dataset: For steps required to push training dataset to DagsHub, refer to the Push training dataset to DagsHub section in the model training readme.
Once the dataset is uploaded, we create a PR on the DagsHub repository. This PR is then reviewed and merged into the main/develop branch.
After the dataset related changes are merged, we create a tag for that dataset using git.
Following command creates a tag for raw dataset. Make sure to add appropriate message and tag.
git tag -a raw/v1 -m "version 1 raw dataset"
git push origin raw/v1Following command creates a tag for train dataset. Make sure to add appropriate message and tag.
git tag -a train/v1 -m "version 1 train dataset"
git push origin train/v1