import os
from PIL import Image
# 原文件路径
folder_path = "C:/Users/m/Desktop/result/1dvdrR3/train"
extensions = [".png"]
# Iterate through the files in the folder
for filename in os.listdir(folder_path):
if any(filename.lower().endswith(ext) for ext in extensions):
file_path = os.path.join(folder_path, filename)
img = Image.open(file_path)
channels = img.mode
if channels == "RGB":
print(f"{filename} is an RGB three-channel image.")
else:
print(f"{filename} is not an RGB three-channel image.")
02-28
4106
12-19
8631
12-05
3320
06-09
2172
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交