Update app.py
Browse files
app.py
CHANGED
|
@@ -709,19 +709,23 @@ def create_interface():
|
|
| 709 |
state,
|
| 710 |
"음성을 먼저 녹음해주세요.",
|
| 711 |
gr.update(visible=False), # loading
|
| 712 |
-
gr.update(visible=False),
|
| 713 |
-
gr.update(visible=False),
|
| 714 |
-
gr.update(visible=False),
|
| 715 |
-
gr.update(visible=True),
|
| 716 |
-
gr.update(visible=False)
|
| 717 |
)
|
| 718 |
|
| 719 |
try:
|
| 720 |
# 분석 시작 표시
|
| 721 |
yield (
|
| 722 |
state,
|
| 723 |
-
"🔄 기준 음성을 분석중입니다...",
|
| 724 |
-
gr.update(value='''
|
|
|
|
|
|
|
|
|
|
|
|
|
| 725 |
gr.update(visible=False),
|
| 726 |
gr.update(visible=False),
|
| 727 |
gr.update(visible=False),
|
|
@@ -745,7 +749,7 @@ def create_interface():
|
|
| 745 |
# 감정 분석 중 표시
|
| 746 |
yield (
|
| 747 |
state,
|
| 748 |
-
"🔄 음성의 감정과 특성을 분석중입니다...",
|
| 749 |
gr.update(visible=True),
|
| 750 |
gr.update(visible=False),
|
| 751 |
gr.update(visible=False),
|
|
@@ -756,7 +760,7 @@ def create_interface():
|
|
| 756 |
|
| 757 |
baseline_emotion = map_acoustic_to_emotion(features)
|
| 758 |
|
| 759 |
-
# 분석 결과 생성
|
| 760 |
voice_features_text = f"""
|
| 761 |
🎭 음성 특성 분석:
|
| 762 |
|
|
@@ -774,7 +778,7 @@ def create_interface():
|
|
| 774 |
• 특징: {', '.join(baseline_emotion['characteristics'])}
|
| 775 |
"""
|
| 776 |
|
| 777 |
-
analysis_text =
|
| 778 |
✨ 기준 음성 분석이 완료되었습니다.
|
| 779 |
|
| 780 |
이 음성 특성을 기준으로 이후의 감정 변화를 분석합니다.
|
|
@@ -1078,7 +1082,8 @@ def create_interface():
|
|
| 1078 |
analysis_result, # 최종 분석 결과
|
| 1079 |
blessing_section, # 축원 섹션
|
| 1080 |
entry_guide_section # 가이드 섹션
|
| 1081 |
-
]
|
|
|
|
| 1082 |
)
|
| 1083 |
|
| 1084 |
enter_btn.click(
|
|
|
|
| 709 |
state,
|
| 710 |
"음성을 먼저 녹음해주세요.",
|
| 711 |
gr.update(visible=False), # loading
|
| 712 |
+
gr.update(visible=False), # voice_features
|
| 713 |
+
gr.update(visible=False), # text_sentiment
|
| 714 |
+
gr.update(visible=False), # analysis_result
|
| 715 |
+
gr.update(visible=True), # blessing_section
|
| 716 |
+
gr.update(visible=False) # entry_guide_section
|
| 717 |
)
|
| 718 |
|
| 719 |
try:
|
| 720 |
# 분석 시작 표시
|
| 721 |
yield (
|
| 722 |
state,
|
| 723 |
+
"🔄 기준 음성을 분석중입니다... (약 10초 소요)",
|
| 724 |
+
gr.update(value='''
|
| 725 |
+
<div style="display:flex;justify-content:center;align-items:center;height:50px;overflow:hidden;">
|
| 726 |
+
<div class="loader" style="width:30px;height:30px;"></div>
|
| 727 |
+
</div>
|
| 728 |
+
''', visible=True),
|
| 729 |
gr.update(visible=False),
|
| 730 |
gr.update(visible=False),
|
| 731 |
gr.update(visible=False),
|
|
|
|
| 749 |
# 감정 분석 중 표시
|
| 750 |
yield (
|
| 751 |
state,
|
| 752 |
+
"🔄 음성의 감정과 특성을 분석중입니다... (약 5초 소요)",
|
| 753 |
gr.update(visible=True),
|
| 754 |
gr.update(visible=False),
|
| 755 |
gr.update(visible=False),
|
|
|
|
| 760 |
|
| 761 |
baseline_emotion = map_acoustic_to_emotion(features)
|
| 762 |
|
| 763 |
+
# 분석 결과 생성 - 음성 특성만 분석
|
| 764 |
voice_features_text = f"""
|
| 765 |
🎭 음성 특성 분석:
|
| 766 |
|
|
|
|
| 778 |
• 특징: {', '.join(baseline_emotion['characteristics'])}
|
| 779 |
"""
|
| 780 |
|
| 781 |
+
analysis_text = """
|
| 782 |
✨ 기준 음성 분석이 완료되었습니다.
|
| 783 |
|
| 784 |
이 음성 특성을 기준으로 이후의 감정 변화를 분석합니다.
|
|
|
|
| 1082 |
analysis_result, # 최종 분석 결과
|
| 1083 |
blessing_section, # 축원 섹션
|
| 1084 |
entry_guide_section # 가이드 섹션
|
| 1085 |
+
],
|
| 1086 |
+
api_name="analyze_blessing" # API 이름 추가
|
| 1087 |
)
|
| 1088 |
|
| 1089 |
enter_btn.click(
|