2023-02-25 09:12:03 -05:00
|
|
|
export const IMachineLearningRepository = 'IMachineLearningRepository';
|
|
|
|
|
|
|
|
|
|
export interface MachineLearningInput {
|
|
|
|
|
thumbnailPath: string;
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-17 13:07:17 -04:00
|
|
|
export interface BoundingBox {
|
|
|
|
|
x1: number;
|
|
|
|
|
y1: number;
|
|
|
|
|
x2: number;
|
|
|
|
|
y2: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface DetectFaceResult {
|
|
|
|
|
imageWidth: number;
|
|
|
|
|
imageHeight: number;
|
|
|
|
|
boundingBox: BoundingBox;
|
|
|
|
|
score: number;
|
|
|
|
|
embedding: number[];
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-25 09:12:03 -05:00
|
|
|
export interface IMachineLearningRepository {
|
2023-03-20 11:55:28 -04:00
|
|
|
classifyImage(input: MachineLearningInput): Promise<string[]>;
|
2023-03-18 08:44:42 -05:00
|
|
|
encodeImage(input: MachineLearningInput): Promise<number[]>;
|
|
|
|
|
encodeText(input: string): Promise<number[]>;
|
2023-05-17 13:07:17 -04:00
|
|
|
detectFaces(input: MachineLearningInput): Promise<DetectFaceResult[]>;
|
2023-02-25 09:12:03 -05:00
|
|
|
}
|