This commit is contained in:
Manav Rathi
2024-08-29 18:42:17 +05:30
parent cd69e00451
commit 89a5a9f42f

View File

@@ -387,16 +387,14 @@ export const wipClusterDebugPageContents = async (): Promise<
const fileForFace = ({ faceID }: Face) =>
ensure(localFileByID.get(ensure(fileIDFromFaceID(faceID))));
const faceFNs = faceAndNeigbours
.map(({ face, neighbours }) => ({
const faceFNs = faceAndNeigbours.map(({ face, neighbours }) => ({
face,
neighbours: neighbours.map(({ face, cosineSimilarity }) => ({
face,
neighbours: neighbours.map(({ face, cosineSimilarity }) => ({
face,
enteFile: fileForFace(face),
cosineSimilarity,
})),
}))
.sort((a, b) => b.face.score - a.face.score);
enteFile: fileForFace(face),
cosineSimilarity,
})),
}));
const clusterIDForFaceID = new Map(
clusters.flatMap((cluster) =>
@@ -408,12 +406,7 @@ export const wipClusterDebugPageContents = async (): Promise<
_wip_searchPersons = searchPersons;
triggerStatusUpdate();
const prunedFaceFNs = faceFNs.slice(0, 30).map(({ face, neighbours }) => ({
face,
neighbours: neighbours.slice(0, 30),
}));
return { faceFNs: prunedFaceFNs, clusters, clusterIDForFaceID };
return { faceFNs, clusters, clusterIDForFaceID };
};
export const wipCluster = () => void wipClusterDebugPageContents();