mexca.postprocessing ==================== .. py:module:: mexca.postprocessing .. autoapi-nested-parse:: Post-process extracted emotion expression features. Attributes ---------- .. autoapisummary:: mexca.postprocessing.AU_REF mexca.postprocessing.LANDMARKS_REF Functions --------- .. autoapisummary:: mexca.postprocessing.split_list_columns mexca.postprocessing.get_face_speaker_mapping mexca.postprocessing.sub_labels Module Contents --------------- .. py:data:: AU_REF :value: [1, 2, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 32,... Names of facial action units. .. py:data:: LANDMARKS_REF Indices of facial landmarks. .. py:function:: split_list_columns(df: Union[polars.LazyFrame, polars.DataFrame], au_columns: Iterable, landmark_columns: Iterable) -> Union[polars.LazyFrame, polars.DataFrame] Split (nested) list columns into separate columns. :param df: Data frame with extracted emotion expression features as stored in :class:`Multimodal.features`. :type df: polars.LazyFrame or polars.DataFrame :param au_columns: Names for new facial action unit columns. :type au_columns: Iterable :param landmark_columns: Names for new landmark columns. :type landmark_columns: Iterable .. rubric:: Notes For example, :class:`Pipeline.apply()` returns a `polars.LazyFrame` with (nested) list columns `face_box`, `face_au`, and `face_landmarks` containing multiple coordinates or predictions for multiple facial action units per row. These can be split into separate columns which only contain a single value per row. .. py:function:: get_face_speaker_mapping(df: polars.DataFrame, face_label_column_name: str = 'face_label', speaker_label_column_name: str = 'segment_speaker_label') -> Dict[str, str] Get optimal mapping between face and speaker labels by counting overlapping frames. Uses the Hungarian algorithm to find an optimal mapping between face and speaker labels. :param df: Data frame with columns `face_label_column_name` and speaker_label_column_name`. :type df: polars.DataFrame :param face_label_column_name: Name of the face label column. :type face_label_column_name: str, default="face_label" :param speaker_label_column_name: Name of the speaker label column. :type speaker_label_column_name: str, default="segment_speaker_label" .. py:function:: sub_labels(df: Union[polars.LazyFrame, polars.DataFrame], mapping: Dict, column: str) -> Union[polars.LazyFrame, polars.DataFrame] Replace label column with labels from a mapping. df : polars.LazyFrame or polars.DataFrame Data frame with label column. mapping : dict Dictionary with mapping. column : str Name of label column in data frame.