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)[source]#
Bases:
MapperMapper 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)[source]#
Initialization method.
- Parameters:
hf_video_blip â video-blip model name on huggingface to generate caption
- process_single(sample, rank=None)[source]#
For sample level, sample â> sample
- Parameters:
sample â sample to process
- Returns:
processed sample
- find_median(int_list)[source]#
Finds the median of a list of integers.
- Parameters:
int_list â List of integers.
- Returns:
The median of the list.
- most_frequent_element_ratio(str_list)[source]#
Finds the most frequent element in a list of strings and its proportion.
- Parameters:
str_list â List of strings.
- Returns:
A tuple (most_frequent_element, proportion).
- top_3_emotions(emotion_list)[source]#
Calculates the average score for each emotion and returns the top 3 emotions with the highest average scores.
- Parameters:
emotion_list â List of dictionaries, each containing seven emotions and their corresponding scores.
- Returns:
List of tuples containing the top 3 emotions and their average scores.