Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect assumption that downloaded dataset is encoded as UTF-8 #505

Open
aprknight opened this issue Sep 17, 2023 · 1 comment
Open

Incorrect assumption that downloaded dataset is encoded as UTF-8 #505

aprknight opened this issue Sep 17, 2023 · 1 comment

Comments

@aprknight
Copy link

In rest.py we have this line:

But what if the data are not encoded as UTF-8 ?

@yashu1wwww
Copy link

To download Kaggle datasets into Google Drive:

First, generate an API key in your Kaggle settings. Then, open google collab and run-in

!pip install opendatasets

It will prompt you to enter your Kaggle username and API key. After that, replace the dataset URL with your desired Kaggle dataset URL, and in the new_folder_name parameter, provide the folder name.

import shutil
import opendatasets as od
import os

from google.colab import drive

Mount Google Drive

drive.mount('/content/drive')

Define the output directory in Google Drive where the dataset will be downloaded

output_dir = '/content/drive/MyDrive/Kaggle_Datasets'

Define the name of the new folder to be created inside the output directory

new_folder_name = 'Embryo_Classification'

Create the new folder if it doesn't exist

new_folder_path = os.path.join(output_dir, new_folder_name)
os.makedirs(new_folder_path, exist_ok=True)

Define the Kaggle dataset URL

dataset_url = 'https://www.kaggle.com/datasets/gauravduttakiit/embryo-classification-efficientnet/data'

Download the dataset to the specified directory in Google Drive

od.download(dataset_url, data_dir=new_folder_path)

Move the downloaded zip file to the new folder

zip_file_name = 'embryo-classification-efficientnet.zip'
zip_file_path = os.path.join(output_dir, zip_file_name)
shutil.move(zip_file_path, new_folder_path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants