data_juicer.ops.mapper.video_human_tracks_face_demographic_mapper module#

class data_juicer.ops.mapper.video_human_tracks_face_demographic_mapper.VideoHumantrackFaceDemographicMapper(*args, **kwargs)[源代码]#

基类:Mapper

Mapper to generate samples whose captions are generated based on a video-to-text model and sampled video frame.

Source: This operator is a part of HumanVBench (CVPR 2026).

__init__(original_data_save_path='./outputs/demographic', detect_interval: int = 5, tag_field_name: str = 'video_facetrack_attribute_demographic', *args, **kwargs)[源代码]#

Initialization method.

参数:

hf_video_blip -- video-blip model name on huggingface to generate caption

process_single(sample, rank=None)[源代码]#

For sample level, sample --> sample

参数:

sample -- sample to process

返回:

processed sample

find_median(int_list)[源代码]#

Finds the median of a list of integers.

参数:

int_list -- List of integers.

返回:

The median of the list.

most_frequent_element_ratio(str_list)[源代码]#

Finds the most frequent element in a list of strings and its proportion.

参数:

str_list -- List of strings.

返回:

A tuple (most_frequent_element, proportion).

top_3_emotions(emotion_list)[源代码]#

Calculates the average score for each emotion and returns the top 3 emotions with the highest average scores.

参数:

emotion_list -- List of dictionaries, each containing seven emotions and their corresponding scores.

返回:

List of tuples containing the top 3 emotions and their average scores.