[AI]-How to download datasets from Kaggle to PC
This setup is one-time activity.
This is my target page, I want to download datasets of FER Challenge on Kaggle to my PC.
Step1 Installation of Kaggle command-line tool (CLI)
What and How to set the public API via CLI?
$ pip install kaggle
Step2 Get my Given API credentials
$ kaggle
You will check which folder to put kaggle.json.
Mypath on PC is C:\Users\<user_name>\.kaggle
You can find your own API under Kaggle accounts
type $ kaggle
again once check, you can find out the arguments are required for further command. Which means that the .Json, your own API , has been setup.
type $ kaggle --version
to check the version of kaggle API.
Step3 Download datasets via CLI
to get help on kaggle, kaggle datasets
$ kaggle -h$ kaggle datasets download -h
to explore Kaggle-Competitions, Kaggle-Data, Kaggle-Kernels, here i am using to download kaggle datasets in my project .
go to Data
subtag on your project webpage.
copy API command which the command will be like this
$ kaggle datasets download -d <project_name_link>
What if the entire datasets is too big, like 34 GB. You can download particular file from datasets. You can select which files to download.
Specified a file to download
$ kaggle datasets download -f Submission.csv ashishpatel26/facial-expression-recognitionferchallenge
You may know more on Kaggle API tutorial.