π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Prune unused
Manav Rathi000fe87ebb18
diff --git a/web/packages/new/photos/services/ml/cluster.ts b/web/packages/new/photos/services/ml/cluster.tsindex d002fd770f..c323d8ad2f 100644--- a/web/packages/new/photos/services/ml/cluster.ts+++ b/web/packages/new/photos/services/ml/cluster.ts@@ -173,28 +173,6 @@ export const clusterFaces = async ((a, b) => b.faces.length - a.faces.length,);- // Convert into the data structure we're using to debug/visualize.- const clusterPreviewClusters =- sortedClusters.length < 60- ? sortedClusters- : sortedClusters.slice(0, 30).concat(sortedClusters.slice(-30));- const clusterPreviews = clusterPreviewClusters.map((cluster) => {- const faces = cluster.faces.map((id) => ensure(faceForFaceID.get(id)));- const topFace = faces.reduce((top, face) =>- top.score > face.score ? top : face,- );- const previewFaces: ClusterPreviewFace[] = faces.map((face) => {- const csim = dotProduct(topFace.embedding, face.embedding);- return { face, cosineSimilarity: csim, wasMerged: false };- });- return {- clusterSize: cluster.faces.length,- faces: previewFaces- .sort((a, b) => b.cosineSimilarity - a.cosineSimilarity)- .slice(0, 50),- };- });-// TODO-Cluster - Currently we're not syncing with remote or saving anything// locally, so cgroups will be empty. Create a temporary (unsaved, unsynced)// cgroup, one per cluster.@@ -222,26 +200,15 @@ export const clusterFaces = async (const clusteredFaceCount = clusterIDForFaceID.size;const unclusteredFaceCount = filteredFaceCount - clusteredFaceCount;- const unclusteredFaces = faces.filter(- ({ faceID }) => !clusterIDForFaceID.has(faceID),- );-const timeTakenMs = Date.now() - t;log.info(`Generated ${sortedClusters.length} clusters from ${totalFaceCount} faces (${filteredFaceCount} filtered ${clusteredFaceCount} clustered ${unclusteredFaceCount} unclustered) (${timeTakenMs} ms)`,);return {- totalFaceCount,- filteredFaceCount,- clusteredFaceCount,- unclusteredFaceCount,localFileByID,- clusterPreviews,clusters: sortedClusters,cgroups,- unclusteredFaces: unclusteredFaces,- timeTakenMs,};};diff --git a/web/packages/new/photos/services/ml/index.ts b/web/packages/new/photos/services/ml/index.tsindex d156cbbeca..19a66590a6 100644--- a/web/packages/new/photos/services/ml/index.ts+++ b/web/packages/new/photos/services/ml/index.ts@@ -20,11 +20,6 @@ import { getRemoteFlag, updateRemoteFlag } from "../remote-store";import { setSearchPeople } from "../search";import type { UploadItem } from "../upload/types";import { syncCGroups, updatedPeople, type Person } from "./cgroups";-import {- type ClusterFace,- type ClusterPreviewFace,- type FaceCluster,-} from "./cluster";import { regenerateFaceCrops } from "./crop";import { clearMLDB, getFaceIndex, getIndexableAndIndexedCounts } from "./db";import { MLWorker } from "./worker";@@ -362,63 +357,16 @@ export const wipClusterLocalOnce = () => {void wipCluster();};-export interface ClusterPreviewWithFile {- clusterSize: number;- faces: ClusterPreviewFaceWithFile[];-}--export type ClusterPreviewFaceWithFile = ClusterPreviewFace & {- enteFile: EnteFile;-};--export interface ClusterDebugPageContents {- totalFaceCount: number;- filteredFaceCount: number;- clusteredFaceCount: number;- unclusteredFaceCount: number;- timeTakenMs: number;- clusters: FaceCluster[];- clusterPreviewsWithFile: ClusterPreviewWithFile[];- unclusteredFacesWithFile: {- face: ClusterFace;- enteFile: EnteFile;- }[];-}-export const wipCluster = async () => {if (!(await wipClusterEnable())) throw new Error("Not implemented");_state.peopleLocal = [];triggerStatusUpdate();- const {- localFileByID,- clusterPreviews,- clusters,- cgroups,- unclusteredFaces,- ...rest- } = await worker().then((w) => w.clusterFaces());-- const fileForFace = ({ faceID }: { faceID: string }) =>- ensure(localFileByID.get(ensure(fileIDFromFaceID(faceID))));-- const clusterPreviewsWithFile = clusterPreviews.map(- ({ clusterSize, faces }) => ({- clusterSize,- faces: faces.map(({ face, ...rest }) => ({- face,- enteFile: fileForFace(face),- ...rest,- })),- }),+ const { localFileByID, clusters, cgroups } = await worker().then((w) =>+ w.clusterFaces(),);- const unclusteredFacesWithFile = unclusteredFaces.map((face) => ({- face,- enteFile: fileForFace(face),- }));-const clusterByID = new Map(clusters.map((c) => [c.id, c]));const people = cgroups@@ -452,13 +400,6 @@ export const wipCluster = async () => {_state.peopleLocal = people;triggerStatusUpdate();updatePeopleSnapshot();-- return {- clusters,- clusterPreviewsWithFile,- unclusteredFacesWithFile,- ...rest,- };};export type MLStatus =