|
@@ -15,7 +15,6 @@ import {
|
|
BlurDetectionMethod,
|
|
BlurDetectionMethod,
|
|
BlurDetectionService,
|
|
BlurDetectionService,
|
|
Face,
|
|
Face,
|
|
- FaceCropMethod,
|
|
|
|
FaceCropService,
|
|
FaceCropService,
|
|
FaceDetection,
|
|
FaceDetection,
|
|
FaceDetectionMethod,
|
|
FaceDetectionMethod,
|
|
@@ -34,7 +33,6 @@ import {
|
|
import { getLocalFiles } from "services/fileService";
|
|
import { getLocalFiles } from "services/fileService";
|
|
import { EnteFile } from "types/file";
|
|
import { EnteFile } from "types/file";
|
|
import { isInternalUserForML } from "utils/user";
|
|
import { isInternalUserForML } from "utils/user";
|
|
-import arcfaceCropService from "./arcfaceCropService";
|
|
|
|
import FaceService from "./faceService";
|
|
import FaceService from "./faceService";
|
|
import laplacianBlurDetectionService from "./laplacianBlurDetectionService";
|
|
import laplacianBlurDetectionService from "./laplacianBlurDetectionService";
|
|
import mobileFaceNetEmbeddingService from "./mobileFaceNetEmbeddingService";
|
|
import mobileFaceNetEmbeddingService from "./mobileFaceNetEmbeddingService";
|
|
@@ -125,14 +123,6 @@ export class MLFactory {
|
|
throw Error("Unknon face detection method: " + method);
|
|
throw Error("Unknon face detection method: " + method);
|
|
}
|
|
}
|
|
|
|
|
|
- public static getFaceCropService(method: FaceCropMethod) {
|
|
|
|
- if (method === "ArcFace") {
|
|
|
|
- return arcfaceCropService;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- throw Error("Unknon face crop method: " + method);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
public static getBlurDetectionService(
|
|
public static getBlurDetectionService(
|
|
method: BlurDetectionMethod,
|
|
method: BlurDetectionMethod,
|
|
): BlurDetectionService {
|
|
): BlurDetectionService {
|
|
@@ -189,7 +179,6 @@ export class LocalMLSyncContext implements MLSyncContext {
|
|
|
|
|
|
this.faceDetectionService =
|
|
this.faceDetectionService =
|
|
MLFactory.getFaceDetectionService("YoloFace");
|
|
MLFactory.getFaceDetectionService("YoloFace");
|
|
- this.faceCropService = MLFactory.getFaceCropService("ArcFace");
|
|
|
|
this.blurDetectionService =
|
|
this.blurDetectionService =
|
|
MLFactory.getBlurDetectionService("Laplacian");
|
|
MLFactory.getBlurDetectionService("Laplacian");
|
|
this.faceEmbeddingService =
|
|
this.faceEmbeddingService =
|
|
@@ -288,8 +277,7 @@ class MachineLearningService {
|
|
faceID: string,
|
|
faceID: string,
|
|
) {
|
|
) {
|
|
await downloadManager.init(APPS.PHOTOS, { token });
|
|
await downloadManager.init(APPS.PHOTOS, { token });
|
|
- const syncContext = await this.getSyncContext(token, userID);
|
|
|
|
- return FaceService.regenerateFaceCrop(syncContext, faceID);
|
|
|
|
|
|
+ return FaceService.regenerateFaceCrop(faceID);
|
|
}
|
|
}
|
|
|
|
|
|
private newMlData(fileId: number) {
|
|
private newMlData(fileId: number) {
|