diff --git a/web/packages/new/photos/components/gallery/PeopleHeader.tsx b/web/packages/new/photos/components/gallery/PeopleHeader.tsx index 840bec6f35..3eafe3f1cd 100644 --- a/web/packages/new/photos/components/gallery/PeopleHeader.tsx +++ b/web/packages/new/photos/components/gallery/PeopleHeader.tsx @@ -12,9 +12,12 @@ import { import { useIsSmallWidth } from "@/base/hooks"; import { pt } from "@/base/i18n"; import log from "@/base/log"; -import { deleteCGroup, renameCGroup } from "@/new/photos/services/ml"; import { + deleteCGroup, + renameCGroup, suggestionsAndChoicesForPerson, +} from "@/new/photos/services/ml"; +import { type CGroupPerson, type ClusterPerson, type Person, diff --git a/web/packages/new/photos/services/ml/clip.ts b/web/packages/new/photos/services/ml/clip.ts index 773621602f..a3c6a22487 100644 --- a/web/packages/new/photos/services/ml/clip.ts +++ b/web/packages/new/photos/services/ml/clip.ts @@ -133,7 +133,7 @@ const normalized = (embedding: Float32Array) => { * The result can also be `undefined`, which indicates that the download for the * ML model is still in progress (trying again later should succeed). */ -export const clipMatches = async ( +export const _clipMatches = async ( searchPhrase: string, electron: ElectronMLWorker, ): Promise => { diff --git a/web/packages/new/photos/services/ml/cluster.ts b/web/packages/new/photos/services/ml/cluster.ts index fab47652ce..36a39b5e09 100644 --- a/web/packages/new/photos/services/ml/cluster.ts +++ b/web/packages/new/photos/services/ml/cluster.ts @@ -62,7 +62,7 @@ export type ClusterFace = Omit & { * other interactions with the worker (where this code runs) do not get stalled * while clustering is in progress. */ -export const clusterFaces = async ( +export const _clusterFaces = async ( faceIndexes: FaceIndex[], localFiles: EnteFile[], onProgress: (progress: ClusteringProgress) => void, diff --git a/web/packages/new/photos/services/ml/people.ts b/web/packages/new/photos/services/ml/people.ts index 23f86483b5..16b36a0232 100644 --- a/web/packages/new/photos/services/ml/people.ts +++ b/web/packages/new/photos/services/ml/people.ts @@ -360,7 +360,7 @@ export interface PersonSuggestionsAndChoices { /** * Returns suggestions and existing choices for the given person. */ -export const suggestionsAndChoicesForPerson = async ( +export const _suggestionsAndChoicesForPerson = async ( person: CGroupPerson, ): Promise => { const startTime = Date.now(); diff --git a/web/packages/new/photos/services/ml/worker.ts b/web/packages/new/photos/services/ml/worker.ts index 5507c0875b..d8ebea44c0 100644 --- a/web/packages/new/photos/services/ml/worker.ts +++ b/web/packages/new/photos/services/ml/worker.ts @@ -18,14 +18,14 @@ import { type ImageBitmapAndData, } from "./blob"; import { + _clipMatches, clearCachedCLIPIndexes, clipIndexingVersion, - clipMatches, indexCLIP, type CLIPIndex, } from "./clip"; import { - clusterFaces, + _clusterFaces, reconcileClusters, type ClusteringProgress, } from "./cluster"; @@ -44,7 +44,7 @@ import { type RawRemoteMLData, type RemoteMLData, } from "./ml-data"; -import { suggestionsAndChoicesForPerson, type CGroupPerson } from "./people"; +import { _suggestionsAndChoicesForPerson, type CGroupPerson } from "./people"; import type { CLIPMatches, MLWorkerDelegate } from "./worker-types"; /** @@ -207,7 +207,7 @@ export class MLWorker { * Find {@link CLIPMatches} for a given normalized {@link searchPhrase}. */ async clipMatches(searchPhrase: string): Promise { - return clipMatches(searchPhrase, ensure(this.electron)); + return _clipMatches(searchPhrase, ensure(this.electron)); } private async tick() { @@ -326,7 +326,7 @@ export class MLWorker { * cgroups if needed. */ async clusterFaces(masterKey: Uint8Array) { - const clusters = await clusterFaces( + const clusters = await _clusterFaces( await savedFaceIndexes(), await getAllLocalFiles(), (progress) => this.updateClusteringProgress(progress), @@ -344,7 +344,7 @@ export class MLWorker { * Return suggestions and choices for the given cgroup {@link person}. */ async suggestionsAndChoicesForPerson(person: CGroupPerson) { - return suggestionsAndChoicesForPerson(person); + return _suggestionsAndChoicesForPerson(person); } }