upload image from smartphoneApp done

This commit is contained in:
arnaucode
2017-12-15 21:11:02 +01:00
parent dc56f58d90
commit cd6adf659f
4 changed files with 111 additions and 53 deletions

View File

@@ -32,6 +32,7 @@ class Predict(Resource):
def post(self):
print("new predict")
start = time.time()
print(request.files['file'])
filer = request.files['file']#open the uploaded image, and transform to the numpy array
#process the img
@@ -50,6 +51,8 @@ class Predict(Resource):
logging.info(" [result]: " + r)
roundtrip = time.time() - start
logging.info(" [roundtriptime]: " + str(roundtrip) + "s")
print("Response: ")
print({'result': r})
return({'result': r})
api.add_resource(Predict, '/predict')