2023-08-29 09:58:00 -04:00
|
|
|
import { ApiProperty } from '@nestjs/swagger';
|
|
|
|
|
import { Type } from 'class-transformer';
|
2024-06-06 23:09:47 -04:00
|
|
|
import { IsNotEmpty, IsNumber, IsString, Max, Min } from 'class-validator';
|
|
|
|
|
import { ValidateBoolean } from 'src/validation';
|
2023-08-29 09:58:00 -04:00
|
|
|
|
2024-05-16 13:08:37 -04:00
|
|
|
export class TaskConfig {
|
2024-03-07 22:59:02 -05:00
|
|
|
@ValidateBoolean()
|
2023-08-29 09:58:00 -04:00
|
|
|
enabled!: boolean;
|
2024-05-16 13:08:37 -04:00
|
|
|
}
|
2023-08-29 09:58:00 -04:00
|
|
|
|
2024-05-16 13:08:37 -04:00
|
|
|
export class ModelConfig extends TaskConfig {
|
2023-08-29 09:58:00 -04:00
|
|
|
@IsString()
|
|
|
|
|
@IsNotEmpty()
|
|
|
|
|
modelName!: string;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-06 23:09:47 -04:00
|
|
|
export class CLIPConfig extends ModelConfig {}
|
2023-08-29 09:58:00 -04:00
|
|
|
|
2024-05-16 13:08:37 -04:00
|
|
|
export class DuplicateDetectionConfig extends TaskConfig {
|
|
|
|
|
@IsNumber()
|
|
|
|
|
@Min(0.001)
|
|
|
|
|
@Max(0.1)
|
|
|
|
|
@Type(() => Number)
|
2024-06-12 12:36:24 -04:00
|
|
|
@ApiProperty({ type: 'number', format: 'double' })
|
2024-05-16 13:08:37 -04:00
|
|
|
maxDistance!: number;
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-06 23:09:47 -04:00
|
|
|
export class FacialRecognitionConfig extends ModelConfig {
|
2023-08-29 09:58:00 -04:00
|
|
|
@IsNumber()
|
2024-09-24 04:03:59 +02:00
|
|
|
@Min(0.1)
|
2023-08-29 09:58:00 -04:00
|
|
|
@Max(1)
|
|
|
|
|
@Type(() => Number)
|
2024-06-12 12:36:24 -04:00
|
|
|
@ApiProperty({ type: 'number', format: 'double' })
|
2023-08-29 09:58:00 -04:00
|
|
|
minScore!: number;
|
|
|
|
|
|
|
|
|
|
@IsNumber()
|
2024-09-24 04:03:59 +02:00
|
|
|
@Min(0.1)
|
2023-08-29 09:58:00 -04:00
|
|
|
@Max(2)
|
|
|
|
|
@Type(() => Number)
|
2024-06-12 12:36:24 -04:00
|
|
|
@ApiProperty({ type: 'number', format: 'double' })
|
2023-08-29 09:58:00 -04:00
|
|
|
maxDistance!: number;
|
2023-09-18 06:05:35 +02:00
|
|
|
|
|
|
|
|
@IsNumber()
|
|
|
|
|
@Min(1)
|
|
|
|
|
@Type(() => Number)
|
|
|
|
|
@ApiProperty({ type: 'integer' })
|
|
|
|
|
minFaces!: number;
|
2023-08-29 09:58:00 -04:00
|
|
|
}
|