Skip to content

Commit

Permalink
[skip ci] Use Stanford Cars mirror to fix CI docs build (#11812)
Browse files Browse the repository at this point in the history
  • Loading branch information
guberti authored Jun 22, 2022
1 parent a5366a7 commit 32d16eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions gallery/how_to/work_with_microtvm/micro_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,20 @@
import urllib.request

# Download datasets
os.makedirs(f"{FOLDER}/downloads")
os.makedirs(f"{FOLDER}/images")
urllib.request.urlretrieve(
"http://ai.stanford.edu/~jkrause/car196/cars_train.tgz", f"{FOLDER}/images/target.tgz"
"https://data.deepai.org/stanfordcars.zip", f"{FOLDER}/downloads/target.zip"
)
urllib.request.urlretrieve(
"http://images.cocodataset.org/zips/val2017.zip", f"{FOLDER}/images/random.zip"
"http://images.cocodataset.org/zips/val2017.zip", f"{FOLDER}/downloads/random.zip"
)

# Extract them and rename their folders
shutil.unpack_archive(f"{FOLDER}/images/target.tgz", f"{FOLDER}/images")
shutil.unpack_archive(f"{FOLDER}/images/random.zip", f"{FOLDER}/images")
shutil.move(f"{FOLDER}/images/cars_train", f"{FOLDER}/images/target")
shutil.move(f"{FOLDER}/images/val2017", f"{FOLDER}/images/random")
shutil.unpack_archive(f"{FOLDER}/downloads/target.zip", f"{FOLDER}/downloads")
shutil.unpack_archive(f"{FOLDER}/downloads/random.zip", f"{FOLDER}/downloads")
shutil.move(f"{FOLDER}/downloads/cars_train/cars_train", f"{FOLDER}/images/target")
shutil.move(f"{FOLDER}/downloads/val2017", f"{FOLDER}/images/random")

######################################################################
# Loading the Data
Expand Down

0 comments on commit 32d16eb

Please sign in to comment.