Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Last active Oct 21, 2021
Embed
What would you like to do?
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