batch["image"],
batch["landmarks"])
for face, filename, image, landmarks in generator:
face.landmarks_xy = [(int(round(pt[0])), int(round(pt[1]))) for pt in landmarks]
face.image = image
face.filename = filename
self._remove_invalid_keys(batch, ("detected_faces", "filename", "image"))
logger.trace("Item out: %s", {key: val
After Change
for face, landmarks in zip(batch["detected_faces"], batch["landmarks"]):
if not isinstance(landmarks, np.ndarray):
landmarks = np.array(landmarks)
face.landmarks_xy = np.rint(landmarks).astype("int32")
self._remove_invalid_keys(batch, ("detected_faces", "filename", "image"))
logger.trace("Item out: %s", {key: val
for key, val in batch.items()
if key != "image"})