import cv2
import numpy as np
from PIL import Image
import glob
image_list =[]
resized_images=[]
for filename in
glob.glob('/home/ayush/Downloads/data/cars_test_resized/250*250/*.jpg'):
print(filename)
img = Image.open(filename)
image_list.append(img)
BLUE = [0,0,0]
for image in image_list:
constant=cv2.copyMakeBorder(np.float32(image),75,75,75,75,cv2.BORDER_CONSTANT,value=BLUE)
resized_images.append(constant)
print(constant.shape)
for (i,new) in enumerate(resized_images):
new.save('{}{}
{}'.format('/home/ayush/Downloads/data2/car_test/250*250',i+1,'.jpg'))
AttributeError
в 1 для (i, new) в перечислении (resized_images): ----> 2 new.save ('{} {} {}'. Format ('/ home / ayush / Downloads / data2 / car_test / 250 * 250 ', i + 1,'. jpg '))
AttributeError:' numpy .ndarray 'объект не имеет атрибута' save '