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)