Getting video scores
Import required packages
[2]:
from oceanai.modules.lab.build import Run
Build
[3]:
_b5 = Run(
lang = 'en', # Interface language
color_simple = '#333', # Plain text color (hexadecimal code)
color_info = '#1776D2', # The color of the text containing the information (hexadecimal code)
color_err = '#FF0000', # Error text color (hexadecimal code)
color_true = '#008001', # Text color containing positive information (hexadecimal code)
bold_text = True, # Bold text
num_to_df_display = 30, # Number of rows to display in tables
text_runtime = 'Runtime', # Runtime text
metadata = True # Displaying information about library
)
[2023-12-14 21:05:26] OCEANAI - personality traits: Authors: Elena Ryumina [ryumina_ev@mail.ru] Dmitry Ryumin [dl_03.03.1991@mail.ru] Alexey Karpov [karpov@iias.spb.su] Maintainers: Elena Ryumina [ryumina_ev@mail.ru] Dmitry Ryumin [dl_03.03.1991@mail.ru] Version: 1.0.0a16 License: BSD License
Getting and displaying versions of installed libraries
_b5.df_pkgs_
- DataFrame with versions of installed libraries
[4]:
_b5.libs_vers(runtime = True, run = True)
Package | Version | |
---|---|---|
1 | TensorFlow | 2.15.0 |
2 | Keras | 2.15.0 |
3 | OpenCV | 4.8.1 |
4 | MediaPipe | 0.9.0 |
5 | NumPy | 1.26.2 |
6 | SciPy | 1.11.4 |
7 | Pandas | 2.1.3 |
8 | Scikit-learn | 1.3.2 |
9 | OpenSmile | 2.5.0 |
10 | Librosa | 0.10.1 |
11 | AudioRead | 3.0.1 |
12 | IPython | 8.18.1 |
13 | PyMediaInfo | 6.1.0 |
14 | Requests | 2.31.0 |
15 | JupyterLab | 4.0.9 |
16 | LIWC | 0.5.0 |
17 | Transformers | 4.36.0 |
18 | Sentencepiece | 0.1.99 |
19 | Torch | 2.0.1+cpu |
20 | Torchaudio | 2.0.2+cpu |
— Runtime: 0.005 sec. —
Formation of the neural network architecture of the model for obtaining scores by hand-crafted features
_b5.video_model_hc_
- Neural network model tf.keras.Model for obtaining scores by hand-crafted features
[5]:
res_load_video_model_hc = _b5.load_video_model_hc(
lang = 'en', # Language selection for models trained on First Impressions V2'en' and models trained on for MuPTA 'ru'
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:26] Formation of the neural network architecture of the model for obtaining scores by hand-crafted features (video modality) …
— Runtime: 0.321 sec. —
Downloading the weights of the neural network model to obtain scores by hand-crafted features
_b5.video_model_hc_
- Neural network model tf.keras.Model for obtaining scores by hand-crafted features
[6]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # File download size from network in one step
url = _b5.weights_for_big5_['video']['fi']['hc']['sberdisk']
res_load_video_model_weights_hc = _b5.load_video_model_weights_hc(
url = url, # Full path to the file with weights of the neural network model
force_reload = True, # Forced download of a file with weights of a neural network model from the network
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:27] Downloading the weights of the neural network model to obtain scores by hand-crafted features (video modality) …
[2023-12-14 21:05:27] File download “weights_2022-08-27_18-53-35.h5” (100.0%) …
— Runtime: 0.249 sec. —
Formation of neural network architecture for obtaining neural network features
_b5.video_model_deep_fe_
- Neural network model tf.keras.Model for obtaining deep features
[7]:
res_load_video_model_deep_fe = _b5.load_video_model_deep_fe(
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:27] Formation of neural network architecture for obtaining deep features (video modality) …
— Runtime: 0.823 sec. —
Downloading weights of a neural network model to obtain neural network features
_b5.video_model_deep_fe_
- Neural network model tf.keras.Model for obtaining deep features
[8]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # File download size from network in one step
url = _b5.weights_for_big5_['video']['fi']['fe']['sberdisk']
res_load_video_model_weights_deep_fe = _b5.load_video_model_weights_deep_fe(
url = url, # Full path to the file with weights of the neural network model
force_reload = True, # Forced download of a file with weights of a neural network model from the network
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:28] Downloading weights of a neural network model to obtain deep features (video modality) …
[2023-12-14 21:05:31] File download “weights_2022-11-01_12-27-07.h5” (100.0%) …
— Runtime: 3.342 sec. —
Formation of the neural network architecture of the model for obtaining scores by deep features
_b5.video_model_nn_
- Neural network model tf.keras.Model for obtaining scores by deep features
[9]:
res_load_video_model_nn = _b5.load_video_model_nn(
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:31] Formation of a neural network architecture for obtaining scores by deep features (video modality) …
— Runtime: 0.708 sec. —
Downloading the weights of the neural network model to obtain scores for deep features
_b5.video_model_nn_
- Neural network model tf.keras.Model for obtaining scores by deep features
[10]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # File download size from network in one step
url = _b5.weights_for_big5_['video']['fi']['nn']['sberdisk']
res_load_video_model_weights_nn = _b5.load_video_model_weights_nn(
url = url, # Full path to the file with weights of the neural network model
force_reload = False, # Forced download of a file with weights of a neural network model from the network
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:32] Downloading the weights of the neural network model to obtain scores for deep features (video modality) …
[2023-12-14 21:05:32] File downloading “weights_2022-03-22_16-31-48.h5”
— Runtime: 0.209 sec. —
Formation of neural network architectures of models for obtaining the personality traits scores
_b5.video_models_b5_
- Neural network models tf.keras.Model for obtaining the personality traits scores
[11]:
res_load_video_models_b5 = _b5.load_video_models_b5(
show_summary = False, # Displaying the formed neural network architecture of the model
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:32] Formation of neural network architectures of models for obtaining the personality traits acores (video modality) …
— Runtime: 0.046 sec. —
Downloading the weights of neural network models to obtain the personality traits scores
_b5.video_models_b5_
- Neural network models tf.keras.Model for obtaining the personality traits scores
[12]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # File download size from network in one step
url_openness = _b5.weights_for_big5_['video']['fi']['b5']['openness']['sberdisk']
url_conscientiousness = _b5.weights_for_big5_['video']['fi']['b5']['conscientiousness']['sberdisk']
url_extraversion = _b5.weights_for_big5_['video']['fi']['b5']['extraversion']['sberdisk']
url_agreeableness = _b5.weights_for_big5_['video']['fi']['b5']['agreeableness']['sberdisk']
url_non_neuroticism = _b5.weights_for_big5_['video']['fi']['b5']['non_neuroticism']['sberdisk']
res_load_video_models_weights_b5 = _b5.load_video_models_weights_b5(
url_openness = url_openness, # Openness
url_conscientiousness = url_conscientiousness, # Conscientiousness
url_extraversion = url_extraversion, # Extraversion
url_agreeableness = url_agreeableness, # Agreeableness
url_non_neuroticism = url_non_neuroticism, # Non-Neuroticism
force_reload = False, # Forced download of a file with weights of a neural network model from the network
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 21:05:32] Downloading the weights of neural network models to obtain the personality traits scores (video modality) …
[2023-12-14 21:05:32] File download “weights_2022-06-15_16-46-30.h5” Openness
[2023-12-14 21:05:32] File download “weights_2022-06-15_16-48-50.h5” Conscientiousness
[2023-12-14 21:05:33] File download “weights_2022-06-15_16-54-06.h5” Extraversion
[2023-12-14 21:05:33] File download “weights_2022-06-15_17-02-03.h5” Agreeableness
[2023-12-14 21:05:33] File download “weights_2022-06-15_17-06-15.h5” Non-Neuroticism
— Runtime: 1.013 sec. —
Getting scores (video modality)
_b5.df_files_
- DataFrame with data
_b5.df_accuracy_
- DataFrame with accuracy
[13]:
# Core settings
_b5.path_to_dataset_ = '/Users/dl/GitHub/oceanai/oceanai/dataset/First_Impression' # Dataset directory
# Directories not included in the selection
_b5.ignore_dirs_ = []
# Key names for DataFrame dataset
_b5.keys_dataset_ = ['Path', 'Openness', 'Conscientiousness', 'Extraversion', 'Agreeableness', 'Non-Neuroticism']
_b5.ext_ = ['.mp4'] # Search file extensions
_b5.path_to_logs_ = './logs' # Directory for saving LOG files
# Full path to the file containing the ground truth scores for the accuracy calculation
url_accuracy = _b5.true_traits_['fi']['sberdisk']
res_get_video_union_predictions = _b5.get_video_union_predictions(
depth = 2, # Hierarchy depth for receiving audio and video data
recursive = False, # Recursive data search
reduction_fps = 5, # Frame rate reduction
window = 10, # РSignal segment window size (in seconds)
step = 5, # Signal segment window shift step (in seconds)
lang = 'en', # Language selection for models trained on First Impressions V2'en' and models trained on for MuPTA 'ru'
accuracy = True, # Accuracy calculation
url_accuracy = url_accuracy,
logs = True, # If necessary, generate a LOG file
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2023-12-14 22:24:55] Getting scores and accuracy calculation (video modality) …
2000 from 2000 (100.0%) … test80_25_Q4wOgixh7E.004.mp4 …
Path | Openness | Conscientiousness | Extraversion | Agreeableness | Non-Neuroticism | |
---|---|---|---|---|---|---|
ID | ||||||
1 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.526971 | 0.460063 | 0.422793 | 0.502726 | 0.450519 |
2 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.559385 | 0.432843 | 0.504231 | 0.578673 | 0.513424 |
3 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.466969 | 0.51701 | 0.331863 | 0.451395 | 0.406188 |
4 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.626113 | 0.597363 | 0.564068 | 0.574056 | 0.589245 |
5 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.5925 | 0.507246 | 0.505394 | 0.585405 | 0.493066 |
6 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.671855 | 0.642559 | 0.614689 | 0.613508 | 0.619511 |
7 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.411555 | 0.394029 | 0.329323 | 0.488684 | 0.39105 |
8 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.583696 | 0.568682 | 0.505574 | 0.625314 | 0.587337 |
9 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.551353 | 0.450333 | 0.449763 | 0.495501 | 0.438009 |
10 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.575084 | 0.517972 | 0.46315 | 0.582468 | 0.537961 |
11 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.559182 | 0.398618 | 0.433806 | 0.480592 | 0.492383 |
12 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.50948 | 0.432549 | 0.3319 | 0.495221 | 0.486891 |
13 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.330026 | 0.322635 | 0.235595 | 0.369766 | 0.25056 |
14 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.649351 | 0.550074 | 0.502858 | 0.526621 | 0.566755 |
15 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.651914 | 0.83048 | 0.535514 | 0.695223 | 0.734383 |
16 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.523986 | 0.435594 | 0.382946 | 0.41001 | 0.466265 |
17 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.575113 | 0.678301 | 0.468646 | 0.602139 | 0.626021 |
18 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.566349 | 0.558975 | 0.462116 | 0.606252 | 0.569516 |
19 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.672282 | 0.6552 | 0.656699 | 0.627328 | 0.663199 |
20 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.684442 | 0.602593 | 0.680469 | 0.635343 | 0.652304 |
21 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.550788 | 0.492015 | 0.404885 | 0.562745 | 0.478233 |
22 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.525446 | 0.469039 | 0.428517 | 0.491442 | 0.45359 |
23 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.473489 | 0.442729 | 0.353017 | 0.447929 | 0.358706 |
24 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.667829 | 0.655159 | 0.603695 | 0.630121 | 0.614812 |
25 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.469207 | 0.594029 | 0.364701 | 0.522734 | 0.481228 |
26 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.625514 | 0.641622 | 0.514204 | 0.547718 | 0.54766 |
27 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.568821 | 0.524382 | 0.475687 | 0.520644 | 0.531275 |
28 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.696397 | 0.665074 | 0.70902 | 0.655993 | 0.689747 |
29 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.578405 | 0.577321 | 0.487293 | 0.557221 | 0.52153 |
30 | E:\Databases\FirstImpressionsV2\test\test80_01... | 0.637576 | 0.587702 | 0.614512 | 0.637398 | 0.613861 |
[2023-12-14 22:24:55] Trait-wise accuracy …
Openness | Conscientiousness | Extraversion | Agreeableness | Non-Neuroticism | Mean | |
---|---|---|---|---|---|---|
Metrics | ||||||
MAE | 0.0873 | 0.082 | 0.0805 | 0.087 | 0.0872 | 0.0848 |
Accuracy | 0.9127 | 0.918 | 0.9195 | 0.913 | 0.9128 | 0.9152 |
[2023-12-14 22:24:55] Mean absolute error: 0.0848, Accuracy: 0.9152 …
Log files saved successfully …
— Runtime: 4762.254 sec. —