From ec32a9e6109342bcb9871eac0fa22bb055cfb3af Mon Sep 17 00:00:00 2001 From: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Date: Tue, 24 Sep 2024 04:03:59 +0200 Subject: [PATCH] fix: set min values for face detection to reasonable values (#12877) fix: set min values for face detection to >0 --- .../lib/model/facial_recognition_config.dart | Bin 4138 -> 4142 bytes open-api/immich-openapi-specs.json | 4 ++-- server/src/dtos/model-config.dto.ts | 4 ++-- .../machine-learning-settings.svelte | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mobile/openapi/lib/model/facial_recognition_config.dart b/mobile/openapi/lib/model/facial_recognition_config.dart index 4acfd4e20ff17ededfc9165557b28272290801c7..439efbbfaeeb1f952db6ac251999b00dccb19126 100644 GIT binary patch delta 26 gcmZ3buufq^5EGN0;pF{HVv{qN!hy`q`<{9 delta 16 XcmZ3duu5S=5YyxkrrgbknX-8SHE{*w diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index 4e7c711978..99ea313063 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -9119,7 +9119,7 @@ "maxDistance": { "format": "double", "maximum": 2, - "minimum": 0, + "minimum": 0.1, "type": "number" }, "minFaces": { @@ -9129,7 +9129,7 @@ "minScore": { "format": "double", "maximum": 1, - "minimum": 0, + "minimum": 0.1, "type": "number" }, "modelName": { diff --git a/server/src/dtos/model-config.dto.ts b/server/src/dtos/model-config.dto.ts index dffacc793d..f8b9e2043f 100644 --- a/server/src/dtos/model-config.dto.ts +++ b/server/src/dtos/model-config.dto.ts @@ -27,14 +27,14 @@ export class DuplicateDetectionConfig extends TaskConfig { export class FacialRecognitionConfig extends ModelConfig { @IsNumber() - @Min(0) + @Min(0.1) @Max(1) @Type(() => Number) @ApiProperty({ type: 'number', format: 'double' }) minScore!: number; @IsNumber() - @Min(0) + @Min(0.1) @Max(2) @Type(() => Number) @ApiProperty({ type: 'number', format: 'double' }) diff --git a/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte b/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte index 05a5224bd0..aac8cd5212 100644 --- a/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte +++ b/web/src/lib/components/admin-page/settings/machine-learning-settings/machine-learning-settings.svelte @@ -145,7 +145,7 @@ desc={$t('admin.machine_learning_min_detection_score_description')} bind:value={config.machineLearning.facialRecognition.minScore} step="0.1" - min={0} + min={0.1} max={1} disabled={disabled || !config.machineLearning.enabled || !config.machineLearning.facialRecognition.enabled} isEdited={config.machineLearning.facialRecognition.minScore !== @@ -158,7 +158,7 @@ desc={$t('admin.machine_learning_max_recognition_distance_description')} bind:value={config.machineLearning.facialRecognition.maxDistance} step="0.1" - min={0} + min={0.1} max={2} disabled={disabled || !config.machineLearning.enabled || !config.machineLearning.facialRecognition.enabled} isEdited={config.machineLearning.facialRecognition.maxDistance !==