Formation of neural network architectures of models and downloading their weights to obtain the personality traits scores (video modality)


  • _b5.video_models_b5_ - Neural network models tf.keras.Model for obtaining the personality traits scores

Import required packages

[2]:
from oceanai.modules.lab.build import Run

Build

[3]:
_b5 = Run(
    lang = 'en', # Inference 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:04:19] OCEANAI - personaly 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

Formation of neural network architectures of models (FI V2)

[4]:
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:04:19] Formation of neural network architectures of models for obtaining the personality traits scores (video modality) …

— Runtime: 0.094 sec. —

Downloading weights of neural network models

[5]:
# Core settings
_b5.path_to_save_ = './models' # Directory to save the file
_b5.chunk_size_ = 2000000 # File download size from network in 1 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 = 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:04:19] Downloading the weights of neural network models to obtain the personality traits scores (video modality) …

[2023-12-14 21:04:19] File download “weights_2022-06-15_16-46-30.h5” (100.0%) … Openness

[2023-12-14 21:04:20] File download “weights_2022-06-15_16-48-50.h5” (100.0%) … Conscientiousness

[2023-12-14 21:04:20] File download “weights_2022-06-15_16-54-06.h5” (100.0%) … Extraversion

[2023-12-14 21:04:20] File download “weights_2022-06-15_17-02-03.h5” (100.0%) … Agreeableness

[2023-12-14 21:04:20] File download “weights_2022-06-15_17-06-15.h5” (100.0%) … Non-Neuroticism

— Runtime: 0.998 sec. —

Displaying the formed neural network architecture of the model

  • Openness

  • Conscientiousness

  • Extraversion

  • Agreeableness

  • Non-neuroticism

[6]:
_b5.video_models_b5_['openness'].summary()
Model: "model"
_________________________________________________________________
 Layer (type)                Output Shape              Param #
=================================================================
 input_1 (InputLayer)        [(None, 32)]              0

 dense_1 (Dense)             (None, 1)                 33

 activ_1 (Activation)        (None, 1)                 0

=================================================================
Total params: 33 (132.00 Byte)
Trainable params: 33 (132.00 Byte)
Non-trainable params: 0 (0.00 Byte)
_________________________________________________________________