Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def analyze_video(video_path, language_display_name, max_speakers, progress=gr.P
|
|
27 |
start_time = time.time()
|
28 |
|
29 |
if not video_path:
|
30 |
-
return [gr.Markdown("Please upload a video file.")] + [
|
31 |
|
32 |
# Convert the display name to the language code
|
33 |
language = LANGUAGE_MAP[language_display_name]
|
@@ -68,21 +68,21 @@ def analyze_video(video_path, language_display_name, max_speakers, progress=gr.P
|
|
68 |
|
69 |
output_components.extend([
|
70 |
gr.Markdown(f"### {speaker_id}"),
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
])
|
79 |
|
80 |
# Add the transcript at the end
|
81 |
-
output_components.append(
|
82 |
|
83 |
-
# Pad the output with
|
84 |
while len(output_components) < 49:
|
85 |
-
output_components.append(
|
86 |
|
87 |
# Add the execution time
|
88 |
output_components.append(f"Completed in {int(execution_time)} seconds.")
|
@@ -101,7 +101,17 @@ with gr.Blocks() as iface:
|
|
101 |
analyze_button = gr.Button("Analyze")
|
102 |
|
103 |
# Create placeholders for output components
|
104 |
-
output_components = [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
execution_info_box = gr.Textbox(label="Execution Information", value="Waiting for analysis...", lines=2)
|
106 |
|
107 |
analyze_button.click(
|
|
|
27 |
start_time = time.time()
|
28 |
|
29 |
if not video_path:
|
30 |
+
return [gr.Markdown("Please upload a video file.")] + [None] * 48 + ["Analysis not started."]
|
31 |
|
32 |
# Convert the display name to the language code
|
33 |
language = LANGUAGE_MAP[language_display_name]
|
|
|
68 |
|
69 |
output_components.extend([
|
70 |
gr.Markdown(f"### {speaker_id}"),
|
71 |
+
speaker_charts.get("attachment", None),
|
72 |
+
speaker_explanations.get("attachment", ""),
|
73 |
+
speaker_charts.get("dimensions", None),
|
74 |
+
speaker_charts.get("bigfive", None),
|
75 |
+
speaker_explanations.get("bigfive", ""),
|
76 |
+
speaker_charts.get("personality", None),
|
77 |
+
speaker_explanations.get("personality", ""),
|
78 |
])
|
79 |
|
80 |
# Add the transcript at the end
|
81 |
+
output_components.append(transcription)
|
82 |
|
83 |
+
# Pad the output with None if necessary
|
84 |
while len(output_components) < 49:
|
85 |
+
output_components.append(None)
|
86 |
|
87 |
# Add the execution time
|
88 |
output_components.append(f"Completed in {int(execution_time)} seconds.")
|
|
|
101 |
analyze_button = gr.Button("Analyze")
|
102 |
|
103 |
# Create placeholders for output components
|
104 |
+
output_components = [
|
105 |
+
gr.Markdown(visible=False),
|
106 |
+
gr.Plot(visible=False),
|
107 |
+
gr.Textbox(label="Attachment Styles Explanation", visible=False),
|
108 |
+
gr.Plot(visible=False),
|
109 |
+
gr.Plot(visible=False),
|
110 |
+
gr.Textbox(label="Big Five Traits Explanation", visible=False),
|
111 |
+
gr.Plot(visible=False),
|
112 |
+
gr.Textbox(label="Personality Disorders Explanation", visible=False),
|
113 |
+
] * 3 # Assuming maximum of 6 speakers
|
114 |
+
output_components.append(gr.Textbox(label="Transcript", lines=10, visible=False))
|
115 |
execution_info_box = gr.Textbox(label="Execution Information", value="Waiting for analysis...", lines=2)
|
116 |
|
117 |
analyze_button.click(
|