-1

so i was reading this example in the keras website https://keras.io/examples/vision/image_classification_with_vision_transformer/

my question is, how can i use custom dataset from kaggle for example https://www.kaggle.com/datasets/grassknoted/asl-alphabet with the code in keras example since it uses cifar100.

1 Answers1

0

If you are using google colab for your work, you can follow the steps below to use dataset:

  1. Go to your kaggle profile.
  2. Go to "Account" tab in your profile.
  3. In the "API" section click on "Create New Token". It download "kaggle.json" file.
  4. Use the following code for using the dataset. You can paste it in a blank cell:
!pip install -q kaggle
from google.colab import files
files.upload()
!mkdir ~/.kaggle
!cp kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.json
!kaggle datasets download {link_of_dataset}
!unzip {name_of_dataset}.zip -d {desired_directory}

When you run this cell, it asks you to upload a file. You need to upload the kaggle.json file that you downloaded in step 3. For example if you want to download the "ASL Alphabet" dataset, use the following code:

!pip install -q kaggle
from google.colab import files
files.upload()
!mkdir ~/.kaggle
!cp kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.json
!kaggle datasets download 'grassknoted/asl-alphabet'
!unzip asl-alphabet.zip -d /content/