(self, faceanalysis, image)
| 233 | CATEGORY = "InstantID" |
| 234 | |
| 235 | def preprocess_image(self, faceanalysis, image): |
| 236 | face_kps = extractFeatures(faceanalysis, image, extract_kps=True) |
| 237 | |
| 238 | if face_kps is None: |
| 239 | face_kps = torch.zeros_like(image) |
| 240 | print(f"\033[33mWARNING: no face detected, unable to extract the keypoints!\033[0m") |
| 241 | #raise Exception('Face Keypoints Image: No face detected.') |
| 242 | |
| 243 | return (face_kps,) |
| 244 | |
| 245 | def add_noise(image, factor): |
| 246 | seed = int(torch.sum(image).item()) % 1000000007 |
nothing calls this directly
no test coverage detected