Upload gen_src.py with huggingface_hub
Browse files- gen_src.py +5 -8
gen_src.py
CHANGED
@@ -1,18 +1,15 @@
|
|
1 |
import os
|
2 |
from PIL import Image
|
3 |
|
4 |
-
file_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/
|
5 |
-
src_img_path = '/home/zbz5349/WorkSpace/aigeeks/
|
6 |
-
save_src_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/
|
7 |
os.makedirs(save_src_path,exist_ok=True)
|
8 |
idx = 0
|
9 |
for file in os.listdir(file_path):
|
10 |
-
|
11 |
-
print(file[2:])
|
12 |
-
x = '2' + file[1:]
|
13 |
-
img_path = os.path.join(src_img_path, x)
|
14 |
img = Image.open(img_path)
|
15 |
-
save_img_path = os.path.join(save_src_path,
|
16 |
img.save(save_img_path)
|
17 |
|
18 |
|
|
|
1 |
import os
|
2 |
from PIL import Image
|
3 |
|
4 |
+
file_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/all'
|
5 |
+
src_img_path = '/home/zbz5349/WorkSpace/aigeeks/Qwen2.5-VL/magicbrush_dataset/data'
|
6 |
+
save_src_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/src_all_100'
|
7 |
os.makedirs(save_src_path,exist_ok=True)
|
8 |
idx = 0
|
9 |
for file in os.listdir(file_path):
|
10 |
+
img_path = os.path.join(src_img_path, file)
|
|
|
|
|
|
|
11 |
img = Image.open(img_path)
|
12 |
+
save_img_path = os.path.join(save_src_path,file)
|
13 |
img.save(save_img_path)
|
14 |
|
15 |
|