Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -125,39 +125,9 @@ with gr.Blocks() as iface:
|
|
125 |
|
126 |
with open('description.txt', 'r') as file:
|
127 |
description_txt = file.read()
|
128 |
-
|
129 |
-
with gr.Tab(label=f'Description'):
|
130 |
-
gr.Markdown(description_txt)
|
131 |
-
gr.HTML("<div style='height: 20px;'></div>")
|
132 |
-
gr.Image(value="appendix/AI Personality Detection flow - 1.png", label='Flowchart 1', width=1000)
|
133 |
-
gr.Image(value="appendix/AI Personality Detection flow - 2.png", label='Flowchart 2', width=1000)
|
134 |
-
|
135 |
-
with gr.Tab(label=f'Examples'):
|
136 |
-
gr.Markdown("### Example Videos")
|
137 |
-
with gr.Row():
|
138 |
-
with gr.Column(scale=1):
|
139 |
-
example_video_1_path = "examples/Scenes.From.A.Marriage.US.mp4"
|
140 |
-
preview_1 = get_middle_frame(example_video_1_path)
|
141 |
-
gr.Image(preview_1, label="Scenes From A Marriage")
|
142 |
-
example_video_1 = gr.Video(example_video_1_path, label="Example 1", visible=False)
|
143 |
-
use_example_button_1 = gr.Button("Load Example 1")
|
144 |
-
|
145 |
-
with gr.Column(scale=1):
|
146 |
-
example_video_2_path = "examples/Billie Eilish.mp4"
|
147 |
-
preview_2 = get_middle_frame(example_video_2_path)
|
148 |
-
gr.Image(preview_2, label="Billie Eilish")
|
149 |
-
example_video_2 = gr.Video(example_video_2_path, label="Example 2", visible=False)
|
150 |
-
use_example_button_2 = gr.Button("Load Example 2")
|
151 |
-
|
152 |
-
with gr.Column(scale=1):
|
153 |
-
example_video_3_path = "examples/Elliot Rodger.mp4"
|
154 |
-
preview_3 = get_middle_frame(example_video_3_path)
|
155 |
-
gr.Image(preview_3, label="Elliot Rodger")
|
156 |
-
example_video_3 = gr.Video(example_video_3_path, label="Example 3", visible=False)
|
157 |
-
use_example_button_3 = gr.Button("Load Example 3")
|
158 |
|
159 |
for n in range(3): # Assuming maximum of 3 speakers
|
160 |
-
with gr.Tab(label=f'Speaker {n + 1}', visible=
|
161 |
with gr.TabItem(label=f'General Impression'):
|
162 |
column_components1 = [
|
163 |
gr.Markdown(visible=False),
|
@@ -184,7 +154,37 @@ with gr.Blocks() as iface:
|
|
184 |
output_components.extend(column_components3)
|
185 |
output_components.extend(column_components4)
|
186 |
|
187 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
188 |
|
189 |
analyze_button.click(
|
190 |
fn=analyze_video,
|
|
|
125 |
|
126 |
with open('description.txt', 'r') as file:
|
127 |
description_txt = file.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
for n in range(3): # Assuming maximum of 3 speakers
|
130 |
+
with gr.Tab(label=f'Speaker {n + 1}', visible=True):
|
131 |
with gr.TabItem(label=f'General Impression'):
|
132 |
column_components1 = [
|
133 |
gr.Markdown(visible=False),
|
|
|
154 |
output_components.extend(column_components3)
|
155 |
output_components.extend(column_components4)
|
156 |
|
157 |
+
|
158 |
+
|
159 |
+
gr.Markdown("### Example Videos")
|
160 |
+
with gr.Row():
|
161 |
+
with gr.Column(scale=1):
|
162 |
+
example_video_1_path = "examples/Scenes.From.A.Marriage.US.mp4"
|
163 |
+
preview_1 = get_middle_frame(example_video_1_path)
|
164 |
+
gr.Image(preview_1, label="Scenes From A Marriage")
|
165 |
+
example_video_1 = gr.Video(example_video_1_path, label="Example 1", visible=False)
|
166 |
+
use_example_button_1 = gr.Button("Load Example 1")
|
167 |
+
|
168 |
+
with gr.Column(scale=1):
|
169 |
+
example_video_2_path = "examples/Billie Eilish.mp4"
|
170 |
+
preview_2 = get_middle_frame(example_video_2_path)
|
171 |
+
gr.Image(preview_2, label="Billie Eilish")
|
172 |
+
example_video_2 = gr.Video(example_video_2_path, label="Example 2", visible=False)
|
173 |
+
use_example_button_2 = gr.Button("Load Example 2")
|
174 |
+
|
175 |
+
with gr.Column(scale=1):
|
176 |
+
example_video_3_path = "examples/Elliot Rodger.mp4"
|
177 |
+
preview_3 = get_middle_frame(example_video_3_path)
|
178 |
+
gr.Image(preview_3, label="Elliot Rodger")
|
179 |
+
example_video_3 = gr.Video(example_video_3_path, label="Example 3", visible=False)
|
180 |
+
use_example_button_3 = gr.Button("Load Example 3")
|
181 |
+
|
182 |
+
gr.Markdown(description_txt)
|
183 |
+
gr.HTML("<div style='height: 20px;'></div>")
|
184 |
+
gr.Image(value="appendix/AI Personality Detection flow - 1.png", label='Flowchart 1', width=1000)
|
185 |
+
gr.Image(value="appendix/AI Personality Detection flow - 2.png", label='Flowchart 2', width=1000)
|
186 |
+
|
187 |
+
|
188 |
|
189 |
analyze_button.click(
|
190 |
fn=analyze_video,
|