Handle empty faces in unidentified faces

This commit is contained in:
Shailesh Pandit 2021-12-25 14:22:38 +05:30
parent 8177cd336b
commit 72b2a6ad8b
2 changed files with 7 additions and 6 deletions

View file

@ -125,11 +125,12 @@ export function UnidentifiedFaces(props: { file: File }) {
return (
<FaceChipContainer>
{faceImages.map((faceImage, index) => (
<FaceChip key={index}>
<ImageBlobView blob={faceImage}></ImageBlobView>
</FaceChip>
))}
{faceImages &&
faceImages.map((faceImage, index) => (
<FaceChip key={index}>
<ImageBlobView blob={faceImage}></ImageBlobView>
</FaceChip>
))}
</FaceChipContainer>
);
}

View file

@ -273,7 +273,7 @@ export async function getUnidentifiedFaces(
);
const faceImages = mlFileData?.faces
.filter((f) => f.personId === null || f.personId === undefined)
?.filter((f) => f.personId === null || f.personId === undefined)
.map((f) => f.faceCrop?.image)
.filter((image) => image !== null && image !== undefined);