Point of use
This commit is contained in:
parent
b29436e160
commit
76cfae12a5
3 changed files with 5 additions and 18 deletions
web/apps/photos/src/services
|
@ -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));
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue