Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -137,19 +137,36 @@ def analyze_video(video_path, language_display_name, max_speakers, progress=gr.P
|
|
137 |
for speaker_id, speaker_charts in charts.items():
|
138 |
speaker_explanations = explanations[speaker_id]
|
139 |
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
# Add the transcript at the end
|
155 |
output_components.append(gr.Textbox(value=transcription, label="Transcript", lines=10))
|
|
|
137 |
for speaker_id, speaker_charts in charts.items():
|
138 |
speaker_explanations = explanations[speaker_id]
|
139 |
|
140 |
+
# Prepare outputs for each speaker
|
141 |
+
output_components = []
|
142 |
+
for speaker_id, speaker_charts in charts.items():
|
143 |
+
speaker_explanations = explanations[speaker_id]
|
144 |
+
|
145 |
+
output_components.append(gr.Markdown(f"### {speaker_id}"))
|
146 |
+
|
147 |
+
if "attachment" in speaker_charts:
|
148 |
+
output_components.extend([
|
149 |
+
gr.Plot(speaker_charts["attachment"]),
|
150 |
+
gr.Textbox(value=speaker_explanations.get("attachment", ""),
|
151 |
+
label=f"Attachment Styles Explanation - {speaker_id}", lines=2),
|
152 |
+
])
|
153 |
+
|
154 |
+
if "dimensions" in speaker_charts:
|
155 |
+
output_components.append(gr.Plot(speaker_charts["dimensions"]))
|
156 |
+
|
157 |
+
if "bigfive" in speaker_charts:
|
158 |
+
output_components.extend([
|
159 |
+
gr.Plot(speaker_charts["bigfive"]),
|
160 |
+
gr.Textbox(value=speaker_explanations.get("bigfive", ""),
|
161 |
+
label=f"Big Five Traits Explanation - {speaker_id}", lines=2),
|
162 |
+
])
|
163 |
+
|
164 |
+
if "personality" in speaker_charts:
|
165 |
+
output_components.extend([
|
166 |
+
gr.Plot(speaker_charts["personality"]),
|
167 |
+
gr.Textbox(value=speaker_explanations.get("personality", ""),
|
168 |
+
label=f"Personality Disorders Explanation - {speaker_id}", lines=2),
|
169 |
+
])
|
170 |
|
171 |
# Add the transcript at the end
|
172 |
output_components.append(gr.Textbox(value=transcription, label="Transcript", lines=10))
|