Spaces:
Running
Running
Commit
•
78f883e
1
Parent(s):
24ee878
v0.8.3 (#11)
Browse files- Summary (6d7dc58dd09f22958fa031c0fcffb434c60a1b7c)
Co-authored-by: Dmitry Ryumin <[email protected]>
- app.css +80 -2
- app.py +38 -10
- app/components.py +31 -1
- app/event_handlers/calculate_practical_tasks.py +165 -6
- app/event_handlers/calculate_pt_scores_blocks.py +17 -0
- app/event_handlers/clear_blocks.py +17 -0
- app/event_handlers/event_handlers.py +86 -2
- app/event_handlers/examples_blocks.py +19 -8
- app/event_handlers/files.py +1 -1
- app/event_handlers/practical_task_sorted.py +104 -7
- app/practical_tasks.py +1 -1
- app/tabs.py +156 -3
- app/video_metadata.py +25 -0
- config.toml +4 -3
- images/RU.png +0 -0
- images/UK.png +0 -0
- images/email.svg +1 -0
- images/name.svg +1 -0
- images/phone.svg +1 -0
- video_metadata.yaml +31 -0
- videos/video1.mp4 +0 -3
- videos/video2.mp4 +0 -3
- videos/video3.mp4 +0 -3
- videos/video4.mp4 +0 -3
- videos/video5.mp4 +0 -3
- videos/video6.mp4 +0 -3
app.css
CHANGED
@@ -10,6 +10,10 @@ div.video-container {
|
|
10 |
max-height: 350px;
|
11 |
}
|
12 |
|
|
|
|
|
|
|
|
|
13 |
div.video-sorted-container {
|
14 |
max-width: 640px;
|
15 |
max-height: 350px;
|
@@ -26,7 +30,13 @@ div.video-sorted-container:hover label[data-testid="block-label"] {
|
|
26 |
display: none;
|
27 |
}
|
28 |
|
29 |
-
.dataframe
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
height: auto !important;
|
31 |
}
|
32 |
|
@@ -102,6 +112,39 @@ div.files-container label[data-testid="block-label"] {
|
|
102 |
max-width: fit-content;
|
103 |
}
|
104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
.dropdown-language-container {
|
106 |
display: contents;
|
107 |
}
|
@@ -149,4 +192,39 @@ div.mbti-dataframe div.table-wrap {
|
|
149 |
|
150 |
div.about_app pre {
|
151 |
text-wrap: wrap;
|
152 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
max-height: 350px;
|
11 |
}
|
12 |
|
13 |
+
div.video-column-container {
|
14 |
+
max-width: 640px;
|
15 |
+
}
|
16 |
+
|
17 |
div.video-sorted-container {
|
18 |
max-width: 640px;
|
19 |
max-height: 350px;
|
|
|
30 |
display: none;
|
31 |
}
|
32 |
|
33 |
+
div.dataframe table > thead,
|
34 |
+
div.dataframe table > tbody {
|
35 |
+
width: auto !important;
|
36 |
+
display: table-header-group;
|
37 |
+
}
|
38 |
+
|
39 |
+
div.dataframe div.table-wrap {
|
40 |
height: auto !important;
|
41 |
}
|
42 |
|
|
|
112 |
max-width: fit-content;
|
113 |
}
|
114 |
|
115 |
+
div.languages-container_wrapper {
|
116 |
+
display: grid;
|
117 |
+
justify-content: end;
|
118 |
+
width: auto;
|
119 |
+
position: absolute;
|
120 |
+
right: 0px;
|
121 |
+
}
|
122 |
+
|
123 |
+
div.languages-container {
|
124 |
+
display: flex;
|
125 |
+
align-items: center;
|
126 |
+
gap: 10px;
|
127 |
+
width: fit-content;
|
128 |
+
}
|
129 |
+
|
130 |
+
div.languages-container > div.country_flags {
|
131 |
+
display: contents;
|
132 |
+
min-width: none;
|
133 |
+
}
|
134 |
+
|
135 |
+
div.languages-container > div.country_flags button {
|
136 |
+
width: fit-content;
|
137 |
+
cursor: default;
|
138 |
+
}
|
139 |
+
|
140 |
+
div.languages-container > div.country_flags div.image-container {
|
141 |
+
width: fit-content;
|
142 |
+
}
|
143 |
+
|
144 |
+
div.languages-container > div.country_flags div.image-container > img {
|
145 |
+
height: 32px;
|
146 |
+
}
|
147 |
+
|
148 |
.dropdown-language-container {
|
149 |
display: contents;
|
150 |
}
|
|
|
192 |
|
193 |
div.about_app pre {
|
194 |
text-wrap: wrap;
|
195 |
+
}
|
196 |
+
|
197 |
+
div.name-container, div.surname-container,
|
198 |
+
div.email-container, div.phone-container {
|
199 |
+
gap: 4px;
|
200 |
+
}
|
201 |
+
|
202 |
+
div.name-container > div.metadata_name-logo,
|
203 |
+
div.surname-container > div.metadata_surname-logo,
|
204 |
+
div.email-container > div.metadata_email-logo,
|
205 |
+
div.phone-container > div.metadata_phone-logo {
|
206 |
+
display: contents;
|
207 |
+
min-width: none;
|
208 |
+
}
|
209 |
+
|
210 |
+
div.name-container > div.metadata_name-logo button,
|
211 |
+
div.surname-container > div.metadata_surname-logo button,
|
212 |
+
div.email-container > div.metadata_email-logo button,
|
213 |
+
div.phone-container > div.metadata_phone-logo button {
|
214 |
+
width: fit-content;
|
215 |
+
cursor: default;
|
216 |
+
}
|
217 |
+
|
218 |
+
div.name-container > div.metadata_name-logo div.image-container,
|
219 |
+
div.surname-container > div.metadata_surname-logo div.image-container,
|
220 |
+
div.email-container > div.metadata_email-logo div.image-container,
|
221 |
+
div.phone-container > div.metadata_phone-logo div.image-container {
|
222 |
+
width: fit-content;
|
223 |
+
}
|
224 |
+
|
225 |
+
div.name-container > div.metadata_name-logo div.image-container > img,
|
226 |
+
div.surname-container > div.metadata_surname-logo div.image-container > img,
|
227 |
+
div.email-container > div.metadata_email-logo div.image-container > img,
|
228 |
+
div.phone-container > div.metadata_phone-logo div.image-container > img {
|
229 |
+
height: 32px;
|
230 |
+
}
|
app.py
CHANGED
@@ -13,19 +13,43 @@ from app.event_handlers.event_handlers import setup_app_event_handlers
|
|
13 |
from app import tabs
|
14 |
from app.components import dropdown_create_ui
|
15 |
|
|
|
|
|
16 |
|
17 |
def create_gradio_app() -> gr.Blocks:
|
18 |
with gr.Blocks(css=config_data.AppSettings_CSS_PATH) as gradio_app:
|
19 |
-
|
20 |
-
label=None,
|
21 |
-
info=None,
|
22 |
-
choices=config_data.Settings_LANGUAGES_EN,
|
23 |
-
value=config_data.Settings_LANGUAGES_EN[0],
|
24 |
visible=True,
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
tab_results = {}
|
31 |
ts = []
|
@@ -45,7 +69,11 @@ def create_gradio_app() -> gr.Blocks:
|
|
45 |
ts.append(tab)
|
46 |
|
47 |
setup_app_event_handlers(
|
48 |
-
*tab_results[list(tab_results.keys())[0]],
|
|
|
|
|
|
|
|
|
49 |
)
|
50 |
|
51 |
return gradio_app
|
|
|
13 |
from app import tabs
|
14 |
from app.components import dropdown_create_ui
|
15 |
|
16 |
+
gr.set_static_paths(paths=["images/"])
|
17 |
+
|
18 |
|
19 |
def create_gradio_app() -> gr.Blocks:
|
20 |
with gr.Blocks(css=config_data.AppSettings_CSS_PATH) as gradio_app:
|
21 |
+
with gr.Column(
|
|
|
|
|
|
|
|
|
22 |
visible=True,
|
23 |
+
render=True,
|
24 |
+
variant="default",
|
25 |
+
elem_classes="languages-container_wrapper",
|
26 |
+
):
|
27 |
+
with gr.Row(
|
28 |
+
visible=True,
|
29 |
+
render=True,
|
30 |
+
variant="default",
|
31 |
+
elem_classes="languages-container",
|
32 |
+
) as languages_row:
|
33 |
+
country_flags = gr.Image(
|
34 |
+
value="images/UK.png",
|
35 |
+
container=False,
|
36 |
+
interactive=False,
|
37 |
+
show_label=False,
|
38 |
+
visible=True,
|
39 |
+
show_download_button=False,
|
40 |
+
elem_classes="country_flags",
|
41 |
+
)
|
42 |
+
|
43 |
+
languages = dropdown_create_ui(
|
44 |
+
label=None,
|
45 |
+
info=None,
|
46 |
+
choices=config_data.Settings_LANGUAGES_EN,
|
47 |
+
value=config_data.Settings_LANGUAGES_EN[0],
|
48 |
+
visible=True,
|
49 |
+
show_label=False,
|
50 |
+
elem_classes="dropdown-language-container",
|
51 |
+
interactive=False,
|
52 |
+
)
|
53 |
|
54 |
tab_results = {}
|
55 |
ts = []
|
|
|
69 |
ts.append(tab)
|
70 |
|
71 |
setup_app_event_handlers(
|
72 |
+
*tab_results[list(tab_results.keys())[0]],
|
73 |
+
*ts,
|
74 |
+
languages_row,
|
75 |
+
country_flags,
|
76 |
+
languages
|
77 |
)
|
78 |
|
79 |
return gradio_app
|
app/components.py
CHANGED
@@ -6,7 +6,7 @@ License: MIT License
|
|
6 |
"""
|
7 |
|
8 |
import gradio as gr
|
9 |
-
from typing import Union, List, Callable, Optional
|
10 |
|
11 |
|
12 |
def html_message(
|
@@ -177,3 +177,33 @@ def dropdown_create_ui(
|
|
177 |
render=render,
|
178 |
elem_classes=elem_classes,
|
179 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
"""
|
7 |
|
8 |
import gradio as gr
|
9 |
+
from typing import Union, List, Callable, Optional, Literal
|
10 |
|
11 |
|
12 |
def html_message(
|
|
|
177 |
render=render,
|
178 |
elem_classes=elem_classes,
|
179 |
)
|
180 |
+
|
181 |
+
|
182 |
+
def textbox_create_ui(
|
183 |
+
value: Optional[str] = None,
|
184 |
+
type: Literal["text", "password", "email"] = "text",
|
185 |
+
label: Optional[str] = None,
|
186 |
+
placeholder: Optional[str] = None,
|
187 |
+
info: Optional[str] = None,
|
188 |
+
max_lines: int = 1,
|
189 |
+
show_label: bool = True,
|
190 |
+
interactive: bool = True,
|
191 |
+
visible: bool = True,
|
192 |
+
show_copy_button: bool = True,
|
193 |
+
scale: int = 1,
|
194 |
+
container: bool = False,
|
195 |
+
):
|
196 |
+
return gr.Textbox(
|
197 |
+
value=value,
|
198 |
+
type=type,
|
199 |
+
label=label,
|
200 |
+
placeholder=placeholder,
|
201 |
+
info=info,
|
202 |
+
max_lines=max_lines,
|
203 |
+
show_label=show_label,
|
204 |
+
interactive=interactive,
|
205 |
+
visible=visible,
|
206 |
+
show_copy_button=show_copy_button,
|
207 |
+
scale=scale,
|
208 |
+
container=container,
|
209 |
+
)
|
app/event_handlers/calculate_practical_tasks.py
CHANGED
@@ -12,13 +12,20 @@ from pathlib import Path
|
|
12 |
|
13 |
# Importing necessary components for the Gradio app
|
14 |
from app.config import config_data
|
|
|
15 |
from app.mbti_description import MBTI_DESCRIPTION, MBTI_DATA
|
16 |
from app.utils import (
|
17 |
read_csv_file,
|
18 |
apply_rounding_and_rename_columns,
|
19 |
preprocess_scores_df,
|
20 |
)
|
21 |
-
from app.components import
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
|
24 |
def colleague_type(subtask):
|
@@ -63,6 +70,101 @@ def compare_strings(original, comparison, prev=False):
|
|
63 |
return f"<span class='wrapper_mbti'>{''.join(result + [f'</span>' if prev_class else ''])}</span>"
|
64 |
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
def event_handler_calculate_practical_task_blocks(
|
67 |
files,
|
68 |
practical_subtasks,
|
@@ -130,7 +232,9 @@ def event_handler_calculate_practical_task_blocks(
|
|
130 |
compare_strings(short_mbti, mbti, False) for mbti in mbti_values
|
131 |
]
|
132 |
|
133 |
-
|
|
|
|
|
134 |
gr.Row(visible=True),
|
135 |
gr.Column(visible=True),
|
136 |
dataframe(
|
@@ -160,6 +264,7 @@ def event_handler_calculate_practical_task_blocks(
|
|
160 |
visible=True,
|
161 |
elem_classes="mbti-dataframe",
|
162 |
),
|
|
|
163 |
video_create_ui(
|
164 |
value=files[person_id],
|
165 |
file_name=Path(files[person_id]).name,
|
@@ -169,6 +274,8 @@ def event_handler_calculate_practical_task_blocks(
|
|
169 |
),
|
170 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
171 |
)
|
|
|
|
|
172 |
elif practical_subtasks.lower() == "professional groups":
|
173 |
sum_weights = sum(
|
174 |
[
|
@@ -200,7 +307,23 @@ def event_handler_calculate_practical_task_blocks(
|
|
200 |
gr.Accordion(visible=False),
|
201 |
gr.HTML(visible=False),
|
202 |
dataframe(visible=False),
|
|
|
203 |
video_create_ui(visible=False),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
html_message(
|
205 |
config_data.InformationMessages_SUM_WEIGHTS.format(sum_weights),
|
206 |
False,
|
@@ -228,7 +351,9 @@ def event_handler_calculate_practical_task_blocks(
|
|
228 |
|
229 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
230 |
|
231 |
-
|
|
|
|
|
232 |
gr.Row(visible=True),
|
233 |
gr.Column(visible=True),
|
234 |
dataframe(
|
@@ -249,6 +374,7 @@ def event_handler_calculate_practical_task_blocks(
|
|
249 |
gr.Accordion(visible=False),
|
250 |
gr.HTML(visible=False),
|
251 |
dataframe(visible=False),
|
|
|
252 |
video_create_ui(
|
253 |
value=files[person_id],
|
254 |
file_name=Path(files[person_id]).name,
|
@@ -258,6 +384,8 @@ def event_handler_calculate_practical_task_blocks(
|
|
258 |
),
|
259 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
260 |
)
|
|
|
|
|
261 |
elif practical_subtasks.lower() == "professional skills":
|
262 |
df_professional_skills = read_csv_file(config_data.Links_PROFESSIONAL_SKILLS)
|
263 |
|
@@ -291,7 +419,9 @@ def event_handler_calculate_practical_task_blocks(
|
|
291 |
|
292 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
293 |
|
294 |
-
|
|
|
|
|
295 |
gr.Row(visible=True),
|
296 |
gr.Column(visible=True),
|
297 |
dataframe(
|
@@ -312,6 +442,7 @@ def event_handler_calculate_practical_task_blocks(
|
|
312 |
gr.Accordion(visible=False),
|
313 |
gr.HTML(visible=False),
|
314 |
dataframe(visible=False),
|
|
|
315 |
video_create_ui(
|
316 |
value=files[person_id],
|
317 |
file_name=Path(files[person_id]).name,
|
@@ -321,6 +452,8 @@ def event_handler_calculate_practical_task_blocks(
|
|
321 |
),
|
322 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
323 |
)
|
|
|
|
|
324 |
elif (
|
325 |
practical_subtasks.lower() == "finding a suitable junior colleague"
|
326 |
or practical_subtasks.lower() == "finding a suitable senior colleague"
|
@@ -356,7 +489,9 @@ def event_handler_calculate_practical_task_blocks(
|
|
356 |
|
357 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
358 |
|
359 |
-
|
|
|
|
|
360 |
gr.Row(visible=True),
|
361 |
gr.Column(visible=True),
|
362 |
dataframe(
|
@@ -378,6 +513,7 @@ def event_handler_calculate_practical_task_blocks(
|
|
378 |
gr.Accordion(visible=False),
|
379 |
gr.HTML(visible=False),
|
380 |
dataframe(visible=False),
|
|
|
381 |
video_create_ui(
|
382 |
value=files[person_id],
|
383 |
file_name=Path(files[person_id]).name,
|
@@ -387,6 +523,8 @@ def event_handler_calculate_practical_task_blocks(
|
|
387 |
),
|
388 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
389 |
)
|
|
|
|
|
390 |
elif (
|
391 |
practical_subtasks.lower() == "car characteristics"
|
392 |
or practical_subtasks.lower() == "mobile device application categories"
|
@@ -433,7 +571,9 @@ def event_handler_calculate_practical_task_blocks(
|
|
433 |
|
434 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
435 |
|
436 |
-
|
|
|
|
|
437 |
gr.Row(visible=True),
|
438 |
gr.Column(visible=True),
|
439 |
dataframe(
|
@@ -454,6 +594,7 @@ def event_handler_calculate_practical_task_blocks(
|
|
454 |
gr.Accordion(visible=False),
|
455 |
gr.HTML(visible=False),
|
456 |
dataframe(visible=False),
|
|
|
457 |
video_create_ui(
|
458 |
value=files[person_id],
|
459 |
file_name=Path(files[person_id]).name,
|
@@ -463,6 +604,8 @@ def event_handler_calculate_practical_task_blocks(
|
|
463 |
),
|
464 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
465 |
)
|
|
|
|
|
466 |
else:
|
467 |
gr.Info(config_data.InformationMessages_NOTI_IN_DEV)
|
468 |
|
@@ -483,6 +626,22 @@ def event_handler_calculate_practical_task_blocks(
|
|
483 |
gr.Accordion(visible=False),
|
484 |
gr.HTML(visible=False),
|
485 |
dataframe(visible=False),
|
|
|
486 |
video_create_ui(visible=False),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
487 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, True),
|
488 |
)
|
|
|
12 |
|
13 |
# Importing necessary components for the Gradio app
|
14 |
from app.config import config_data
|
15 |
+
from app.video_metadata import video_metadata
|
16 |
from app.mbti_description import MBTI_DESCRIPTION, MBTI_DATA
|
17 |
from app.utils import (
|
18 |
read_csv_file,
|
19 |
apply_rounding_and_rename_columns,
|
20 |
preprocess_scores_df,
|
21 |
)
|
22 |
+
from app.components import (
|
23 |
+
html_message,
|
24 |
+
dataframe,
|
25 |
+
files_create_ui,
|
26 |
+
video_create_ui,
|
27 |
+
textbox_create_ui,
|
28 |
+
)
|
29 |
|
30 |
|
31 |
def colleague_type(subtask):
|
|
|
70 |
return f"<span class='wrapper_mbti'>{''.join(result + [f'</span>' if prev_class else ''])}</span>"
|
71 |
|
72 |
|
73 |
+
def create_person_metadata(person_id, files, video_metadata):
|
74 |
+
if (
|
75 |
+
Path(files[person_id]).name in video_metadata
|
76 |
+
and config_data.Settings_SHOW_VIDEO_METADATA
|
77 |
+
):
|
78 |
+
person_metadata_list = video_metadata[Path(files[person_id]).name]
|
79 |
+
return (
|
80 |
+
gr.Column(visible=True),
|
81 |
+
gr.Row(visible=True),
|
82 |
+
gr.Row(visible=True),
|
83 |
+
gr.Image(visible=True),
|
84 |
+
textbox_create_ui(
|
85 |
+
person_metadata_list[0],
|
86 |
+
"text",
|
87 |
+
"First name",
|
88 |
+
None,
|
89 |
+
None,
|
90 |
+
1,
|
91 |
+
True,
|
92 |
+
False,
|
93 |
+
True,
|
94 |
+
False,
|
95 |
+
1,
|
96 |
+
False,
|
97 |
+
),
|
98 |
+
gr.Row(visible=True),
|
99 |
+
gr.Image(visible=True),
|
100 |
+
textbox_create_ui(
|
101 |
+
person_metadata_list[1],
|
102 |
+
"text",
|
103 |
+
"Last name",
|
104 |
+
None,
|
105 |
+
None,
|
106 |
+
1,
|
107 |
+
True,
|
108 |
+
False,
|
109 |
+
True,
|
110 |
+
False,
|
111 |
+
1,
|
112 |
+
False,
|
113 |
+
),
|
114 |
+
gr.Row(visible=True),
|
115 |
+
gr.Row(visible=True),
|
116 |
+
gr.Image(visible=True),
|
117 |
+
textbox_create_ui(
|
118 |
+
person_metadata_list[2],
|
119 |
+
"email",
|
120 |
+
"Email",
|
121 |
+
None,
|
122 |
+
None,
|
123 |
+
1,
|
124 |
+
True,
|
125 |
+
False,
|
126 |
+
True,
|
127 |
+
False,
|
128 |
+
1,
|
129 |
+
False,
|
130 |
+
),
|
131 |
+
gr.Row(visible=True),
|
132 |
+
gr.Image(visible=True),
|
133 |
+
textbox_create_ui(
|
134 |
+
person_metadata_list[3],
|
135 |
+
"text",
|
136 |
+
"Phone number",
|
137 |
+
None,
|
138 |
+
None,
|
139 |
+
1,
|
140 |
+
True,
|
141 |
+
False,
|
142 |
+
True,
|
143 |
+
False,
|
144 |
+
1,
|
145 |
+
False,
|
146 |
+
),
|
147 |
+
)
|
148 |
+
else:
|
149 |
+
return (
|
150 |
+
gr.Column(visible=False),
|
151 |
+
gr.Row(visible=False),
|
152 |
+
gr.Row(visible=False),
|
153 |
+
gr.Image(visible=False),
|
154 |
+
textbox_create_ui(visible=False),
|
155 |
+
gr.Row(visible=False),
|
156 |
+
gr.Image(visible=False),
|
157 |
+
textbox_create_ui(visible=False),
|
158 |
+
gr.Row(visible=False),
|
159 |
+
gr.Row(visible=False),
|
160 |
+
gr.Image(visible=False),
|
161 |
+
textbox_create_ui(visible=False),
|
162 |
+
gr.Row(visible=False),
|
163 |
+
gr.Image(visible=False),
|
164 |
+
textbox_create_ui(visible=False),
|
165 |
+
)
|
166 |
+
|
167 |
+
|
168 |
def event_handler_calculate_practical_task_blocks(
|
169 |
files,
|
170 |
practical_subtasks,
|
|
|
232 |
compare_strings(short_mbti, mbti, False) for mbti in mbti_values
|
233 |
]
|
234 |
|
235 |
+
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
236 |
+
|
237 |
+
existing_tuple = (
|
238 |
gr.Row(visible=True),
|
239 |
gr.Column(visible=True),
|
240 |
dataframe(
|
|
|
264 |
visible=True,
|
265 |
elem_classes="mbti-dataframe",
|
266 |
),
|
267 |
+
gr.Column(visible=True),
|
268 |
video_create_ui(
|
269 |
value=files[person_id],
|
270 |
file_name=Path(files[person_id]).name,
|
|
|
274 |
),
|
275 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
276 |
)
|
277 |
+
|
278 |
+
return existing_tuple[:-1] + person_metadata + existing_tuple[-1:]
|
279 |
elif practical_subtasks.lower() == "professional groups":
|
280 |
sum_weights = sum(
|
281 |
[
|
|
|
307 |
gr.Accordion(visible=False),
|
308 |
gr.HTML(visible=False),
|
309 |
dataframe(visible=False),
|
310 |
+
gr.Column(visible=False),
|
311 |
video_create_ui(visible=False),
|
312 |
+
gr.Column(visible=False),
|
313 |
+
gr.Row(visible=False),
|
314 |
+
gr.Row(visible=False),
|
315 |
+
gr.Image(visible=False),
|
316 |
+
textbox_create_ui(visible=False),
|
317 |
+
gr.Row(visible=False),
|
318 |
+
gr.Image(visible=False),
|
319 |
+
textbox_create_ui(visible=False),
|
320 |
+
gr.Row(visible=False),
|
321 |
+
gr.Row(visible=False),
|
322 |
+
gr.Image(visible=False),
|
323 |
+
textbox_create_ui(visible=False),
|
324 |
+
gr.Row(visible=False),
|
325 |
+
gr.Image(visible=False),
|
326 |
+
textbox_create_ui(visible=False),
|
327 |
html_message(
|
328 |
config_data.InformationMessages_SUM_WEIGHTS.format(sum_weights),
|
329 |
False,
|
|
|
351 |
|
352 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
353 |
|
354 |
+
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
355 |
+
|
356 |
+
existing_tuple = (
|
357 |
gr.Row(visible=True),
|
358 |
gr.Column(visible=True),
|
359 |
dataframe(
|
|
|
374 |
gr.Accordion(visible=False),
|
375 |
gr.HTML(visible=False),
|
376 |
dataframe(visible=False),
|
377 |
+
gr.Column(visible=True),
|
378 |
video_create_ui(
|
379 |
value=files[person_id],
|
380 |
file_name=Path(files[person_id]).name,
|
|
|
384 |
),
|
385 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
386 |
)
|
387 |
+
|
388 |
+
return existing_tuple[:-1] + person_metadata + existing_tuple[-1:]
|
389 |
elif practical_subtasks.lower() == "professional skills":
|
390 |
df_professional_skills = read_csv_file(config_data.Links_PROFESSIONAL_SKILLS)
|
391 |
|
|
|
419 |
|
420 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
421 |
|
422 |
+
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
423 |
+
|
424 |
+
existing_tuple = (
|
425 |
gr.Row(visible=True),
|
426 |
gr.Column(visible=True),
|
427 |
dataframe(
|
|
|
442 |
gr.Accordion(visible=False),
|
443 |
gr.HTML(visible=False),
|
444 |
dataframe(visible=False),
|
445 |
+
gr.Column(visible=True),
|
446 |
video_create_ui(
|
447 |
value=files[person_id],
|
448 |
file_name=Path(files[person_id]).name,
|
|
|
452 |
),
|
453 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
454 |
)
|
455 |
+
|
456 |
+
return existing_tuple[:-1] + person_metadata + existing_tuple[-1:]
|
457 |
elif (
|
458 |
practical_subtasks.lower() == "finding a suitable junior colleague"
|
459 |
or practical_subtasks.lower() == "finding a suitable senior colleague"
|
|
|
489 |
|
490 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
491 |
|
492 |
+
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
493 |
+
|
494 |
+
existing_tuple = (
|
495 |
gr.Row(visible=True),
|
496 |
gr.Column(visible=True),
|
497 |
dataframe(
|
|
|
513 |
gr.Accordion(visible=False),
|
514 |
gr.HTML(visible=False),
|
515 |
dataframe(visible=False),
|
516 |
+
gr.Column(visible=True),
|
517 |
video_create_ui(
|
518 |
value=files[person_id],
|
519 |
file_name=Path(files[person_id]).name,
|
|
|
523 |
),
|
524 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
525 |
)
|
526 |
+
|
527 |
+
return existing_tuple[:-1] + person_metadata + existing_tuple[-1:]
|
528 |
elif (
|
529 |
practical_subtasks.lower() == "car characteristics"
|
530 |
or practical_subtasks.lower() == "mobile device application categories"
|
|
|
571 |
|
572 |
person_id = int(df_hidden.iloc[0]["Person ID"]) - 1
|
573 |
|
574 |
+
person_metadata = create_person_metadata(person_id, files, video_metadata)
|
575 |
+
|
576 |
+
existing_tuple = (
|
577 |
gr.Row(visible=True),
|
578 |
gr.Column(visible=True),
|
579 |
dataframe(
|
|
|
594 |
gr.Accordion(visible=False),
|
595 |
gr.HTML(visible=False),
|
596 |
dataframe(visible=False),
|
597 |
+
gr.Column(visible=True),
|
598 |
video_create_ui(
|
599 |
value=files[person_id],
|
600 |
file_name=Path(files[person_id]).name,
|
|
|
604 |
),
|
605 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
606 |
)
|
607 |
+
|
608 |
+
return existing_tuple[:-1] + person_metadata + existing_tuple[-1:]
|
609 |
else:
|
610 |
gr.Info(config_data.InformationMessages_NOTI_IN_DEV)
|
611 |
|
|
|
626 |
gr.Accordion(visible=False),
|
627 |
gr.HTML(visible=False),
|
628 |
dataframe(visible=False),
|
629 |
+
gr.Column(visible=False),
|
630 |
video_create_ui(visible=False),
|
631 |
+
gr.Column(visible=False),
|
632 |
+
gr.Row(visible=False),
|
633 |
+
gr.Row(visible=False),
|
634 |
+
gr.Image(visible=False),
|
635 |
+
textbox_create_ui(visible=False),
|
636 |
+
gr.Row(visible=False),
|
637 |
+
gr.Image(visible=False),
|
638 |
+
textbox_create_ui(visible=False),
|
639 |
+
gr.Row(visible=False),
|
640 |
+
gr.Row(visible=False),
|
641 |
+
gr.Image(visible=False),
|
642 |
+
textbox_create_ui(visible=False),
|
643 |
+
gr.Row(visible=False),
|
644 |
+
gr.Image(visible=False),
|
645 |
+
textbox_create_ui(visible=False),
|
646 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, True),
|
647 |
)
|
app/event_handlers/calculate_pt_scores_blocks.py
CHANGED
@@ -22,6 +22,7 @@ from app.components import (
|
|
22 |
number_create_ui,
|
23 |
dropdown_create_ui,
|
24 |
video_create_ui,
|
|
|
25 |
)
|
26 |
|
27 |
|
@@ -152,6 +153,22 @@ def event_handler_calculate_pt_scores_blocks(files, evt_data: gr.EventData):
|
|
152 |
gr.Accordion(visible=False),
|
153 |
gr.HTML(visible=False),
|
154 |
dataframe(visible=False),
|
|
|
155 |
video_create_ui(visible=False),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
157 |
)
|
|
|
22 |
number_create_ui,
|
23 |
dropdown_create_ui,
|
24 |
video_create_ui,
|
25 |
+
textbox_create_ui,
|
26 |
)
|
27 |
|
28 |
|
|
|
153 |
gr.Accordion(visible=False),
|
154 |
gr.HTML(visible=False),
|
155 |
dataframe(visible=False),
|
156 |
+
gr.Column(visible=False),
|
157 |
video_create_ui(visible=False),
|
158 |
+
gr.Column(visible=False),
|
159 |
+
gr.Row(visible=False),
|
160 |
+
gr.Row(visible=False),
|
161 |
+
gr.Image(visible=False),
|
162 |
+
textbox_create_ui(visible=False),
|
163 |
+
gr.Row(visible=False),
|
164 |
+
gr.Image(visible=False),
|
165 |
+
textbox_create_ui(visible=False),
|
166 |
+
gr.Row(visible=False),
|
167 |
+
gr.Row(visible=False),
|
168 |
+
gr.Image(visible=False),
|
169 |
+
textbox_create_ui(visible=False),
|
170 |
+
gr.Row(visible=False),
|
171 |
+
gr.Image(visible=False),
|
172 |
+
textbox_create_ui(visible=False),
|
173 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
174 |
)
|
app/event_handlers/clear_blocks.py
CHANGED
@@ -20,6 +20,7 @@ from app.components import (
|
|
20 |
radio_create_ui,
|
21 |
number_create_ui,
|
22 |
dropdown_create_ui,
|
|
|
23 |
)
|
24 |
|
25 |
|
@@ -119,6 +120,22 @@ def event_handler_clear_blocks():
|
|
119 |
gr.Accordion(visible=False),
|
120 |
gr.HTML(visible=False),
|
121 |
dataframe(visible=False),
|
|
|
122 |
video_create_ui(visible=False),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
124 |
)
|
|
|
20 |
radio_create_ui,
|
21 |
number_create_ui,
|
22 |
dropdown_create_ui,
|
23 |
+
textbox_create_ui,
|
24 |
)
|
25 |
|
26 |
|
|
|
120 |
gr.Accordion(visible=False),
|
121 |
gr.HTML(visible=False),
|
122 |
dataframe(visible=False),
|
123 |
+
gr.Column(visible=False),
|
124 |
video_create_ui(visible=False),
|
125 |
+
gr.Column(visible=False),
|
126 |
+
gr.Row(visible=False),
|
127 |
+
gr.Row(visible=False),
|
128 |
+
gr.Image(visible=False),
|
129 |
+
textbox_create_ui(visible=False),
|
130 |
+
gr.Row(visible=False),
|
131 |
+
gr.Image(visible=False),
|
132 |
+
textbox_create_ui(visible=False),
|
133 |
+
gr.Row(visible=False),
|
134 |
+
gr.Row(visible=False),
|
135 |
+
gr.Image(visible=False),
|
136 |
+
textbox_create_ui(visible=False),
|
137 |
+
gr.Row(visible=False),
|
138 |
+
gr.Image(visible=False),
|
139 |
+
textbox_create_ui(visible=False),
|
140 |
html_message(config_data.InformationMessages_NOTI_IN_DEV, False, False),
|
141 |
)
|
app/event_handlers/event_handlers.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
"""
|
2 |
File: event_handlers.py
|
3 |
-
Author: Dmitry Ryumin
|
4 |
Description: File containing functions for configuring event handlers for Gradio components.
|
5 |
License: MIT License
|
6 |
"""
|
@@ -69,11 +69,29 @@ def setup_app_event_handlers(
|
|
69 |
mbti_accordion,
|
70 |
mbti_description,
|
71 |
mbti_description_data,
|
|
|
72 |
video_sorted,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
in_development,
|
74 |
tab1,
|
75 |
tab2,
|
76 |
tab3,
|
|
|
|
|
77 |
languages,
|
78 |
):
|
79 |
# Events
|
@@ -138,7 +156,23 @@ def setup_app_event_handlers(
|
|
138 |
mbti_accordion,
|
139 |
mbti_description,
|
140 |
mbti_description_data,
|
|
|
141 |
video_sorted,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
in_development,
|
143 |
],
|
144 |
queue=True,
|
@@ -194,7 +228,23 @@ def setup_app_event_handlers(
|
|
194 |
mbti_accordion,
|
195 |
mbti_description,
|
196 |
mbti_description_data,
|
|
|
197 |
video_sorted,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
in_development,
|
199 |
],
|
200 |
queue=True,
|
@@ -278,7 +328,23 @@ def setup_app_event_handlers(
|
|
278 |
mbti_accordion,
|
279 |
mbti_description,
|
280 |
mbti_description_data,
|
|
|
281 |
video_sorted,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
282 |
in_development,
|
283 |
],
|
284 |
queue=True,
|
@@ -286,6 +352,24 @@ def setup_app_event_handlers(
|
|
286 |
practical_task_sorted.select(
|
287 |
event_handler_practical_task_sorted,
|
288 |
[files, practical_task_sorted],
|
289 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
290 |
queue=True,
|
291 |
)
|
|
|
1 |
"""
|
2 |
File: event_handlers.py
|
3 |
+
Author: Elena Ryumina and Dmitry Ryumin
|
4 |
Description: File containing functions for configuring event handlers for Gradio components.
|
5 |
License: MIT License
|
6 |
"""
|
|
|
69 |
mbti_accordion,
|
70 |
mbti_description,
|
71 |
mbti_description_data,
|
72 |
+
video_sorted_column,
|
73 |
video_sorted,
|
74 |
+
metadata,
|
75 |
+
metadata_1,
|
76 |
+
name_row,
|
77 |
+
name_logo,
|
78 |
+
name,
|
79 |
+
surname_row,
|
80 |
+
surname_logo,
|
81 |
+
surname,
|
82 |
+
metadata_2,
|
83 |
+
email_row,
|
84 |
+
email_logo,
|
85 |
+
email,
|
86 |
+
phone_row,
|
87 |
+
phone_logo,
|
88 |
+
phone,
|
89 |
in_development,
|
90 |
tab1,
|
91 |
tab2,
|
92 |
tab3,
|
93 |
+
languages_row,
|
94 |
+
country_flags,
|
95 |
languages,
|
96 |
):
|
97 |
# Events
|
|
|
156 |
mbti_accordion,
|
157 |
mbti_description,
|
158 |
mbti_description_data,
|
159 |
+
video_sorted_column,
|
160 |
video_sorted,
|
161 |
+
metadata,
|
162 |
+
metadata_1,
|
163 |
+
name_row,
|
164 |
+
name_logo,
|
165 |
+
name,
|
166 |
+
surname_row,
|
167 |
+
surname_logo,
|
168 |
+
surname,
|
169 |
+
metadata_2,
|
170 |
+
email_row,
|
171 |
+
email_logo,
|
172 |
+
email,
|
173 |
+
phone_row,
|
174 |
+
phone_logo,
|
175 |
+
phone,
|
176 |
in_development,
|
177 |
],
|
178 |
queue=True,
|
|
|
228 |
mbti_accordion,
|
229 |
mbti_description,
|
230 |
mbti_description_data,
|
231 |
+
video_sorted_column,
|
232 |
video_sorted,
|
233 |
+
metadata,
|
234 |
+
metadata_1,
|
235 |
+
name_row,
|
236 |
+
name_logo,
|
237 |
+
name,
|
238 |
+
surname_row,
|
239 |
+
surname_logo,
|
240 |
+
surname,
|
241 |
+
metadata_2,
|
242 |
+
email_row,
|
243 |
+
email_logo,
|
244 |
+
email,
|
245 |
+
phone_row,
|
246 |
+
phone_logo,
|
247 |
+
phone,
|
248 |
in_development,
|
249 |
],
|
250 |
queue=True,
|
|
|
328 |
mbti_accordion,
|
329 |
mbti_description,
|
330 |
mbti_description_data,
|
331 |
+
video_sorted_column,
|
332 |
video_sorted,
|
333 |
+
metadata,
|
334 |
+
metadata_1,
|
335 |
+
name_row,
|
336 |
+
name_logo,
|
337 |
+
name,
|
338 |
+
surname_row,
|
339 |
+
surname_logo,
|
340 |
+
surname,
|
341 |
+
metadata_2,
|
342 |
+
email_row,
|
343 |
+
email_logo,
|
344 |
+
email,
|
345 |
+
phone_row,
|
346 |
+
phone_logo,
|
347 |
+
phone,
|
348 |
in_development,
|
349 |
],
|
350 |
queue=True,
|
|
|
352 |
practical_task_sorted.select(
|
353 |
event_handler_practical_task_sorted,
|
354 |
[files, practical_task_sorted],
|
355 |
+
[
|
356 |
+
video_sorted_column,
|
357 |
+
video_sorted,
|
358 |
+
metadata,
|
359 |
+
metadata_1,
|
360 |
+
name_row,
|
361 |
+
name_logo,
|
362 |
+
name,
|
363 |
+
surname_row,
|
364 |
+
surname_logo,
|
365 |
+
surname,
|
366 |
+
metadata_2,
|
367 |
+
email_row,
|
368 |
+
email_logo,
|
369 |
+
email,
|
370 |
+
phone_row,
|
371 |
+
phone_logo,
|
372 |
+
phone,
|
373 |
+
],
|
374 |
queue=True,
|
375 |
)
|
app/event_handlers/examples_blocks.py
CHANGED
@@ -5,15 +5,26 @@ Description: Event handler for the addition of examples to the Gradio app.
|
|
5 |
License: MIT License
|
6 |
"""
|
7 |
|
|
|
|
|
|
|
8 |
# Importing necessary components for the Gradio app
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
def event_handler_examples_blocks():
|
12 |
-
|
13 |
-
|
14 |
-
"
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
"videos/video6.mp4",
|
19 |
-
]
|
|
|
5 |
License: MIT License
|
6 |
"""
|
7 |
|
8 |
+
import re
|
9 |
+
from pathlib import Path
|
10 |
+
|
11 |
# Importing necessary components for the Gradio app
|
12 |
|
13 |
+
# import hashlib
|
14 |
+
# import time
|
15 |
+
|
16 |
+
# for _ in range(6):
|
17 |
+
# current_time = time.time()
|
18 |
+
# time_bytes = str(current_time).encode("utf-8")
|
19 |
+
# hash_object = hashlib.sha256(time_bytes)
|
20 |
+
# hex_digest = hash_object.hexdigest()
|
21 |
+
# print(hex_digest[:15])
|
22 |
+
|
23 |
|
24 |
def event_handler_examples_blocks():
|
25 |
+
videos_dir = Path("videos")
|
26 |
+
video_files = sorted(
|
27 |
+
(str(p) for p in videos_dir.glob("*.mp4")),
|
28 |
+
key=lambda x: int(re.search(r"\d+", Path(x).stem).group()),
|
29 |
+
)
|
30 |
+
return video_files
|
|
|
|
app/event_handlers/files.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
"""
|
2 |
File: search.py
|
3 |
-
Author: Dmitry Ryumin
|
4 |
Description: Event handler for searching and filtering papers in the Gradio app.
|
5 |
License: MIT License
|
6 |
"""
|
|
|
1 |
"""
|
2 |
File: search.py
|
3 |
+
Author: Elena Ryumina and Dmitry Ryumin
|
4 |
Description: Event handler for searching and filtering papers in the Gradio app.
|
5 |
License: MIT License
|
6 |
"""
|
app/event_handlers/practical_task_sorted.py
CHANGED
@@ -9,7 +9,8 @@ import gradio as gr
|
|
9 |
from pathlib import Path
|
10 |
|
11 |
# Importing necessary components for the Gradio app
|
12 |
-
from app.
|
|
|
13 |
|
14 |
|
15 |
def event_handler_practical_task_sorted(
|
@@ -23,10 +24,106 @@ def event_handler_practical_task_sorted(
|
|
23 |
label = ""
|
24 |
label += " Person ID"
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
)
|
|
|
|
|
|
9 |
from pathlib import Path
|
10 |
|
11 |
# Importing necessary components for the Gradio app
|
12 |
+
from app.video_metadata import video_metadata
|
13 |
+
from app.components import video_create_ui, textbox_create_ui
|
14 |
|
15 |
|
16 |
def event_handler_practical_task_sorted(
|
|
|
24 |
label = ""
|
25 |
label += " Person ID"
|
26 |
|
27 |
+
if Path(files[person_id]).name in video_metadata:
|
28 |
+
person_metadata_list = video_metadata[Path(files[person_id]).name]
|
29 |
+
|
30 |
+
person_metadata = (
|
31 |
+
gr.Column(visible=True),
|
32 |
+
gr.Row(visible=True),
|
33 |
+
gr.Row(visible=True),
|
34 |
+
gr.Image(visible=True),
|
35 |
+
textbox_create_ui(
|
36 |
+
person_metadata_list[0],
|
37 |
+
"text",
|
38 |
+
"First name",
|
39 |
+
None,
|
40 |
+
None,
|
41 |
+
1,
|
42 |
+
True,
|
43 |
+
False,
|
44 |
+
True,
|
45 |
+
False,
|
46 |
+
1,
|
47 |
+
False,
|
48 |
+
),
|
49 |
+
gr.Row(visible=True),
|
50 |
+
gr.Image(visible=True),
|
51 |
+
textbox_create_ui(
|
52 |
+
person_metadata_list[1],
|
53 |
+
"text",
|
54 |
+
"Last name",
|
55 |
+
None,
|
56 |
+
None,
|
57 |
+
1,
|
58 |
+
True,
|
59 |
+
False,
|
60 |
+
True,
|
61 |
+
False,
|
62 |
+
1,
|
63 |
+
False,
|
64 |
+
),
|
65 |
+
gr.Row(visible=True),
|
66 |
+
gr.Row(visible=True),
|
67 |
+
gr.Image(visible=True),
|
68 |
+
textbox_create_ui(
|
69 |
+
person_metadata_list[2],
|
70 |
+
"email",
|
71 |
+
"Email",
|
72 |
+
None,
|
73 |
+
None,
|
74 |
+
1,
|
75 |
+
True,
|
76 |
+
False,
|
77 |
+
True,
|
78 |
+
False,
|
79 |
+
1,
|
80 |
+
False,
|
81 |
+
),
|
82 |
+
gr.Row(visible=True),
|
83 |
+
gr.Image(visible=True),
|
84 |
+
textbox_create_ui(
|
85 |
+
person_metadata_list[3],
|
86 |
+
"text",
|
87 |
+
"Phone number",
|
88 |
+
None,
|
89 |
+
None,
|
90 |
+
1,
|
91 |
+
True,
|
92 |
+
False,
|
93 |
+
True,
|
94 |
+
False,
|
95 |
+
1,
|
96 |
+
False,
|
97 |
+
),
|
98 |
+
)
|
99 |
+
else:
|
100 |
+
person_metadata = (
|
101 |
+
gr.Column(visible=False),
|
102 |
+
gr.Row(visible=False),
|
103 |
+
gr.Row(visible=False),
|
104 |
+
gr.Image(visible=False),
|
105 |
+
textbox_create_ui(visible=False),
|
106 |
+
gr.Row(visible=False),
|
107 |
+
gr.Image(visible=False),
|
108 |
+
textbox_create_ui(visible=False),
|
109 |
+
gr.Row(visible=False),
|
110 |
+
gr.Row(visible=False),
|
111 |
+
gr.Image(visible=False),
|
112 |
+
textbox_create_ui(visible=False),
|
113 |
+
gr.Row(visible=False),
|
114 |
+
gr.Image(visible=False),
|
115 |
+
textbox_create_ui(visible=False),
|
116 |
+
)
|
117 |
+
|
118 |
+
existing_tuple = (
|
119 |
+
gr.Column(visible=True),
|
120 |
+
video_create_ui(
|
121 |
+
value=files[person_id],
|
122 |
+
file_name=Path(files[person_id]).name,
|
123 |
+
label=f"{label} - " + str(person_id + 1),
|
124 |
+
visible=True,
|
125 |
+
elem_classes="video-sorted-container",
|
126 |
+
),
|
127 |
)
|
128 |
+
|
129 |
+
return existing_tuple + person_metadata
|
app/practical_tasks.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
"""
|
2 |
File: practical_tasks.py
|
3 |
-
Author: Dmitry Ryumin
|
4 |
Description: Utility functions for working with practical tasks data.
|
5 |
License: MIT License
|
6 |
"""
|
|
|
1 |
"""
|
2 |
File: practical_tasks.py
|
3 |
+
Author: Elena Ryumina and Dmitry Ryumin
|
4 |
Description: Utility functions for working with practical tasks data.
|
5 |
License: MIT License
|
6 |
"""
|
app/tabs.py
CHANGED
@@ -25,6 +25,7 @@ from app.components import (
|
|
25 |
radio_create_ui,
|
26 |
number_create_ui,
|
27 |
dropdown_create_ui,
|
|
|
28 |
)
|
29 |
|
30 |
|
@@ -426,9 +427,145 @@ def app_tab():
|
|
426 |
"csv-container",
|
427 |
)
|
428 |
|
429 |
-
|
430 |
-
|
431 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
|
433 |
practical_subtasks_selected = gr.JSON(
|
434 |
value={
|
@@ -485,7 +622,23 @@ def app_tab():
|
|
485 |
mbti_accordion,
|
486 |
mbti_description,
|
487 |
mbti_description_data,
|
|
|
488 |
video_sorted,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
489 |
in_development,
|
490 |
)
|
491 |
|
|
|
25 |
radio_create_ui,
|
26 |
number_create_ui,
|
27 |
dropdown_create_ui,
|
28 |
+
textbox_create_ui,
|
29 |
)
|
30 |
|
31 |
|
|
|
427 |
"csv-container",
|
428 |
)
|
429 |
|
430 |
+
with gr.Column(
|
431 |
+
scale=1,
|
432 |
+
visible=False,
|
433 |
+
render=True,
|
434 |
+
elem_classes="video-column-container",
|
435 |
+
) as video_sorted_column:
|
436 |
+
video_sorted = video_create_ui(
|
437 |
+
visible=False, elem_classes="video-sorted-container"
|
438 |
+
)
|
439 |
+
|
440 |
+
with gr.Column(scale=1, visible=False, render=True) as metadata:
|
441 |
+
with gr.Row(
|
442 |
+
visible=False, render=True, variant="default"
|
443 |
+
) as metadata_1:
|
444 |
+
with gr.Row(
|
445 |
+
visible=False,
|
446 |
+
render=True,
|
447 |
+
variant="default",
|
448 |
+
elem_classes="name-container",
|
449 |
+
) as name_row:
|
450 |
+
name_logo = gr.Image(
|
451 |
+
value="images/name.svg",
|
452 |
+
container=False,
|
453 |
+
interactive=False,
|
454 |
+
show_label=False,
|
455 |
+
visible=False,
|
456 |
+
show_download_button=False,
|
457 |
+
elem_classes="metadata_name-logo",
|
458 |
+
)
|
459 |
+
|
460 |
+
name = textbox_create_ui(
|
461 |
+
"First name",
|
462 |
+
"text",
|
463 |
+
"First name",
|
464 |
+
None,
|
465 |
+
None,
|
466 |
+
1,
|
467 |
+
True,
|
468 |
+
False,
|
469 |
+
False,
|
470 |
+
False,
|
471 |
+
1,
|
472 |
+
False,
|
473 |
+
)
|
474 |
+
|
475 |
+
with gr.Row(
|
476 |
+
visible=False,
|
477 |
+
render=True,
|
478 |
+
variant="default",
|
479 |
+
elem_classes="surname-container",
|
480 |
+
) as surname_row:
|
481 |
+
surname_logo = gr.Image(
|
482 |
+
value="images/name.svg",
|
483 |
+
container=False,
|
484 |
+
interactive=False,
|
485 |
+
show_label=False,
|
486 |
+
visible=False,
|
487 |
+
show_download_button=False,
|
488 |
+
elem_classes="metadata_surname-logo",
|
489 |
+
)
|
490 |
+
|
491 |
+
surname = textbox_create_ui(
|
492 |
+
"Last name",
|
493 |
+
"text",
|
494 |
+
"Last name",
|
495 |
+
None,
|
496 |
+
None,
|
497 |
+
1,
|
498 |
+
True,
|
499 |
+
False,
|
500 |
+
False,
|
501 |
+
False,
|
502 |
+
1,
|
503 |
+
False,
|
504 |
+
)
|
505 |
+
with gr.Row(
|
506 |
+
visible=False, render=True, variant="default"
|
507 |
+
) as metadata_2:
|
508 |
+
with gr.Row(
|
509 |
+
visible=False,
|
510 |
+
render=True,
|
511 |
+
variant="default",
|
512 |
+
elem_classes="email-container",
|
513 |
+
) as email_row:
|
514 |
+
email_logo = gr.Image(
|
515 |
+
value="images/email.svg",
|
516 |
+
container=False,
|
517 |
+
interactive=False,
|
518 |
+
show_label=False,
|
519 |
+
visible=False,
|
520 |
+
show_download_button=False,
|
521 |
+
elem_classes="metadata_email-logo",
|
522 |
+
)
|
523 |
+
|
524 |
+
email = textbox_create_ui(
|
525 |
+
"[email protected]",
|
526 |
+
"email",
|
527 |
+
"Email",
|
528 |
+
None,
|
529 |
+
None,
|
530 |
+
1,
|
531 |
+
True,
|
532 |
+
False,
|
533 |
+
False,
|
534 |
+
False,
|
535 |
+
1,
|
536 |
+
False,
|
537 |
+
)
|
538 |
+
|
539 |
+
with gr.Row(
|
540 |
+
visible=False,
|
541 |
+
render=True,
|
542 |
+
variant="default",
|
543 |
+
elem_classes="phone-container",
|
544 |
+
) as phone_row:
|
545 |
+
phone_logo = gr.Image(
|
546 |
+
value="images/phone.svg",
|
547 |
+
container=False,
|
548 |
+
interactive=False,
|
549 |
+
show_label=False,
|
550 |
+
visible=False,
|
551 |
+
show_download_button=False,
|
552 |
+
elem_classes="metadata_phone-logo",
|
553 |
+
)
|
554 |
+
|
555 |
+
phone = textbox_create_ui(
|
556 |
+
"+1 (555) 123-4567",
|
557 |
+
"text",
|
558 |
+
"Phone number",
|
559 |
+
None,
|
560 |
+
None,
|
561 |
+
1,
|
562 |
+
True,
|
563 |
+
False,
|
564 |
+
False,
|
565 |
+
False,
|
566 |
+
1,
|
567 |
+
False,
|
568 |
+
)
|
569 |
|
570 |
practical_subtasks_selected = gr.JSON(
|
571 |
value={
|
|
|
622 |
mbti_accordion,
|
623 |
mbti_description,
|
624 |
mbti_description_data,
|
625 |
+
video_sorted_column,
|
626 |
video_sorted,
|
627 |
+
metadata,
|
628 |
+
metadata_1,
|
629 |
+
name_row,
|
630 |
+
name_logo,
|
631 |
+
name,
|
632 |
+
surname_row,
|
633 |
+
surname_logo,
|
634 |
+
surname,
|
635 |
+
metadata_2,
|
636 |
+
email_row,
|
637 |
+
email_logo,
|
638 |
+
email,
|
639 |
+
phone_row,
|
640 |
+
phone_logo,
|
641 |
+
phone,
|
642 |
in_development,
|
643 |
)
|
644 |
|
app/video_metadata.py
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""
|
2 |
+
File: video_metadata.py
|
3 |
+
Author: Elena Ryumina and Dmitry Ryumin
|
4 |
+
Description: Utility functions for working with video metadata.
|
5 |
+
License: MIT License
|
6 |
+
"""
|
7 |
+
|
8 |
+
import yaml
|
9 |
+
from typing import List, Dict
|
10 |
+
|
11 |
+
# Importing necessary components for the Gradio app
|
12 |
+
|
13 |
+
|
14 |
+
def load_video_metadata(file_path: str) -> Dict[str, List]:
|
15 |
+
with open(file_path, "r") as file:
|
16 |
+
video_metadata = yaml.safe_load(file) or {}
|
17 |
+
result = {}
|
18 |
+
for key, value in video_metadata.get("video_metadata", {}).items():
|
19 |
+
alias = key.split("_")[0]
|
20 |
+
result[key] = value + [f"video{alias}"]
|
21 |
+
return result
|
22 |
+
|
23 |
+
|
24 |
+
yaml_file_path = "./video_metadata.yaml"
|
25 |
+
video_metadata = load_video_metadata(yaml_file_path)
|
config.toml
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
[AppSettings]
|
2 |
-
APP_VERSION = "0.8.
|
3 |
CSS_PATH = "app.css"
|
4 |
|
5 |
[InformationMessages]
|
@@ -70,8 +70,8 @@ POTENTIAL_CANDIDATES = "potential_candidates.csv"
|
|
70 |
MBTI_JOB = "mbti_job_match.csv"
|
71 |
|
72 |
[Settings]
|
73 |
-
LANGUAGES_EN = ["
|
74 |
-
LANGUAGES_RU = ["
|
75 |
SHORT_PROFESSIONAL_SKILLS = ["OPE", "CON", "EXT", "AGR", "NNEU"]
|
76 |
DROPDOWN_PROFESSIONAL_SKILLS = ["Analytical", "Interactive", "Routine", "Non-Routine"]
|
77 |
DROPDOWN_COLLEAGUES = ["major", "minor"]
|
@@ -95,6 +95,7 @@ DROPDOWN_MBTI = [
|
|
95 |
"The Commander (ENTJ): Construction Supervisor, Health Services Administrator, Financial Accountant, Auditor, Lawyer, School Principal, Chemical Engineer, Database Manager, etc.",
|
96 |
]
|
97 |
DROPDOWN_MBTI_DEL_COLS = ["EI", "SN", "TF", "JP", "Match"]
|
|
|
98 |
|
99 |
[Values]
|
100 |
TARGET_SCORES = [0.527886, 0.522337, 0.458468, 0.51761, 0.444649]
|
|
|
1 |
[AppSettings]
|
2 |
+
APP_VERSION = "0.8.3"
|
3 |
CSS_PATH = "app.css"
|
4 |
|
5 |
[InformationMessages]
|
|
|
70 |
MBTI_JOB = "mbti_job_match.csv"
|
71 |
|
72 |
[Settings]
|
73 |
+
LANGUAGES_EN = ["English", "Russian"]
|
74 |
+
LANGUAGES_RU = ["Английский", "Русский"]
|
75 |
SHORT_PROFESSIONAL_SKILLS = ["OPE", "CON", "EXT", "AGR", "NNEU"]
|
76 |
DROPDOWN_PROFESSIONAL_SKILLS = ["Analytical", "Interactive", "Routine", "Non-Routine"]
|
77 |
DROPDOWN_COLLEAGUES = ["major", "minor"]
|
|
|
95 |
"The Commander (ENTJ): Construction Supervisor, Health Services Administrator, Financial Accountant, Auditor, Lawyer, School Principal, Chemical Engineer, Database Manager, etc.",
|
96 |
]
|
97 |
DROPDOWN_MBTI_DEL_COLS = ["EI", "SN", "TF", "JP", "Match"]
|
98 |
+
SHOW_VIDEO_METADATA = true
|
99 |
|
100 |
[Values]
|
101 |
TARGET_SCORES = [0.527886, 0.522337, 0.458468, 0.51761, 0.444649]
|
images/RU.png
ADDED
images/UK.png
ADDED
images/email.svg
ADDED
images/name.svg
ADDED
images/phone.svg
ADDED
video_metadata.yaml
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
video_metadata:
|
2 |
+
1_9093a4ca3c0c834.mp4:
|
3 |
+
- Emily
|
4 |
+
- Taylor
|
5 | |
6 |
+
- "+1 (555) 456-7890"
|
7 |
+
2_a6a198e51d073b0.mp4:
|
8 |
+
- Michael
|
9 |
+
- Brown
|
10 | |
11 |
+
- "+1 (555) 234-5678"
|
12 |
+
3_9987232dd677712.mp4:
|
13 |
+
- Jack
|
14 |
+
- Smith
|
15 | |
16 |
+
- "+1 (555) 123-4567"
|
17 |
+
4_6af8f60549cdf8d.mp4:
|
18 |
+
- Olivia
|
19 |
+
- Johnson
|
20 | |
21 |
+
- "+1 (555) 567-8901"
|
22 |
+
5_7b6dc9535953642.mp4:
|
23 |
+
- David
|
24 |
+
- Miller
|
25 | |
26 |
+
- "+1 (555) 345-6789"
|
27 |
+
6_17a33049c100d3c.mp4:
|
28 |
+
- Sophia
|
29 |
+
- Wilson
|
30 | |
31 |
+
- "+1 (555) 678-9012"
|
videos/video1.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:1fc7060c6f5578d82b437f1e8eefdcb29bed3743de8b4d45f968b5906cda046f
|
3 |
-
size 410879
|
|
|
|
|
|
|
|
videos/video2.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:65d8756146c1e9a55f8d5136e52c794e2a78ec48e5dcfc71772cc456a39137fd
|
3 |
-
size 447193
|
|
|
|
|
|
|
|
videos/video3.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:740c54a4b06f143688e3d6edc6994e8c3da1cae4250f1c6c813e26539eda8c7f
|
3 |
-
size 384493
|
|
|
|
|
|
|
|
videos/video4.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:c594eb1f37acf257ba7f3c05e08cd685f00a16f20a1300a94221ab6e98a44806
|
3 |
-
size 880016
|
|
|
|
|
|
|
|
videos/video5.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:efd5cf92f221a89b1417da7dcf2ad73720d165c37bf131bd4f225214a65daac7
|
3 |
-
size 1060539
|
|
|
|
|
|
|
|
videos/video6.mp4
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b2c8159a5b28795f5255f8cb718244f74129394693844f54a3ce2fb35c73f65e
|
3 |
-
size 474402
|
|
|
|
|
|
|
|