Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Last active October 21, 2021 18:49
Show Gist options
  • Save icebeam7/8b2c510e2d628a4dab2e38120615b27d to your computer and use it in GitHub Desktop.
Save icebeam7/8b2c510e2d628a4dab2e38120615b27d to your computer and use it in GitHub Desktop.
import os
import urllib.request
import zipfile
# Descargue el conjunto de datos de Github
data_url = "https://github.com/hnky/dataset-lego-figures/raw/master/_download/simpsons-lego-dataset.zip"
data_path = "./data-train"
download_path = os.path.join(data_path,"simpsons-lego-dataset.zip")
if not os.path.exists(data_path):
os.mkdir(data_path);
urllib.request.urlretrieve(data_url, filename=download_path)
# Descomprima el dataset
zip_ref = zipfile.ZipFile(download_path, 'r')
zip_ref.extractall(data_path)
zip_ref.close()
print("Data extracted in: {}".format(data_path))
os.remove(download_path)
print("Downloaded file removed: {}".format(download_path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment