Video analysis

class apps.expert.core.aggression.video_aggression.video_analysis.VideoAggression(video_path: str | PathLike, features_path: str | PathLike, device: torch.device | None = None, duration: int = 10, static_image_mode: bool = False, max_num_faces: int = 1, refine_landmarks: bool = True, min_detection_confidence: float = 0.5, min_tracking_confidence: float = 0.5, output_dir: str | PathLike | None = None)[source]

Bases: object

Extraction of aggression markers by video channel.

Parameters:
  • video_path (str | PathLike) – Path to the local video file.

  • features_path (str | PathLike) – Path to the result of feature extraction module.

  • face_image (str | PathLike) – Path to the face image selected by user.

  • device (torch.device | None, optional) – Device type on local machine (GPU recommended). Defaults to None.

  • duration – Length of intervals for extracting features. Defaults to 10.

  • static_image_mode (int, optional) – Whether to treat the input images as a batch of static and possibly unrelated images or a video stream. Defaults to False.

  • max_num_faces (int, optional) – Maximum number of faces to detect. Defaults to 1.

  • refine_landmarks (bool, optional) – Whether to further refine the landmark coordinates around the eyes, lips and output additional landmarks around the irises. Defaults to True.

  • min_detection_confidence (float, optional) – Minimum confidence value ([0.0, 1.0]) for face detection to be considered successful. Defaults to 0.5.

  • min_tracking_confidence (float, optional) – Minimum confidence value ([0.0, 1.0]) for the face landmarks to be considered tracked successfully. Defaults to 0.5.

property device: device

Check the device type.

Returns:

Device type on local machine.

Return type:

torch.device

mesh_detection() List[source]

Determination of face mesh landmarks on video.

get_report() Tuple[List, List, str][source]

Determination of aggression markers on video.