mirror of
https://github.com/immich-app/immich.git
synced 2025-12-16 09:13:13 +03:00
* consolidated endpoints, added live configuration * added ml settings to server * added settings dashboard * updated deps, fixed typos * simplified modelconfig updated tests * Added ml setting accordion for admin page updated tests * merge `clipText` and `clipVision` * added face distance setting clarified setting * add clip mode in request, dropdown for face models * polished ml settings updated descriptions * update clip field on error * removed unused import * add description for image classification threshold * pin safetensors for arm wheel updated poetry lock * moved dto * set model type only in ml repository * revert form-data package install use fetch instead of axios * added slotted description with link updated facial recognition description clarified effect of disabling tasks * validation before model load * removed unnecessary getconfig call * added migration * updated api updated api updated api --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
import { ClassificationConfig, CLIPConfig, RecognitionConfig } from './dto';
|
|
|
|
export const IMachineLearningRepository = 'IMachineLearningRepository';
|
|
|
|
export interface VisionModelInput {
|
|
imagePath: string;
|
|
}
|
|
|
|
export interface TextModelInput {
|
|
text: string;
|
|
}
|
|
|
|
export interface BoundingBox {
|
|
x1: number;
|
|
y1: number;
|
|
x2: number;
|
|
y2: number;
|
|
}
|
|
|
|
export interface DetectFaceResult {
|
|
imageWidth: number;
|
|
imageHeight: number;
|
|
boundingBox: BoundingBox;
|
|
score: number;
|
|
embedding: number[];
|
|
}
|
|
|
|
export enum ModelType {
|
|
IMAGE_CLASSIFICATION = 'image-classification',
|
|
FACIAL_RECOGNITION = 'facial-recognition',
|
|
CLIP = 'clip',
|
|
}
|
|
|
|
export enum CLIPMode {
|
|
VISION = 'vision',
|
|
TEXT = 'text',
|
|
}
|
|
|
|
export interface IMachineLearningRepository {
|
|
classifyImage(url: string, input: VisionModelInput, config: ClassificationConfig): Promise<string[]>;
|
|
encodeImage(url: string, input: VisionModelInput, config: CLIPConfig): Promise<number[]>;
|
|
encodeText(url: string, input: TextModelInput, config: CLIPConfig): Promise<number[]>;
|
|
detectFaces(url: string, input: VisionModelInput, config: RecognitionConfig): Promise<DetectFaceResult[]>;
|
|
}
|