ml-frontend/server.py
2023-01-09 19:31:07 +08:00

29 lines
466 B
Python

from flask import Flask, render_template, jsonify, send_file
app = Flask(__name__)
imagePath = "./static/photo.jpg"
@app.route("/")
def index():
return send_file("index.html")
@app.route("/poll")
def poll():
data = {
"state": "camera"
}
return jsonify(data)
@app.route("/photo")
def photo():
return send_file(imagePath)
# 放下垃圾
# 拍好照
# 辨識好
# 準備好下一個
if __name__ == "__main__":
app.run(debug=True)