Spaces:
Sleeping
Sleeping
Commit
·
beb572f
1
Parent(s):
66668a0
add: image gen
Browse files- image_gen.py +8 -0
- nyc_ads_dataset/001.jpg +0 -0
- nyc_ads_dataset/002.jpg +0 -0
- nyc_ads_dataset/003.jpg +0 -0
- nyc_ads_dataset/004.jpg +0 -0
- nyc_ads_dataset/005.jpg +0 -0
image_gen.py
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from datasets import load_dataset
|
2 |
+
import os
|
3 |
+
|
4 |
+
dataset = load_dataset("cifar10", split="train", streaming=True)
|
5 |
+
|
6 |
+
os.makedirs("./nyc_ads_dataset", exist_ok=True)
|
7 |
+
for i, ex in zip(range(5), dataset):
|
8 |
+
ex["img"].save(f"./nyc_ads_dataset/{i+1:03d}.jpg")
|
nyc_ads_dataset/001.jpg
ADDED
![]() |
nyc_ads_dataset/002.jpg
ADDED
![]() |
nyc_ads_dataset/003.jpg
ADDED
![]() |
nyc_ads_dataset/004.jpg
ADDED
![]() |
nyc_ads_dataset/005.jpg
ADDED
![]() |