I trained a machine learning model which I wanted to deploy as an app. I learnt that flask is especially suited for this.
I have two functions, get_data from the user of the web app and then, infer_results which prints the results of image type.
I am trying to set up flask for the above use case. I started by following this tutorial: https://sourcedexter.com/python-rest-api-flask/
What I did:
In : app = Flask(__name__)
In : @app.route("/me", methods=["GET"])
...: def get_results():
...: return "Dummy Result"
In : app.run(host="0.0.0.0", threaded=True)
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
Or Execute the below script:
from flask import Flask, render_template app = Flask(__name__) # index @app.route('/') def index(): return "Hello" # /me @app.route("/me", methods=["GET"]) def get_results(): return "Dummy Result" if __name__ == "__main__": app.run()