DmitryRyumin commited on
Commit
d02f294
β€’
1 Parent(s): 1c88661
app.py CHANGED
@@ -92,7 +92,7 @@ if __name__ == "__main__":
92
  free_ports(port)
93
 
94
  create_gradio_app().queue(api_open=False).launch(
95
- share=True,
96
  server_name=config_data.AppSettings_SERVER_NAME,
97
  server_port=config_data.AppSettings_PORT,
98
  )
 
92
  free_ports(port)
93
 
94
  create_gradio_app().queue(api_open=False).launch(
95
+ share=False,
96
  server_name=config_data.AppSettings_SERVER_NAME,
97
  server_port=config_data.AppSettings_PORT,
98
  )
app/event_handlers/calculate_practical_tasks.py CHANGED
@@ -733,7 +733,7 @@ def event_handler_calculate_practical_task_blocks(
733
  elif (
734
  practical_subtasks.lower() == "car characteristics"
735
  or practical_subtasks.lower() == "mobile device application categories"
736
- or practical_subtasks.lower() == "clothing style correlation"
737
  ):
738
  if practical_subtasks.lower() == "car characteristics":
739
  df_correlation_coefficients = read_csv_file(
@@ -744,9 +744,13 @@ def event_handler_calculate_practical_task_blocks(
744
  df_correlation_coefficients = read_csv_file(
745
  config_data.Links_MDA_CATEGORIES
746
  )
747
- elif practical_subtasks.lower() == "clothing style correlation":
748
  df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
749
 
 
 
 
 
750
  pt_scores_copy = pt_scores.iloc[:, 1:].copy()
751
 
752
  preprocess_scores_df(pt_scores_copy, config_data.Dataframes_PT_SCORES[0][0])
@@ -768,13 +772,37 @@ def event_handler_calculate_practical_task_blocks(
768
 
769
  preprocess_scores_df(df, config_data.Dataframes_PT_SCORES[0][0])
770
 
771
- df_hidden = df.drop(columns=config_data.Settings_SHORT_PROFESSIONAL_SKILLS)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
772
 
773
  df_hidden.to_csv(consumer_preferences(practical_subtasks))
774
 
775
- df_hidden.reset_index(inplace=True)
 
 
 
776
 
777
- person_id = int(df_hidden.iloc[0][config_data.Dataframes_PT_SCORES[0][0]]) - 1
 
 
 
 
 
778
 
779
  person_metadata = create_person_metadata(person_id, files, video_metadata)
780
 
 
733
  elif (
734
  practical_subtasks.lower() == "car characteristics"
735
  or practical_subtasks.lower() == "mobile device application categories"
736
+ or practical_subtasks.lower() == "clothing styles"
737
  ):
738
  if practical_subtasks.lower() == "car characteristics":
739
  df_correlation_coefficients = read_csv_file(
 
744
  df_correlation_coefficients = read_csv_file(
745
  config_data.Links_MDA_CATEGORIES
746
  )
747
+ elif practical_subtasks.lower() == "clothing styles":
748
  df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
749
 
750
+ if type_modes == config_data.Settings_TYPE_MODES[1]:
751
+ number_priority = df_correlation_coefficients.columns.size - 1
752
+ number_importance_traits = 5
753
+
754
  pt_scores_copy = pt_scores.iloc[:, 1:].copy()
755
 
756
  preprocess_scores_df(pt_scores_copy, config_data.Dataframes_PT_SCORES[0][0])
 
772
 
773
  preprocess_scores_df(df, config_data.Dataframes_PT_SCORES[0][0])
774
 
775
+ if type_modes == config_data.Settings_TYPE_MODES[0]:
776
+ del_cols = []
777
+ elif type_modes == config_data.Settings_TYPE_MODES[1]:
778
+ del_cols = config_data.Settings_DROPDOWN_MBTI_DEL_COLS_WEBCAM
779
+
780
+ df_hidden = df.drop(
781
+ columns=config_data.Settings_SHORT_PROFESSIONAL_SKILLS + del_cols
782
+ )
783
+
784
+ if type_modes == config_data.Settings_TYPE_MODES[1]:
785
+ df_hidden = df_hidden.T
786
+
787
+ df_hidden = df_hidden.head(-number_importance_traits)
788
+
789
+ df_hidden = df_hidden.reset_index()
790
+
791
+ df_hidden.columns = ["Category", "Priority"]
792
 
793
  df_hidden.to_csv(consumer_preferences(practical_subtasks))
794
 
795
+ df_hidden.reset_index(
796
+ drop=True if type_modes == config_data.Settings_TYPE_MODES[1] else False,
797
+ inplace=True,
798
+ )
799
 
800
+ if type_modes == config_data.Settings_TYPE_MODES[0]:
801
+ person_id = (
802
+ int(df_hidden.iloc[0][config_data.Dataframes_PT_SCORES[0][0]]) - 1
803
+ )
804
+ elif type_modes == config_data.Settings_TYPE_MODES[1]:
805
+ person_id = 0
806
 
807
  person_metadata = create_person_metadata(person_id, files, video_metadata)
808
 
app/event_handlers/practical_subtasks.py CHANGED
@@ -318,7 +318,7 @@ def event_handler_practical_subtasks(
318
  elif (
319
  practical_subtasks.lower() == "car characteristics"
320
  or practical_subtasks.lower() == "mobile device application categories"
321
- or practical_subtasks.lower() == "clothing style correlation"
322
  ):
323
  if practical_subtasks.lower() == "car characteristics":
324
 
@@ -333,12 +333,12 @@ def event_handler_practical_subtasks(
333
  config_data.Links_MDA_CATEGORIES
334
  )
335
 
336
- elif practical_subtasks.lower() == "clothing style correlation":
337
  df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
338
 
339
  return (
340
  practical_subtasks_selected,
341
- gr.Column(visible=True),
342
  dropdown_create_ui(visible=False),
343
  number_create_ui(visible=False),
344
  number_create_ui(visible=False),
@@ -369,7 +369,7 @@ def event_handler_practical_subtasks(
369
  ),
370
  show_label=True,
371
  interactive=True,
372
- visible=True,
373
  render=True,
374
  elem_classes="number-container",
375
  ),
@@ -382,7 +382,7 @@ def event_handler_practical_subtasks(
382
  info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(1, 5),
383
  show_label=True,
384
  interactive=True,
385
- visible=True,
386
  render=True,
387
  elem_classes="number-container",
388
  ),
@@ -395,7 +395,7 @@ def event_handler_practical_subtasks(
395
  info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
396
  show_label=True,
397
  interactive=True,
398
- visible=True,
399
  render=True,
400
  elem_classes="number-container",
401
  ),
 
318
  elif (
319
  practical_subtasks.lower() == "car characteristics"
320
  or practical_subtasks.lower() == "mobile device application categories"
321
+ or practical_subtasks.lower() == "clothing styles"
322
  ):
323
  if practical_subtasks.lower() == "car characteristics":
324
 
 
333
  config_data.Links_MDA_CATEGORIES
334
  )
335
 
336
+ elif practical_subtasks.lower() == "clothing styles":
337
  df_correlation_coefficients = read_csv_file(config_data.Links_CLOTHING_SC)
338
 
339
  return (
340
  practical_subtasks_selected,
341
+ gr.Column(visible=visible_subtasks),
342
  dropdown_create_ui(visible=False),
343
  number_create_ui(visible=False),
344
  number_create_ui(visible=False),
 
369
  ),
370
  show_label=True,
371
  interactive=True,
372
+ visible=visible_subtasks,
373
  render=True,
374
  elem_classes="number-container",
375
  ),
 
382
  info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(1, 5),
383
  show_label=True,
384
  interactive=True,
385
+ visible=visible_subtasks,
386
  render=True,
387
  elem_classes="number-container",
388
  ),
 
395
  info=config_data.InformationMessages_VALUE_FROM_TO_INFO.format(0, 1.0),
396
  show_label=True,
397
  interactive=True,
398
+ visible=visible_subtasks,
399
  render=True,
400
  elem_classes="number-container",
401
  ),
config.toml CHANGED
@@ -1,5 +1,5 @@
1
  [AppSettings]
2
- APP_VERSION = "0.10.7"
3
  SERVER_NAME = "127.0.0.1"
4
  PORT = 7860
5
  CSS_PATH = "app.css"
 
1
  [AppSettings]
2
+ APP_VERSION = "0.10.8"
3
  SERVER_NAME = "127.0.0.1"
4
  PORT = 7860
5
  CSS_PATH = "app.css"
practical_tasks_en.yaml CHANGED
@@ -11,4 +11,4 @@
11
  subtasks:
12
  - "Car characteristics"
13
  - "Mobile device application categories"
14
- - "Clothing style correlation"
 
11
  subtasks:
12
  - "Car characteristics"
13
  - "Mobile device application categories"
14
+ - "Clothing styles"