From b4f21ff419d5b20626eb2605b575a5bf7b8c7642 Mon Sep 17 00:00:00 2001 From: isami Date: Sat, 5 Dec 2020 16:58:51 +0900 Subject: [PATCH] modified app.py --- app.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/app.py b/app.py index b37df4c..5f34826 100755 --- a/app.py +++ b/app.py @@ -16,6 +16,8 @@ import urllib3 import os +# image +from PIL import Image dirname = os.getcwd() model_path = dirname + "/model/model_006_0.1673.h5" @@ -52,6 +54,20 @@ def get_menu_url(rakuten_info, pred_class): return menu_url +@app.route("/receiveImage", methods=["POST", "GET"]) +def receive_image(): + print("\n\nrequest\n\n", request) + img = Image.open(request.files['upfile']) + + img.save("./static/sample.jpg") + print("\n\ndata: {}\n\n".format("")) + return "success" + + + + + + @app.route("/") def hello_world(): return "hello world!"