mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(web): add setting for minimum face count for face detection (#4128)
* feat: add setting for minimum face count for face detection Adds the minimum face count setting to the web interface to circumvent detection of strangers and random background people if desired. * fix: codestyle, remove max for face count
This commit is contained in:
1
mobile/openapi/doc/RecognitionConfig.md
generated
1
mobile/openapi/doc/RecognitionConfig.md
generated
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enabled** | **bool** | |
|
||||
**maxDistance** | **int** | |
|
||||
**minFaces** | **int** | |
|
||||
**minScore** | **int** | |
|
||||
**modelName** | **String** | |
|
||||
**modelType** | [**ModelType**](ModelType.md) | | [optional]
|
||||
|
||||
10
mobile/openapi/lib/model/recognition_config.dart
generated
10
mobile/openapi/lib/model/recognition_config.dart
generated
@@ -15,6 +15,7 @@ class RecognitionConfig {
|
||||
RecognitionConfig({
|
||||
required this.enabled,
|
||||
required this.maxDistance,
|
||||
required this.minFaces,
|
||||
required this.minScore,
|
||||
required this.modelName,
|
||||
this.modelType,
|
||||
@@ -24,6 +25,8 @@ class RecognitionConfig {
|
||||
|
||||
int maxDistance;
|
||||
|
||||
int minFaces;
|
||||
|
||||
int minScore;
|
||||
|
||||
String modelName;
|
||||
@@ -40,6 +43,7 @@ class RecognitionConfig {
|
||||
bool operator ==(Object other) => identical(this, other) || other is RecognitionConfig &&
|
||||
other.enabled == enabled &&
|
||||
other.maxDistance == maxDistance &&
|
||||
other.minFaces == minFaces &&
|
||||
other.minScore == minScore &&
|
||||
other.modelName == modelName &&
|
||||
other.modelType == modelType;
|
||||
@@ -49,17 +53,19 @@ class RecognitionConfig {
|
||||
// ignore: unnecessary_parenthesis
|
||||
(enabled.hashCode) +
|
||||
(maxDistance.hashCode) +
|
||||
(minFaces.hashCode) +
|
||||
(minScore.hashCode) +
|
||||
(modelName.hashCode) +
|
||||
(modelType == null ? 0 : modelType!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'RecognitionConfig[enabled=$enabled, maxDistance=$maxDistance, minScore=$minScore, modelName=$modelName, modelType=$modelType]';
|
||||
String toString() => 'RecognitionConfig[enabled=$enabled, maxDistance=$maxDistance, minFaces=$minFaces, minScore=$minScore, modelName=$modelName, modelType=$modelType]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'enabled'] = this.enabled;
|
||||
json[r'maxDistance'] = this.maxDistance;
|
||||
json[r'minFaces'] = this.minFaces;
|
||||
json[r'minScore'] = this.minScore;
|
||||
json[r'modelName'] = this.modelName;
|
||||
if (this.modelType != null) {
|
||||
@@ -80,6 +86,7 @@ class RecognitionConfig {
|
||||
return RecognitionConfig(
|
||||
enabled: mapValueOfType<bool>(json, r'enabled')!,
|
||||
maxDistance: mapValueOfType<int>(json, r'maxDistance')!,
|
||||
minFaces: mapValueOfType<int>(json, r'minFaces')!,
|
||||
minScore: mapValueOfType<int>(json, r'minScore')!,
|
||||
modelName: mapValueOfType<String>(json, r'modelName')!,
|
||||
modelType: ModelType.fromJson(json[r'modelType']),
|
||||
@@ -132,6 +139,7 @@ class RecognitionConfig {
|
||||
static const requiredKeys = <String>{
|
||||
'enabled',
|
||||
'maxDistance',
|
||||
'minFaces',
|
||||
'minScore',
|
||||
'modelName',
|
||||
};
|
||||
|
||||
5
mobile/openapi/test/recognition_config_test.dart
generated
5
mobile/openapi/test/recognition_config_test.dart
generated
@@ -26,6 +26,11 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// int minFaces
|
||||
test('to test the property `minFaces`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// int minScore
|
||||
test('to test the property `minScore`', () async {
|
||||
// TODO
|
||||
|
||||
Reference in New Issue
Block a user