张量升维技巧np.expand

it2022-05-05  191

from keras.preprocessing import image import matplotlib.pyplot as plt import cv2 import numpy as np img_path = '/Parthenon.jpg' im2 = image.load_img(img_path, target_size=(224, 224)) img = image.img_to_array(im2) x = np.expand_dims(img, axis=0) x1 = np.array(img).reshape((1, 224, 224, 3)) img2=np.copy(x1) x2 = np.concatenate((img2,img2),axis=-1)

 

 


最新回复(0)