Truck2 / gen_src.py
Wendy-Fly's picture
Upload gen_src.py with huggingface_hub
ffc17b9 verified
raw
history blame
542 Bytes
import os
from PIL import Image
file_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/single_50'
src_img_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/single_result'
save_src_path = '/home/zbz5349/WorkSpace/aigeeks/ml-mgie/single2_50'
os.makedirs(save_src_path,exist_ok=True)
idx = 0
for file in os.listdir(file_path):
idx = idx + 1
print(file[2:])
x = '2' + file[1:]
img_path = os.path.join(src_img_path, x)
img = Image.open(img_path)
save_img_path = os.path.join(save_src_path,x)
img.save(save_img_path)