Formation of the neural network architecture of the model and downloading its weights to obtain features / scores based on hand-crafted features (video modality)


  • _b5.video_model_hc_ - Neural network model tf.keras.Model for obtaining features / scores by hand-crafted features

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-10 17:11:13] 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.0a5    License: BSD License

Formation of the neural network architecture of the model (FI V2)

[4]:
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-10 17:11:13] Formation of the neural network architecture of the model for obtaining scores by hand-crafted features (video modality) …

— Runtime: 0.789 sec. —

Downloading the weights of the neural network model

[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 = _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-10 17:11:14] Downloading the weights of the neural network model to obtain scores by hand-crafted features (video modality) …

[2023-12-10 17:11:14] File download “weights_2022-08-27_18-53-35.h5” (100.0%) …

— Runtime: 0.226 sec. —

Displaying the formed neural network architecture of the model

[6]:
_b5.video_model_hc_.summary()
Model: "model_1"
_________________________________________________________________
 Layer (type)                Output Shape              Param #
=================================================================
 input_1 (InputLayer)        [(None, 10, 115)]         0

 lstm (LSTM)                 (None, 10, 64)            46080

 dropout (Dropout)           (None, 10, 64)            0

 lstm_128_v_hc (LSTM)        (None, 128)               98816

 dropout_1 (Dropout)         (None, 128)               0

 dense (Dense)               (None, 5)                 645

=================================================================
Total params: 145,541
Trainable params: 145,541
Non-trainable params: 0
_________________________________________________________________

Formation of the neural network architecture of the model (MuPTA)

[7]:
res_load_video_model_hc = _b5.load_video_model_hc(
    lang = 'ru', # 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-10 17:11:14] Formation of the neural network architecture of the model for obtaining scores by hand-crafted features (video modality) …

— Runtime: 0.25 sec. —

Downloading the weights of the neural network model

[8]:
# 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 = _b5.weights_for_big5_['video']['mupta']['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-10 17:11:14] Downloading the weights of the neural network model to obtain scores by hand-crafted features (video modality) …

[2023-12-10 17:11:15] File download “weights_2022-08-27_18-53-35.h5” (100.0%) …

— Runtime: 0.307 sec. —

Displaying the formed neural network architecture of the model

[9]:
_b5.video_model_hc_.summary()
Model: "model_3"
_________________________________________________________________
 Layer (type)                Output Shape              Param #
=================================================================
 input_2 (InputLayer)        [(None, 10, 109)]         0

 lstm_1 (LSTM)               (None, 10, 64)            44544

 dropout_2 (Dropout)         (None, 10, 64)            0

 lstm_128_v_hc (LSTM)        (None, 128)               98816

 dropout_3 (Dropout)         (None, 128)               0

 dense_1 (Dense)             (None, 5)                 645

=================================================================
Total params: 144,005
Trainable params: 144,005
Non-trainable params: 0
_________________________________________________________________