Skip to content

FaceConfig

Bases: ModelConfigBase[FaceConfig]

Configuration for the facial expression model.

Parameters:

Name Type Description Default
fps_pred Optional[float]

Number of frames per second to process. Other frames will be omitted from the response. This configuration is not available for the streaming API.

None
prob_threshold Optional[float]

Face detection probability threshold. Faces detected with a probability less than this threshold will be omitted from the response. This configuration is not available for the streaming API.

None
identify_faces Optional[bool]

Whether to return identifiers for faces across frames. If true, unique identifiers will be assigned to face bounding boxes to differentiate different faces. If false, all faces will be tagged with an "unknown" ID.

None
min_face_size Optional[float]

Minimum bounding box side length in pixels to treat as a face. Faces detected with a bounding box side length in pixels less than this threshold will be omitted from the response. This configuration is not available for the streaming API.

None
save_faces Optional[bool]

Whether to extract and save the detected faces to the artifacts directory included in the response. This configuration is not available for the streaming API.

None
descriptions Optional[Dict[str, Any]]

Configuration for Descriptions predictions. If missing or null, no Descriptions predictions will be generated.

None
facs Optional[Dict[str, Any]]

Configuration for FACS predictions. If missing or null, no FACS predictions will be generated.

None
Source code in hume/models/config/face_config.py
@dataclass
class FaceConfig(ModelConfigBase["FaceConfig"]):
    """Configuration for the facial expression model.

    Args:
        fps_pred (Optional[float]): Number of frames per second to process. Other frames will be omitted
            from the response.
            This configuration is not available for the streaming API.
        prob_threshold (Optional[float]): Face detection probability threshold. Faces detected with a
            probability less than this threshold will be omitted from the response.
            This configuration is not available for the streaming API.
        identify_faces (Optional[bool]): Whether to return identifiers for faces across frames.
            If true, unique identifiers will be assigned to face bounding boxes to differentiate different faces.
            If false, all faces will be tagged with an "unknown" ID.
        min_face_size (Optional[float]): Minimum bounding box side length in pixels to treat as a face.
            Faces detected with a bounding box side length in pixels less than this threshold will be
            omitted from the response.
            This configuration is not available for the streaming API.
        save_faces (Optional[bool]): Whether to extract and save the detected faces to the artifacts
            directory included in the response.
            This configuration is not available for the streaming API.
        descriptions (Optional[Dict[str, Any]]): Configuration for Descriptions predictions.
            If missing or null, no Descriptions predictions will be generated.
        facs (Optional[Dict[str, Any]]): Configuration for FACS predictions.
            If missing or null, no FACS predictions will be generated.
    """

    fps_pred: Optional[float] = None
    prob_threshold: Optional[float] = None
    identify_faces: Optional[bool] = None
    min_face_size: Optional[float] = None
    save_faces: Optional[bool] = None
    descriptions: Optional[Dict[str, Any]] = None
    facs: Optional[Dict[str, Any]] = None

    @classmethod
    def get_model_type(cls) -> ModelType:
        """Get the configuration model type.

        Returns:
            ModelType: Model type.
        """
        return ModelType.FACE

get_model_type() classmethod

Get the configuration model type.

Returns:

Name Type Description
ModelType ModelType

Model type.

Source code in hume/models/config/face_config.py
@classmethod
def get_model_type(cls) -> ModelType:
    """Get the configuration model type.

    Returns:
        ModelType: Model type.
    """
    return ModelType.FACE