'' Привет, я пытаюсь вызвать свою функцию нажатием кнопки html, но я не понимаю, как это сделать. Моя функция предназначена для анализа эмоций человека, когда ее вызывают, она открывает окно и Веб-камера будет запущена для анализа живых эмоций. Вот мой код с html code '' '
from flask import Flask, render_template, request
from video_tester_of_emotions import main_app
app = Flask(__name__)
@app.route('/flask', methods=['Get', 'POST'])
def sample():
if request.method == "POST":
result = request.form
#main_app() function of emotion analysis
return render_template("hello.html")
if __name__ == '__main__':
app.run(debug=True)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>
Emotion Ananlysis
</title>
</head>
<body style="background-color:black;text-align:center">
<h1 style="
color: aqua;
font-family: cursive;
font-size: 56px;
">welcome to "Emotion Analysis"</h1>
<img src="/static/images/emo.gif" width="500" height="300" border="5" alt="Human Emotions"/>
<h2 style="
color: aqua;
font-family: cursive;
font-size: 23px;">Click On Start To See Your Emotions</h2>
<form action = "http://127.0.0.1:5000/flask" method = "POST">
<p><input type = "submit" value = "Start!" style="display: inherit; margin: auto; margin-top: 50px;
font-size: 22px; background: cadetblue;"/></p>
</form>>
</body>
</html>