from sklearn.model_selection import train_test_split
from PIL import Image
import os
path="C:/Users/86152/OneDrive/桌面/facade/test_label"
dat= os.listdir(path)
for file in dat:
ff=os.path.splitext(file)[0]
im = Image.open("C:/Users/86152/OneDrive/桌面/facade/test_label/"+file)
rgb_im = im.convert('RGB')
rgb_im.save('C:/Users/86152/OneDrive/桌面/test_label/'+ff+".jpg")
path="C:/Users/86152/OneDrive/桌面/facade/train_label"
dat= os.listdir(path)
for file in dat:
ff=os.path.splitext(file)[0]
im = Image.open("C:/Users/86152/OneDrive/桌面/facade/train_label/"+file)
rgb_im = im.convert('RGB')
rgb_im.save('C:/Users/86152/OneDrive/桌面/train_label/'+ff+".jpg")
python 批量把png文件改成jpg文件
最新推荐文章于 2024-05-16 13:32:43 发布