0

I just want to add more images to train/valid in CNN models, and i augment images by rotating. My CNN model is made by tf.keras.models.Sequential(), and I learned to set input_size in layers before started.

import cv2
import imutils
from PIL import Image,  ImageEnhance

img = cv2.imread(image_path)
img = cv2.cvtColor(img, cv2.COLOR_BRG2RGB)
img_rotate = imutils.rotate_bound(img, 45)

image shape(or size) : (426, 720, 3)

image shape(or size) : (852, 852, 3)

In this case, using keras, tf.keras.models.Sequential(), we set input_shape, but 2 images are different sizes, then how can i use it in model?

  • In general, convolutions do not care about size, but your backend likely does. Are there ary plain feed-forward layers towards the end of your network? – dedObed Jan 17 '23 at 06:16

0 Answers0