Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,15 +44,15 @@ def analyze_video(video_path, progress=gr.Progress()):
|
|
44 |
speaker_general_impression = general_impressions.get(speaker_id, "")
|
45 |
|
46 |
output_components.extend([
|
47 |
-
gr.Markdown(f"### {speaker_id}", visible=
|
48 |
-
gr.Textbox(value=speaker_general_impression, label="General Impression", visible=
|
49 |
-
gr.Plot(value=speaker_charts.get("attachment", None), visible=
|
50 |
-
gr.Plot(value=speaker_charts.get("dimensions", None), visible=
|
51 |
-
gr.Textbox(value=speaker_explanations.get("attachment", ""), label="Attachment Styles Explanation", visible=
|
52 |
-
gr.Plot(value=speaker_charts.get("bigfive", None), visible=
|
53 |
-
gr.Textbox(value=speaker_explanations.get("bigfive", ""), label="Big Five Traits Explanation", visible=
|
54 |
gr.Plot(value=speaker_charts.get("personality", None), visible=bool(speaker_charts)),
|
55 |
-
gr.Textbox(value=speaker_explanations.get("personality", ""), label="Personality Disorders Explanation",
|
56 |
])
|
57 |
|
58 |
# Ensure we always return 32 components
|
@@ -104,7 +104,7 @@ with gr.Blocks() as iface:
|
|
104 |
output_components.append(transcript)
|
105 |
|
106 |
for n in range(3): # Always create 3 speaker tabs
|
107 |
-
with gr.Tab(label=f'Speaker {n + 1}', visible=
|
108 |
gr.Markdown(visible=False)
|
109 |
gr.Textbox(label="General Impression", visible=False)
|
110 |
gr.Plot(visible=False)
|
@@ -116,13 +116,6 @@ with gr.Blocks() as iface:
|
|
116 |
gr.Textbox(label="Personality Disorders Explanation", visible=False)
|
117 |
output_components.extend([tab] + [component for component in tab.children])
|
118 |
|
119 |
-
with open('description.txt', 'r') as file:
|
120 |
-
description_txt = file.read()
|
121 |
-
with gr.Tab(label=f'Description', visible=True):
|
122 |
-
gr.Markdown(description_txt)
|
123 |
-
gr.HTML("<div style='height: 20px;'></div>")
|
124 |
-
gr.Image(value="appendix/AI Personality Detection flow - 1.png", label='Flowchart 1', width=1000)
|
125 |
-
gr.Image(value="appendix/AI Personality Detection flow - 2.png", label='Flowchart 2', width=1000)
|
126 |
|
127 |
gr.Markdown("### Example Videos")
|
128 |
with gr.Row():
|
@@ -147,6 +140,15 @@ with gr.Blocks() as iface:
|
|
147 |
example_video_3 = gr.Video(example_video_3_path, label="Example 3", visible=False)
|
148 |
use_example_button_3 = gr.Button("Load Example 3")
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
analyze_button.click(
|
151 |
fn=clear_outputs,
|
152 |
inputs=[],
|
|
|
44 |
speaker_general_impression = general_impressions.get(speaker_id, "")
|
45 |
|
46 |
output_components.extend([
|
47 |
+
gr.Markdown(f"### {speaker_id}", visible=True),
|
48 |
+
gr.Textbox(value=speaker_general_impression, label="General Impression", visible=True),
|
49 |
+
gr.Plot(value=speaker_charts.get("attachment", None), visible=True),
|
50 |
+
gr.Plot(value=speaker_charts.get("dimensions", None), visible=True),
|
51 |
+
gr.Textbox(value=speaker_explanations.get("attachment", ""), label="Attachment Styles Explanation", visible=True),
|
52 |
+
gr.Plot(value=speaker_charts.get("bigfive", None), visible=True),
|
53 |
+
gr.Textbox(value=speaker_explanations.get("bigfive", ""), label="Big Five Traits Explanation", visible=True),
|
54 |
gr.Plot(value=speaker_charts.get("personality", None), visible=bool(speaker_charts)),
|
55 |
+
gr.Textbox(value=speaker_explanations.get("personality", ""), label="Personality Disorders Explanation", True)
|
56 |
])
|
57 |
|
58 |
# Ensure we always return 32 components
|
|
|
104 |
output_components.append(transcript)
|
105 |
|
106 |
for n in range(3): # Always create 3 speaker tabs
|
107 |
+
with gr.Tab(label=f'Speaker {n + 1}', visible=True) as tab:
|
108 |
gr.Markdown(visible=False)
|
109 |
gr.Textbox(label="General Impression", visible=False)
|
110 |
gr.Plot(visible=False)
|
|
|
116 |
gr.Textbox(label="Personality Disorders Explanation", visible=False)
|
117 |
output_components.extend([tab] + [component for component in tab.children])
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
|
120 |
gr.Markdown("### Example Videos")
|
121 |
with gr.Row():
|
|
|
140 |
example_video_3 = gr.Video(example_video_3_path, label="Example 3", visible=False)
|
141 |
use_example_button_3 = gr.Button("Load Example 3")
|
142 |
|
143 |
+
with open('description.txt', 'r') as file:
|
144 |
+
description_txt = file.read()
|
145 |
+
with gr.Tab(label=f'Description', visible=True):
|
146 |
+
gr.Markdown(description_txt)
|
147 |
+
gr.HTML("<div style='height: 20px;'></div>")
|
148 |
+
gr.Image(value="appendix/AI Personality Detection flow - 1.png", label='Flowchart 1', width=1000)
|
149 |
+
gr.Image(value="appendix/AI Personality Detection flow - 2.png", label='Flowchart 2', width=1000)
|
150 |
+
|
151 |
+
|
152 |
analyze_button.click(
|
153 |
fn=clear_outputs,
|
154 |
inputs=[],
|