From e97225fa10e010f45de3fc3ed23a5fc6f0d6a2fa Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 20 May 2024 09:57:42 +0530 Subject: [PATCH] Remove --- .../photos/src/components/ml/PeopleList.tsx | 15 ++++--------- web/packages/next/types/ipc.ts | 22 ------------------- 2 files changed, 4 insertions(+), 33 deletions(-) diff --git a/web/apps/photos/src/components/ml/PeopleList.tsx b/web/apps/photos/src/components/ml/PeopleList.tsx index d527c8933..da003d97d 100644 --- a/web/apps/photos/src/components/ml/PeopleList.tsx +++ b/web/apps/photos/src/components/ml/PeopleList.tsx @@ -151,22 +151,15 @@ const FaceCropImageView: React.FC = ({ faceID }) => { useEffect(() => { let didCancel = false; - const electron = globalThis.electron; - - if (faceID && electron) { - electron - .legacyFaceCrop(faceID) - .then(async (data) => { - if (data) return data; + if (faceID) { + blobCache("face-crops") + .then((cache) => cache.get(faceID)) + .then((data) => { /* TODO(MR): regen if needed and get this to work on web too. cachedOrNew("face-crops", cacheKey, async () => { return regenerateFaceCrop(faceId); })*/ - const cache = await blobCache("face-crops"); - return await cache.get(faceID); - }) - .then((data) => { if (data) { const blob = new Blob([data]); if (!didCancel) setObjectURL(URL.createObjectURL(blob)); diff --git a/web/packages/next/types/ipc.ts b/web/packages/next/types/ipc.ts index 7d5866cdb..b965f3935 100644 --- a/web/packages/next/types/ipc.ts +++ b/web/packages/next/types/ipc.ts @@ -339,28 +339,6 @@ export interface Electron { */ faceEmbeddings: (input: Float32Array) => Promise; - /** - * Return a face crop stored by a previous version of ML. - * - * [Note: Legacy face crops] - * - * Older versions of ML generated and stored face crops in a "face-crops" - * cache directory on the Electron side. For the time being, we have - * disabled the face search whilst we put finishing touches to it. However, - * it'll be nice to still show the existing faces that have been clustered - * for people who opted in to the older beta. - * - * So we retain the older "face-crops" disk cache, and use this method to - * serve faces from it when needed. - * - * @param faceID An identifier corresponding to which the face crop had been - * stored by the older version of our app. - * - * @returns the JPEG data of the face crop if a file is found for the given - * {@link faceID}, otherwise undefined. - */ - legacyFaceCrop: (faceID: string) => Promise; - // - Watch /**