π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Add limits
Manav Rathi3563c20997dd
diff --git a/web/apps/photos/src/pages/cluster-debug.tsx b/web/apps/photos/src/pages/cluster-debug.tsxindex 683ce6bec6..c6abe7226f 100644--- a/web/apps/photos/src/pages/cluster-debug.tsx+++ b/web/apps/photos/src/pages/cluster-debug.tsx@@ -40,25 +40,34 @@ export default function ClusterDebug() {finishLoading();};+ if (!clusterRes) {+ return (+ <VerticallyCentered>+ <EnteSpinner />+ </VerticallyCentered>+ );+ }return (<>- {clusterRes ? (- <Container>- <AutoSizer>- {({ height, width }) => (- <ClusterPhotoList- width={width}- height={height}- clusterRes={clusterRes}- />- )}- </AutoSizer>- </Container>- ) : (- <VerticallyCentered>- <EnteSpinner />- </VerticallyCentered>- )}+ <Typography variant="small">+ {`${clusterRes.clusters.length} clusters`}+ </Typography>+ <Typography variant="small" color="text.muted">+ Showing only upto first 30 faces (and only upto 30 nearest+ neighbours of each).+ </Typography>+ <hr />+ <Container>+ <AutoSizer>+ {({ height, width }) => (+ <ClusterPhotoList+ width={width}+ height={height}+ clusterRes={clusterRes}+ />+ )}+ </AutoSizer>+ </Container><Options /></>);diff --git a/web/packages/new/photos/components/MLSettings.tsx b/web/packages/new/photos/components/MLSettings.tsxindex 08e17c7ff1..337bc906e8 100644--- a/web/packages/new/photos/components/MLSettings.tsx+++ b/web/packages/new/photos/components/MLSettings.tsx@@ -397,7 +397,7 @@ const ManageML: React.FC<ManageMLProps> = ({</MenuItemGroup><MenuSectionTitletitle={ut(- "Create clusters locally, afresh and in-memory. Nothing will be saved or synced to remote. You can view the results in search dropdown.",+ "Create in-memory clusters from arbitrary 900 photos. Nothing will be saved or synced to remote. You can view the results in search dropdown.",)}/></Box>@@ -412,7 +412,7 @@ const ManageML: React.FC<ManageMLProps> = ({</MenuItemGroup><MenuSectionTitletitle={ut(- "Variant of above that opens a page with debug info. WARNING: Unoptimized, likely will cause a crash for accounts with few k photos.",+ "Variant of above that opens a page with debug info.",)}/></Box>diff --git a/web/packages/new/photos/services/ml/cluster-new.ts b/web/packages/new/photos/services/ml/cluster-new.tsindex c0f5dd51c2..445a91bbba 100644--- a/web/packages/new/photos/services/ml/cluster-new.ts+++ b/web/packages/new/photos/services/ml/cluster-new.ts@@ -168,7 +168,7 @@ export const clusterFaces = async (faceIndexes: FaceIndex[]) => {const t = Date.now();// A flattened array of faces.- const faces = [...enumerateFaces(faceIndexes)];+ const faces = [...enumerateFaces(faceIndexes)].slice(0, 900);// Start with the clusters we already have (either from a previous indexing,// or fetched from remote).diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.tsindex f53e755502..0567793fbe 100644--- a/web/packages/new/photos/services/ml/index.ts+++ b/web/packages/new/photos/services/ml/index.ts@@ -408,7 +408,12 @@ export const wipClusterDebugPageContents = async (): Promise<_wip_searchPersons = searchPersons;triggerStatusUpdate();- return { faceFNs, clusters, clusterIDForFaceID };+ const prunedFaceFNs = faceFNs.slice(0, 30).map(({ face, neighbours }) => ({+ face,+ neighbours: neighbours.slice(0, 30),+ }));++ return { faceFNs: prunedFaceFNs, clusters, clusterIDForFaceID };};export const wipCluster = () => void wipClusterDebugPageContents();