S
S
SKEPTIC2019-05-20 21:40:26
Python
SKEPTIC, 2019-05-20 21:40:26

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

2 answer(s)
A
Arseny Kravchenko, 2019-05-20
@Arseny_Info

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.

M
Maria Dyakova, 2019-05-23
@mdyakovaml

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 question

Ask a Question

731 491 924 answers to any question