Initialize the AnalyzeFace class with the given device, config file, and checkpoint file. Parameters: device (Union[str, torch.device]): The device to run the models on ('cuda' or 'cpu'). config_file (str): Path to the mmpose model configuration file. checkp
(self, device: Union[str, torch.device], config_file: str, checkpoint_file: str)
| 32 | |
| 33 | class AnalyzeFace: |
| 34 | def __init__(self, device: Union[str, torch.device], config_file: str, checkpoint_file: str): |
| 35 | """ |
| 36 | Initialize the AnalyzeFace class with the given device, config file, and checkpoint file. |
| 37 | |
| 38 | Parameters: |
| 39 | device (Union[str, torch.device]): The device to run the models on ('cuda' or 'cpu'). |
| 40 | config_file (str): Path to the mmpose model configuration file. |
| 41 | checkpoint_file (str): Path to the mmpose model checkpoint file. |
| 42 | """ |
| 43 | self.device = device |
| 44 | self.dwpose = init_model(config_file, checkpoint_file, device=self.device) |
| 45 | self.facedet = FaceAlignment(LandmarksType._2D, flip_input=False, device=self.device) |
| 46 | |
| 47 | def __call__(self, im: np.ndarray) -> Tuple[List[np.ndarray], np.ndarray]: |
| 48 | """ |
nothing calls this directly
no test coverage detected