From 8edb506b295521761f99407744aaea9737a6c6b9 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Sat, 18 May 2024 08:07:49 +0530 Subject: [PATCH] Prune --- web/apps/photos/src/services/face/db.ts | 15 +++------------ web/apps/photos/src/services/face/types.ts | 5 ----- .../machineLearning/machineLearningService.ts | 3 --- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/web/apps/photos/src/services/face/db.ts b/web/apps/photos/src/services/face/db.ts index 399bfff1a..9be1a537b 100644 --- a/web/apps/photos/src/services/face/db.ts +++ b/web/apps/photos/src/services/face/db.ts @@ -9,7 +9,7 @@ import { openDB, } from "idb"; import isElectron from "is-electron"; -import { Face, MLLibraryData, MlFileData, Person } from "services/face/types"; +import { Face, MlFileData, Person } from "services/face/types"; import { DEFAULT_ML_SEARCH_CONFIG, MAX_ML_SYNC_ERROR_COUNT, @@ -50,7 +50,7 @@ interface MLDb extends DBSchema { }; library: { key: string; - value: MLLibraryData; + value: unknown; }; configs: { key: string; @@ -177,6 +177,7 @@ class MLIDbStorage { ML_SEARCH_CONFIG_NAME, ); + db.deleteObjectStore("library"); db.deleteObjectStore("things"); } catch { // TODO: ignore for now as we finalize the new version @@ -400,16 +401,6 @@ class MLIDbStorage { return db.put("versions", version, index); } - public async getLibraryData() { - const db = await this.db; - return db.get("library", "data"); - } - - public async putLibraryData(data: MLLibraryData) { - const db = await this.db; - return db.put("library", data, "data"); - } - public async getConfig(name: string, def: T) { const db = await this.db; const tx = db.transaction("configs", "readwrite"); diff --git a/web/apps/photos/src/services/face/types.ts b/web/apps/photos/src/services/face/types.ts index cbe13da94..d982bd48f 100644 --- a/web/apps/photos/src/services/face/types.ts +++ b/web/apps/photos/src/services/face/types.ts @@ -1,4 +1,3 @@ -import type { ClusterFacesResult } from "services/face/cluster"; import { Dimensions } from "services/face/geom"; import { EnteFile } from "types/file"; import { Box, Point } from "./geom"; @@ -113,8 +112,4 @@ export interface MLSyncFileContext { newAlignment?: boolean; } -export interface MLLibraryData { - faceClusteringResults?: ClusterFacesResult; -} - export declare type MLIndex = "files" | "people"; diff --git a/web/apps/photos/src/services/machineLearning/machineLearningService.ts b/web/apps/photos/src/services/machineLearning/machineLearningService.ts index c11aa3370..ae0168731 100644 --- a/web/apps/photos/src/services/machineLearning/machineLearningService.ts +++ b/web/apps/photos/src/services/machineLearning/machineLearningService.ts @@ -13,7 +13,6 @@ import { Face, FaceDetection, Landmark, - MLLibraryData, MLSearchConfig, MLSyncFileContext, MlFileData, @@ -64,8 +63,6 @@ class MLSyncContext { public error?: Error; - public mlLibraryData: MLLibraryData; - public syncQueue: PQueue; // TODO: wheather to limit concurrent downloads // private downloadQueue: PQueue;