Extracting features from a visual signal
Import required packages
[2]:
from oceanai.modules.lab.build import Run
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
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
)
[2024-03-28 21:50:44] OCEANAI - персональные качества личности человека: Авторы: Рюмина Елена [ryumina_ev@mail.ru] Рюмин Дмитрий [dl_03.03.1991@mail.ru] Карпов Алексей [karpov@iias.spb.su] Сопровождающие: Рюмина Елена [ryumina_ev@mail.ru] Рюмин Дмитрий [dl_03.03.1991@mail.ru] Версия: 1.0.0a22 Лицензия: BSD License
Formation of the neural network architecture of the model
[4]:
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
)
[2024-03-28 21:50:46] Формирование нейросетевой архитектуры для получения нейросетевых признаков (видео модальность) …
— Время выполнения: 1.001 сек. —
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']['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
)
[2024-03-28 21:50:50] Загрузка весов нейросетевой модели для получения нейросетевых признаков (видео модальность) …
[2024-03-28 21:50:56] Загрузка файла “weights_2022-11-01_12-27-07.h5” 100.0% …
— Время выполнения: 6.461 сек. —
Process of extracting visual features (FI V2
)
[6]:
# Core settings
# Path to video file
path = 'video_FI/test/_plk5k7PBEg.003.mp4'
hc_features, nn_features = _b5.get_visual_features(
path = path, # Path to video file
reduction_fps = 5, # Frame rate reduction
window = 10, # Signal segment window size (in frames)
step = 5, # Signal segment window shift step (frames)
lang = 'en', # Language selection for models trained on First Impressions V2 'en' and models trained on for MuPTA 'ru'
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2024-03-28 21:50:58] Извлечение признаков (экспертных и нейросетевых) из визуального сигнала …
[2024-03-28 21:51:22] Статистика извлеченных признаков из визуального сигнала: Общее количество сегментов с: 1. экспертными признаками: 16 2. нейросетевыми признаками: 16 Размерность матрицы экспертных признаков одного сегмента: 10 ✕ 115 Размерность матрицы с нейросетевыми признаками одного сегмента: 10 ✕ 512 Понижение кадровой частоты: с 30 до 5
— Время выполнения: 23.465 сек. —
Process of extracting visual features (MuPTA
)
[7]:
# Core settings
# Path to video file
path = 'video_FI/test/_plk5k7PBEg.003.mp4'
hc_features, nn_features = _b5.get_visual_features(
path = path, # Path to video file
reduction_fps = 5, # Frame rate reduction
window = 10, # Signal segment window size (in frames)
step = 5, # Signal segment window shift step (frames)
lang = 'ru', # Language selection for models trained on First Impressions V2 'en' and models trained on for MuPTA 'ru'
out = True, # Display
runtime = True, # Runtime count
run = True # Run blocking
)
[2024-03-28 21:51:25] Извлечение признаков (экспертных и нейросетевых) из визуального сигнала …
[2024-03-28 21:51:43] Статистика извлеченных признаков из визуального сигнала: Общее количество сегментов с: 1. экспертными признаками: 16 2. нейросетевыми признаками: 16 Размерность матрицы экспертных признаков одного сегмента: 10 ✕ 109 Размерность матрицы с нейросетевыми признаками одного сегмента: 10 ✕ 512 Понижение кадровой частоты: с 30 до 5
— Время выполнения: 18.659 сек. —
[ ]: