def file_upload():
    file = request.files['webcam']
    path = os.getcwd() + '/imagepath.jpg'
    file.save(path)

    recognizer = cv.EmotionRecognizer()
    score = recognizer.get_emotion_from_image(path)
    if score is None:
        score = 0
    past_emotions.append(score)
    if len(past_emotions) == 5:
        past_emotions.pop(0)
    next_line = ling.get_next_line(get_moving_average())
    return next_line, 200
Exemple #2
0
def line():
    global all_words_dict
    line = ling.get_next_line(all_words_dict)

    return line