我试图从同一个文件夹中的加载图像作为一个我的Python脚本是 # create a class called Person
# create init method
# 2 attributes (name, and birthdate)
# create an object from the Person class
from PIL import Image, ImageTK
i
写一些代码要经过200个图像的文件夹来获得像素的最小数量的值的图像(即最小宽度和高度) 但我不断收到此错误: File "pixelSizeCheck.py", line 9, in get_num_pixels
width, height = Image.open(open(filepath)).size
IsADirectoryError: [Errno 21] Is a director
def preprocess_image(path_to_images):
print("preprocessing images..")
files = os.listdir(path_to_images)
for f in files:
im = Image.open(os.path.join(path_to_images, f))
im