Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,21 +36,28 @@ def analyze_video(video_path, progress=gr.Progress()):
|
|
36 |
speaker_explanations = explanations[speaker_id]
|
37 |
speaker_general_impression = general_impressions[speaker_id]
|
38 |
|
39 |
-
|
40 |
-
f"## {speaker_id}",
|
41 |
speaker_general_impression, # speaker impression
|
42 |
-
|
43 |
-
|
44 |
-
speaker_charts
|
45 |
-
speaker_charts
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
# Pad with None for any missing speakers
|
52 |
while len(output_components) < 28:
|
53 |
-
output_components.extend([
|
54 |
|
55 |
output_components.append(f"Completed in {int(execution_time)} seconds.") # execution info
|
56 |
|
@@ -79,7 +86,7 @@ with gr.Blocks() as iface:
|
|
79 |
with gr.Column() as output_container:
|
80 |
transcript_output = gr.Textbox(label="Transcript", lines=10, visible=False)
|
81 |
speaker_outputs = []
|
82 |
-
for i in range(1, 4):
|
83 |
with gr.Column(visible=False) as speaker_column:
|
84 |
speaker_header = gr.Markdown(f"## Speaker {i}")
|
85 |
speaker_impression = gr.Textbox(label="General Impression", lines=3)
|
|
|
36 |
speaker_explanations = explanations[speaker_id]
|
37 |
speaker_general_impression = general_impressions[speaker_id]
|
38 |
|
39 |
+
speaker_section = [
|
40 |
+
gr.Markdown(f"## {speaker_id}", visible=True),
|
41 |
speaker_general_impression, # speaker impression
|
42 |
+
gr.Textbox(value=speaker_general_impression.get("general_impression", ""), label="General Impression",
|
43 |
+
visible=True),
|
44 |
+
gr.Plot(value=speaker_charts.get("attachment", None), visible=True),
|
45 |
+
gr.Plot(value=speaker_charts.get("dimensions", None), visible=True),
|
46 |
+
|
47 |
+
gr.Textbox(value=speaker_explanations.get("attachment", ""), label="Attachment Styles Explanation",
|
48 |
+
visible=True),
|
49 |
+
gr.Plot(value=speaker_charts.get("bigfive", None), visible=True),
|
50 |
+
gr.Textbox(value=speaker_explanations.get("bigfive", ""), label="Big Five Traits Explanation",
|
51 |
+
visible=True),
|
52 |
+
gr.Plot(value=speaker_charts.get("personality", None), visible=True),
|
53 |
+
gr.Textbox(value=speaker_explanations.get("personality", ""), label="Personality Disorders Explanation",
|
54 |
+
visible=True),
|
55 |
+
]
|
56 |
+
output_components.extend(speaker_section)
|
57 |
+
|
58 |
# Pad with None for any missing speakers
|
59 |
while len(output_components) < 28:
|
60 |
+
output_components.extend([gr.update(visible=False)] * 9)
|
61 |
|
62 |
output_components.append(f"Completed in {int(execution_time)} seconds.") # execution info
|
63 |
|
|
|
86 |
with gr.Column() as output_container:
|
87 |
transcript_output = gr.Textbox(label="Transcript", lines=10, visible=False)
|
88 |
speaker_outputs = []
|
89 |
+
for i in range(1, 4):
|
90 |
with gr.Column(visible=False) as speaker_column:
|
91 |
speaker_header = gr.Markdown(f"## Speaker {i}")
|
92 |
speaker_impression = gr.Textbox(label="General Impression", lines=3)
|