Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

uc

Manav Rathi15884597b4c2
diff --git a/web/apps/photos/src/pages/cluster-debug.tsx b/web/apps/photos/src/pages/cluster-debug.tsx
index 0798ad608d..db187751de 100644
--- a/web/apps/photos/src/pages/cluster-debug.tsx
+++ b/web/apps/photos/src/pages/cluster-debug.tsx
@@ -50,7 +50,7 @@ export default function ClusterDebug() {
return (
<>
<Typography variant="small">
- {`${clusterRes.clusters.length} clusters`}
+ {`${clusterRes.clusters.length} clusters from ${clusterRes.clusteredCount} faces. ${clusterRes.unclusteredCount} unclustered faces.`}
</Typography>
<Typography variant="small" color="text.muted">
Showing only top 20 and bottom 10 clusters (and only up to 50
@@ -266,9 +266,6 @@ const FaceItem: React.FC<FaceItemProps> = ({ faceWF, clusterIDForFaceID }) => {
<Typography variant="small" color="text.muted">
{`c${cosineSimilarity.toFixed(1)}`}
</Typography>
- <Typography variant="small" color="text.muted">
- {`c${cosineSimilarity.toFixed(1)}`}
- </Typography>
<Typography variant="small" color="text.muted">
{`d${d}`}
</Typography>
diff --git a/web/packages/new/photos/services/ml/cluster-new.ts b/web/packages/new/photos/services/ml/cluster-new.ts
index 1258551439..e49db72385 100644
--- a/web/packages/new/photos/services/ml/cluster-new.ts
+++ b/web/packages/new/photos/services/ml/cluster-new.ts
@@ -354,7 +354,7 @@ export const clusterFacesHdb = async (faceIndexes: FaceIndex[]) => {
// A flattened array of faces.
// TODO-Cluster ad-hoc filtering and slicing
const faces0 = [...enumerateFaces(faceIndexes)]
- .filter((f) => f.blur > 50)
+ .filter((f) => f.blur > 99)
.slice(0, 6000);
// TODO-Cluster testing code, can be removed once done
const faces = Array(1)
@@ -437,7 +437,7 @@ export const clusterFacesHdb = async (faceIndexes: FaceIndex[]) => {
// Use a higher cosine similarity threshold if either of the two
// faces are blurry.
const threshold =
- existingFace.blur < 100 || newFace.blur < 100 ? 0.9 : 0.7;
+ existingFace.blur < 200 || newFace.blur < 200 ? 0.9 : 0.7;
if (csim > threshold && csim > nnCosineSimilarity) {
nnCluster = existingCluster;
nnCosineSimilarity = csim;
@@ -566,8 +566,13 @@ export const clusterFacesHdb = async (faceIndexes: FaceIndex[]) => {
`Clustered ${faces.length} faces into ${validClusters.length} clusters, with ${faces.length - clusterIDForFaceID.size} faces remaining unclustered (${Date.now() - t} ms)`,
);
+ const clusteredCount = clusterIDForFaceID.size
+ const unclusteredCount = faces.length - clusteredCount;
+
return {
- faces,
+ // faces,
+ clusteredCount,
+ unclusteredCount,
clusters: validClusters,
cgroups,
clusterPreviews,
diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.ts
index 9f85f47119..3f588c09ad 100644
--- a/web/packages/new/photos/services/ml/index.ts
+++ b/web/packages/new/photos/services/ml/index.ts
@@ -368,6 +368,8 @@ export interface ClusterPreviewFaceWF {
}
export interface ClusterDebugPageContents {
+ clusteredCount: number;
+ unclusteredCount: number;
// faceFNs: FaceFileNeighbours[];
clusterPreviewWFs: ClusterPreviewWF[];
clusters: FaceCluster[];
@@ -385,8 +387,14 @@ export const wipClusterDebugPageContents = async (): Promise<
triggerStatusUpdate();
// const { faceAndNeigbours, clusters, cgroups } = await clusterFaces(
- const { clusterPreviews, clusters, cgroups, clusterIDForFaceID } =
- await worker().then((w) => w.clusterFacesHdb());
+ const {
+ clusteredCount,
+ unclusteredCount,
+ clusterPreviews,
+ clusters,
+ cgroups,
+ clusterIDForFaceID,
+ } = await worker().then((w) => w.clusterFacesHdb());
const searchPersons = await convertToSearchPersons(clusters, cgroups);
@@ -418,7 +426,13 @@ export const wipClusterDebugPageContents = async (): Promise<
_wip_searchPersons = searchPersons;
triggerStatusUpdate();
- return { clusterPreviewWFs, clusters, clusterIDForFaceID };
+ return {
+ clusteredCount,
+ unclusteredCount,
+ clusterPreviewWFs,
+ clusters,
+ clusterIDForFaceID,
+ };
};
export const wipCluster = () => void wipClusterDebugPageContents();