Move out
This commit is contained in:
parent
9346ce3255
commit
6b5788539b
10 changed files with 21 additions and 19 deletions
|
@ -9,7 +9,7 @@ import { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|||
import { components } from "react-select";
|
||||
import AsyncSelect from "react-select/async";
|
||||
import { InputActionMeta } from "react-select/src/types";
|
||||
import { Person } from "services/face/types";
|
||||
import type { Person } from "services/face/people";
|
||||
import { City } from "services/locationSearchService";
|
||||
import {
|
||||
getAutoCompleteSuggestions,
|
||||
|
|
|
@ -5,7 +5,8 @@ import { Legend } from "components/PhotoViewer/styledComponents/Legend";
|
|||
import { t } from "i18next";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import mlIDbStorage from "services/face/db";
|
||||
import { Face, Person, type MlFileData } from "services/face/types";
|
||||
import type { Person } from "services/face/people";
|
||||
import type { Face, MlFileData } from "services/face/types";
|
||||
import { EnteFile } from "types/file";
|
||||
|
||||
const FaceChipContainer = styled("div")`
|
||||
|
|
|
@ -9,7 +9,8 @@ import {
|
|||
openDB,
|
||||
} from "idb";
|
||||
import isElectron from "is-electron";
|
||||
import { Face, MlFileData, Person } from "services/face/types";
|
||||
import type { Person } from "services/face/people";
|
||||
import type { Face, MlFileData } from "services/face/types";
|
||||
import {
|
||||
DEFAULT_ML_SEARCH_CONFIG,
|
||||
MAX_ML_SYNC_ERROR_COUNT,
|
||||
|
|
|
@ -5,11 +5,11 @@ import { workerBridge } from "@/next/worker/worker-bridge";
|
|||
import { euclidean } from "hdbscan";
|
||||
import { Matrix } from "ml-matrix";
|
||||
import { Box, Dimensions, Point, enlargeBox } from "services/face/geom";
|
||||
import {
|
||||
import type {
|
||||
Face,
|
||||
FaceAlignment,
|
||||
FaceDetection,
|
||||
type MlFileData,
|
||||
MlFileData,
|
||||
} from "services/face/types";
|
||||
import { defaultMLVersion } from "services/machineLearning/machineLearningService";
|
||||
import { getSimilarityTransformation } from "similarity-transformation";
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
import log from "@/next/log";
|
||||
import mlIDbStorage from "services/face/db";
|
||||
import { Person } from "services/face/types";
|
||||
import { clusterFaces } from "./cluster";
|
||||
import { saveFaceCrop } from "./f-index";
|
||||
import { fetchImageBitmap, getLocalFile } from "./file";
|
||||
|
||||
export interface Person {
|
||||
id: number;
|
||||
name?: string;
|
||||
files: Array<number>;
|
||||
displayFaceId?: string;
|
||||
}
|
||||
|
||||
export const syncPeopleIndex = async () => {
|
||||
// TODO-ML(MR): Forced disable clustering. It doesn't currently work,
|
||||
|
@ -83,11 +87,13 @@ export const syncPeopleIndex = async () => {
|
|||
: best,
|
||||
);
|
||||
|
||||
/* Generate face crop
|
||||
if (personFace && !personFace.crop?.cacheKey) {
|
||||
const file = await getLocalFile(personFace.fileId);
|
||||
const imageBitmap = await fetchImageBitmap(file);
|
||||
await saveFaceCrop(imageBitmap, personFace);
|
||||
}
|
||||
*/
|
||||
|
||||
const person: Person = {
|
||||
id: index,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Box, Point, boxFromBoundingBox } from "services/face/geom";
|
||||
import { FaceDetection } from "services/face/types";
|
||||
import type { FaceDetection } from "services/face/types";
|
||||
// TODO-ML: Do we need two separate Matrix libraries?
|
||||
//
|
||||
// Keeping this in a separate file so that we can audit this. If these can be
|
||||
|
|
|
@ -34,13 +34,6 @@ export interface Face {
|
|||
personId?: number;
|
||||
}
|
||||
|
||||
export interface Person {
|
||||
id: number;
|
||||
name?: string;
|
||||
files: Array<number>;
|
||||
displayFaceId?: string;
|
||||
}
|
||||
|
||||
export interface MlFileData {
|
||||
fileId: number;
|
||||
faces?: Face[];
|
||||
|
|
|
@ -460,6 +460,7 @@ class ServerFaceEmbeddings {
|
|||
|
||||
class ServerFace {
|
||||
public faceID: string;
|
||||
// TODO-ML: singular?
|
||||
public embeddings: number[];
|
||||
public detection: ServerDetection;
|
||||
public score: number;
|
||||
|
@ -536,7 +537,7 @@ function LocalFileMlDataToServerFileMl(
|
|||
} as Landmark);
|
||||
}
|
||||
|
||||
// TODO: Add client UA and version
|
||||
// TODO-ML: Add client UA and version
|
||||
const newFaceObject = new ServerFace(
|
||||
faceID,
|
||||
Array.from(embedding),
|
||||
|
|
|
@ -3,7 +3,7 @@ import log from "@/next/log";
|
|||
import * as chrono from "chrono-node";
|
||||
import { t } from "i18next";
|
||||
import mlIDbStorage from "services/face/db";
|
||||
import { Person } from "services/face/types";
|
||||
import type { Person } from "services/face/people";
|
||||
import { defaultMLVersion } from "services/machineLearning/machineLearningService";
|
||||
import { Collection } from "types/collection";
|
||||
import { EntityType, LocationTag, LocationTagData } from "types/entity";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { FILE_TYPE } from "@/media/file-type";
|
||||
import { IndexStatus } from "services/face/db";
|
||||
import { Person } from "services/face/types";
|
||||
import type { Person } from "services/face/people";
|
||||
import { City } from "services/locationSearchService";
|
||||
import { LocationTagData } from "types/entity";
|
||||
import { EnteFile } from "types/file";
|
||||
|
|
Loading…
Add table
Reference in a new issue