Point of use

This commit is contained in:
Manav Rathi 2024-05-18 16:02:27 +05:30
parent b29436e160
commit 76cfae12a5
No known key found for this signature in database
3 changed files with 5 additions and 18 deletions

View file

@ -12,7 +12,6 @@ import {
FaceCrop,
FaceDetection,
FaceEmbedding,
MLSyncFileContext,
type MlFileData,
} from "services/face/types";
import { defaultMLVersion } from "services/machineLearning/machineLearningService";
@ -78,8 +77,6 @@ interface MLSyncFileContext {
newMlFile?: MlFileData;
imageBitmap?: ImageBitmap;
newAlignment?: boolean;
}
const fetchImageBitmapForContext = async (fileContext: MLSyncFileContext) => {
@ -366,7 +363,6 @@ const syncFileFaceAlignments = async (
fileContext: MLSyncFileContext,
): Promise<Float32Array> => {
const { newMlFile } = fileContext;
fileContext.newAlignment = true;
const imageBitmap =
fileContext.imageBitmap ||
(await fetchImageBitmapForContext(fileContext));

View file

@ -1,5 +1,4 @@
import { Box, Dimensions, Point } from "services/face/geom";
import { EnteFile } from "types/file";
export declare type Cluster = Array<number>;
@ -76,9 +75,3 @@ export interface MlFileData {
mlVersion: number;
errorCount: number;
}
export interface MLSearchConfig {
enabled: boolean;
}
export declare type MLIndex = "files" | "people";

View file

@ -10,13 +10,7 @@ import PQueue from "p-queue";
import { putEmbedding } from "services/embeddingService";
import mlIDbStorage, { ML_SEARCH_CONFIG_NAME } from "services/face/db";
import { fetchImageBitmap, getLocalFile } from "services/face/image";
import {
Face,
FaceDetection,
Landmark,
MLSearchConfig,
MlFileData,
} from "services/face/types";
import { Face, FaceDetection, Landmark, MlFileData } from "services/face/types";
import { getLocalFiles } from "services/fileService";
import { EnteFile } from "types/file";
import { isInternalUserForML } from "utils/user";
@ -32,6 +26,10 @@ const batchSize = 200;
export const MAX_ML_SYNC_ERROR_COUNT = 1;
export interface MLSearchConfig {
enabled: boolean;
}
export const DEFAULT_ML_SEARCH_CONFIG: MLSearchConfig = {
enabled: false,
};