PIL,CV2,pytorch的图片维度顺序
PIL:
img = Image.open(file).convert('RGB')
w,h = img.size
CV2:
image = cv2.imread(filepath)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
h, w, c = image.shape
pytorch:
batch,channel,h,w
注意区分
PIL:
img = Image.open(file).convert('RGB')
w,h = img.size
CV2:
image = cv2.imread(filepath)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
h, w, c = image.shape
pytorch:
batch,channel,h,w
注意区分