Skip to content

Commit bdd8f60

Browse files
Download figure
1 parent fc5e1ea commit bdd8f60

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎intro_to_ml.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ async def _(Path, dataset_path, public_folder_path, requests, zipfile):
3434
zf.extractall(public_folder_path)
3535
print(f"Extracted dataset in: {public_folder_path}")
3636
zip_path.unlink(missing_ok=True) # Delete the zipped dataset
37+
38+
# Download the figures (TODO: this is probably not the best way to handle this)
39+
assets_path = public_folder_path / "assets"
40+
if not assets_path.exists():
41+
os.mkdir(assets_path)
42+
43+
_img_dst = assets_path / "inference.png"
44+
if not _img_dst.exists():
45+
_img_src = "https://raw.githubusercontent.com/EPFL-Center-for-Imaging/vision-workshop/refs/heads/main/public/assets/inference.png"
46+
response = requests.get(url)
47+
with open(_img_dst, "wb") as _f:
48+
_f.write(response.content)
3749
else:
3850
import seaborn as sns
3951
return (sns,)

0 commit comments

Comments
 (0)