chriamue's picture
adds update script to download kaggle dataset
51c8ed8
raw
history blame
712 Bytes
import os
from kaggle.api.kaggle_api_extended import KaggleApi
import shutil
data_dir = 'data/'
kaggle_api = KaggleApi()
kaggle_api.authenticate()
kaggle_api.dataset_download_files('gpiosenka/100-bird-species', path=data_dir, unzip=True)
# There is a bug in the dataset, where one of the folders is named "PARAKETT AUKLET" instead of "PARAKETT AUKLET"
# We fix it by adding a space to the valid folder, because train and test are wrong and also the names in the labels file
# Fixing the path
fault_path = os.path.join(data_dir, 'valid', 'PARAKETT AUKLET')
correct_path = os.path.join(data_dir, 'valid', 'PARAKETT AUKLET')
shutil.rmtree(correct_path, ignore_errors=True)
shutil.move(fault_path, correct_path)