MCPcopy
hub / github.com/Rudrabha/Wav2Lip / get_detections_for_batch

Method get_detections_for_batch

face_detection/api.py:64–79  ·  view source on GitHub ↗
(self, images)

Source from the content-addressed store, hash-verified

62 self.face_detector = face_detector_module.FaceDetector(device=device, verbose=verbose)
63
64 def get_detections_for_batch(self, images):
65 images = images[..., ::-1]
66 detected_faces = self.face_detector.detect_from_batch(images.copy())
67 results = []
68
69 for i, d in enumerate(detected_faces):
70 if len(d) == 0:
71 results.append(None)
72 continue
73 d = d[0]
74 d = np.clip(d, 0, None)
75
76 x1, y1, x2, y2 = map(int, d[:-1])
77 results.append((x1, y1, x2, y2))
78
79 return results

Callers 5

face_detectFunction · 0.95
process_video_fileFunction · 0.80
face_detectFunction · 0.80
rescale_framesFunction · 0.80
face_detectFunction · 0.80

Calls 1

detect_from_batchMethod · 0.80

Tested by

no test coverage detected