Answer the question
In order to leave comments, you need to log in
Keras TensorFlow data format?
I have a saved neural network written in Python, now I need to feed my picture to the input of the neural network in order to get the answer. How to convert a .jpg image into a format understandable by the neural network?
Answer the question
In order to leave comments, you need to log in
There is no universal answer, it depends on the preprocessing used when training the network. At a minimum, you will need to read the image into an array / tensor (for example, cv2.imread
), and then look in the training code.
You can use
train_datagen=ImageDataGenerator(rescale=1./255)
train_generator=(train_datagen.flow_from_directory(
base_dir, target_size=(np_m,np_m), batch_size=batch_size, shuffle=True, class_mode=None)
) image: normalize, rotate, stretch, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question