| import gradio as gr | |
| import cv2 | |
| from utils import emotion_detection_brainai as edb | |
| emotion_model = edb.EmotionModel() | |
| def detect_emotion(img): | |
| result_img = emotion_model.process(img) | |
| return result_img | |
| demo = gr.Interface( | |
| fn=detect_emotion, | |
| examples=[ | |
| "data/face.jpg", | |
| "data/emotions.jpg" | |
| ], | |
| inputs=gr.Image(label="이미지 업로드"), | |
| outputs=gr.Image(label="AI 추론 결과 확인") | |
| ) | |
| demo.launch() | |
| ## 활용 모델 | |
| # 문서 1: https://docs.openvino.ai/2024/notebooks/ddcolor-image-colorization-with-output.html | |
| # 모델: https://github.com/piddnad/DDColor |