Posts

Showing posts with the label training-data

Resize images and merge data sets in python

Resize images and merge data sets in python I have two datasets, images1 and images2(generated in the function below, by reading images in a loop via given path) def measure(images1,path): images2= for filename in glob.glob(path): #looking for pngs temp = cv2.imread(filename).astype(float) images2.append (augm_img) print(np.array(images2).dtype) print(np.array(images).dtype) print(np.array(images2).shape) print(np.array(images).shape) Prints outputs: float64 float64 (1, 24, 24, 3) (60000, 32, 32, 3) (2, 24, 24, 3) (60000, 32, 32, 3) (3, 24, 24, 3) (60000, 32, 32, 3) (4, 24, 24, 3) (60000, 32, 32, 3) .... .... etc After reading images from path i want to resize images2 read from file to same size as images (:,32,32,3) (:,32,32,3) And merge these two datasets in one (via concatenate or append?) in order to train my model. Until now i cant find a way to do this so any advice would be helpful. ...