In general, there is a neural network written and trained using the Keras library. Suppose this is classic handwriting recognition using MNIST dataset. Neural network weights and architecture can be saved for reuse with standard library functions. There was a question that all documentation and tutorials bypass for some reason. How to apply for input neyr. ONE network picture, for example, jpg with the number 3 and get the prediction of the neural network that it is most likely the number three?

  • And how do you serve not one, but many? - m9_psy

2 answers 2

orig_images = [] input_images = [] img_path = 'examples/fish_bike.jpg' orig_images.append(imread(img_path)) img = image.load_img(img_path, target_size=(img_height, img_width)) img = image.img_to_array(img) input_images.append(img) input_images = np.array(input_images) 

    in the examples we see the following:

     out = model.predict(x) print(np.argmax(out)) 

    if there is only one element in x , then the prediction will be for a single value. that's all.