MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / predict

Function predict

digit-recognizer/app/routes.py:17–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15
16@app.route('/predict', methods=['POST'])
17def predict():
18 # reverse (white background, black digit -> black background, white digit)
19 # and normalize the image
20 input_data = ((255 - np.array(request.json)) / 255.0)
21
22 result_of_regression = RegressionPredictor.predict(input_data)
23 result_of_convolutional = CNNPredictor.predict(input_data)
24 return jsonify(data=[result_of_regression, result_of_convolutional])

Callers

nothing calls this directly

Calls 1

predictMethod · 0.45

Tested by

no test coverage detected