PIL的Image读取cv2读取 PIL的Image读取from PIL import Imageimg = Image.open(os.path.join(indir, image)).convert('RGB')img = transform(img) cv2读取import cv2# this is numpy, but BGRimage = cv2.imread(path)# 转为RGBimage = image[:,:,::-1]