This commit is contained in:
louiscklaw
2025-01-31 22:57:47 +08:00
parent b1cd1d4662
commit b3cc8e8323
764 changed files with 722101 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import os
from PIL import Image
json_dir = "./"
label_names = os.listdir(json_dir)
label_dir = []
for filename in label_names:
label_dir.append(os.path.join(json_dir,filename))
for i,filename in enumerate(label_dir):
im = Image.open(filename) # open ppm file
newname = label_names[i].split('.')[0] + '.jpg' # new name for png file
im.save(os.path.join(json_dir,newname))