[mob][photos] Initial settings screen for face recognition
This commit is contained in:
parent
ccec166fa0
commit
e414128f18
27 changed files with 153 additions and 16 deletions
|
@ -1 +1 @@
|
|||
Subproject commit 8a3731352af133a02223a6c7b1f37c4abb096af0
|
||||
Subproject commit 8e7701d6a40462733043f54b3849faf35af70a83
|
4
mobile/lib/generated/intl/messages_cs.dart
generated
4
mobile/lib/generated/intl/messages_cs.dart
generated
|
@ -46,6 +46,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"Edits to location will only be seen within Ente"),
|
||||
"enterPersonName":
|
||||
MessageLookupByLibrary.simpleMessage("Enter person name"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
|
||||
"joinDiscord": MessageLookupByLibrary.simpleMessage("Join Discord"),
|
||||
"locations": MessageLookupByLibrary.simpleMessage("Locations"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_de.dart
generated
4
mobile/lib/generated/intl/messages_de.dart
generated
|
@ -702,6 +702,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
MessageLookupByLibrary.simpleMessage("Protokolle exportieren"),
|
||||
"exportYourData":
|
||||
MessageLookupByLibrary.simpleMessage("Daten exportieren"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"faces": MessageLookupByLibrary.simpleMessage("Gesichter"),
|
||||
"failedToApplyCode": MessageLookupByLibrary.simpleMessage(
|
||||
"Der Code konnte nicht aktiviert werden"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_en.dart
generated
4
mobile/lib/generated/intl/messages_en.dart
generated
|
@ -700,6 +700,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"exportLogs": MessageLookupByLibrary.simpleMessage("Export logs"),
|
||||
"exportYourData":
|
||||
MessageLookupByLibrary.simpleMessage("Export your data"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"faces": MessageLookupByLibrary.simpleMessage("Faces"),
|
||||
"failedToApplyCode":
|
||||
MessageLookupByLibrary.simpleMessage("Failed to apply code"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_es.dart
generated
4
mobile/lib/generated/intl/messages_es.dart
generated
|
@ -611,6 +611,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
MessageLookupByLibrary.simpleMessage("Exportar registros"),
|
||||
"exportYourData":
|
||||
MessageLookupByLibrary.simpleMessage("Exportar tus datos"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"failedToApplyCode":
|
||||
MessageLookupByLibrary.simpleMessage("Error al aplicar el código"),
|
||||
"failedToCancel":
|
||||
|
|
4
mobile/lib/generated/intl/messages_fr.dart
generated
4
mobile/lib/generated/intl/messages_fr.dart
generated
|
@ -690,6 +690,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"exportLogs": MessageLookupByLibrary.simpleMessage("Exporter les logs"),
|
||||
"exportYourData":
|
||||
MessageLookupByLibrary.simpleMessage("Exportez vos données"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"faces": MessageLookupByLibrary.simpleMessage("Visages"),
|
||||
"failedToApplyCode": MessageLookupByLibrary.simpleMessage(
|
||||
"Impossible d\'appliquer le code"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_it.dart
generated
4
mobile/lib/generated/intl/messages_it.dart
generated
|
@ -667,6 +667,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"Questo link è scaduto. Si prega di selezionare un nuovo orario di scadenza o disabilitare la scadenza del link."),
|
||||
"exportLogs": MessageLookupByLibrary.simpleMessage("Esporta log"),
|
||||
"exportYourData": MessageLookupByLibrary.simpleMessage("Esporta dati"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"failedToApplyCode": MessageLookupByLibrary.simpleMessage(
|
||||
"Impossibile applicare il codice"),
|
||||
"failedToCancel":
|
||||
|
|
4
mobile/lib/generated/intl/messages_ko.dart
generated
4
mobile/lib/generated/intl/messages_ko.dart
generated
|
@ -46,6 +46,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"Edits to location will only be seen within Ente"),
|
||||
"enterPersonName":
|
||||
MessageLookupByLibrary.simpleMessage("Enter person name"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
|
||||
"joinDiscord": MessageLookupByLibrary.simpleMessage("Join Discord"),
|
||||
"locations": MessageLookupByLibrary.simpleMessage("Locations"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_nl.dart
generated
4
mobile/lib/generated/intl/messages_nl.dart
generated
|
@ -723,6 +723,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
MessageLookupByLibrary.simpleMessage("Logboek exporteren"),
|
||||
"exportYourData":
|
||||
MessageLookupByLibrary.simpleMessage("Exporteer je gegevens"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"faces": MessageLookupByLibrary.simpleMessage("Gezichten"),
|
||||
"failedToApplyCode":
|
||||
MessageLookupByLibrary.simpleMessage("Code toepassen mislukt"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_no.dart
generated
4
mobile/lib/generated/intl/messages_no.dart
generated
|
@ -63,6 +63,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"Vennligst skriv inn en gyldig e-postadresse."),
|
||||
"enterYourEmailAddress": MessageLookupByLibrary.simpleMessage(
|
||||
"Skriv inn e-postadressen din"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"feedback": MessageLookupByLibrary.simpleMessage("Tilbakemelding"),
|
||||
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
|
||||
"invalidEmailAddress":
|
||||
|
|
4
mobile/lib/generated/intl/messages_pl.dart
generated
4
mobile/lib/generated/intl/messages_pl.dart
generated
|
@ -111,6 +111,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
MessageLookupByLibrary.simpleMessage("Wprowadź hasło"),
|
||||
"enterYourRecoveryKey": MessageLookupByLibrary.simpleMessage(
|
||||
"Wprowadź swój klucz odzyskiwania"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"feedback": MessageLookupByLibrary.simpleMessage("Informacja zwrotna"),
|
||||
"fileTypes": MessageLookupByLibrary.simpleMessage("File types"),
|
||||
"forgotPassword":
|
||||
|
|
4
mobile/lib/generated/intl/messages_pt.dart
generated
4
mobile/lib/generated/intl/messages_pt.dart
generated
|
@ -713,6 +713,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
"exportLogs": MessageLookupByLibrary.simpleMessage("Exportar logs"),
|
||||
"exportYourData":
|
||||
MessageLookupByLibrary.simpleMessage("Exportar seus dados"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"faces": MessageLookupByLibrary.simpleMessage("Rostos"),
|
||||
"failedToApplyCode":
|
||||
MessageLookupByLibrary.simpleMessage("Falha ao aplicar o código"),
|
||||
|
|
4
mobile/lib/generated/intl/messages_zh.dart
generated
4
mobile/lib/generated/intl/messages_zh.dart
generated
|
@ -592,6 +592,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
|||
MessageLookupByLibrary.simpleMessage("此链接已过期。请选择新的过期时间或禁用链接有效期。"),
|
||||
"exportLogs": MessageLookupByLibrary.simpleMessage("导出日志"),
|
||||
"exportYourData": MessageLookupByLibrary.simpleMessage("导出您的数据"),
|
||||
"faceRecognition":
|
||||
MessageLookupByLibrary.simpleMessage("Face recognition"),
|
||||
"faceRecognitionIndexingDescription": MessageLookupByLibrary.simpleMessage(
|
||||
"Please note that this will result in a higher bandwidth and battery usage until all items are indexed."),
|
||||
"faces": MessageLookupByLibrary.simpleMessage("人脸"),
|
||||
"failedToApplyCode": MessageLookupByLibrary.simpleMessage("无法使用此代码"),
|
||||
"failedToCancel": MessageLookupByLibrary.simpleMessage("取消失败"),
|
||||
|
|
20
mobile/lib/generated/l10n.dart
generated
20
mobile/lib/generated/l10n.dart
generated
|
@ -8753,6 +8753,26 @@ class S {
|
|||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Face recognition`
|
||||
String get faceRecognition {
|
||||
return Intl.message(
|
||||
'Face recognition',
|
||||
name: 'faceRecognition',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Please note that this will result in a higher bandwidth and battery usage until all items are indexed.`
|
||||
String get faceRecognitionIndexingDescription {
|
||||
return Intl.message(
|
||||
'Please note that this will result in a higher bandwidth and battery usage until all items are indexed.',
|
||||
name: 'faceRecognitionIndexingDescription',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppLocalizationDelegate extends LocalizationsDelegate<S> {
|
||||
|
|
|
@ -20,5 +20,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1208,5 +1208,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1231,5 +1231,7 @@
|
|||
"castIPMismatchBody": "Please make sure you are on the same network as the TV.",
|
||||
"pairingComplete": "Pairing complete",
|
||||
"autoPair": "Auto pair",
|
||||
"pairWithPin": "Pair with PIN"
|
||||
"pairWithPin": "Pair with PIN",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -982,5 +982,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1163,5 +1163,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1125,5 +1125,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -20,5 +20,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1226,5 +1226,7 @@
|
|||
"stopCastingBody": "Wil je stoppen met casten?",
|
||||
"castIPMismatchTitle": "Album casten mislukt",
|
||||
"castIPMismatchBody": "Zorg ervoor dat je op hetzelfde netwerk zit als de tv.",
|
||||
"pairingComplete": "Koppeling voltooid"
|
||||
"pairingComplete": "Koppeling voltooid",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -34,5 +34,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -121,5 +121,7 @@
|
|||
"createCollaborativeLink": "Create collaborative link",
|
||||
"search": "Search",
|
||||
"enterPersonName": "Enter person name",
|
||||
"removePersonLabel": "Remove person label"
|
||||
"removePersonLabel": "Remove person label",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1226,5 +1226,7 @@
|
|||
"stopCastingBody": "Você quer parar a transmissão?",
|
||||
"castIPMismatchTitle": "Falha ao transmitir álbum",
|
||||
"castIPMismatchBody": "Certifique-se de estar na mesma rede que a TV.",
|
||||
"pairingComplete": "Pareamento concluído"
|
||||
"pairingComplete": "Pareamento concluído",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -1226,5 +1226,7 @@
|
|||
"stopCastingBody": "您想停止投放吗?",
|
||||
"castIPMismatchTitle": "投放相册失败",
|
||||
"castIPMismatchBody": "请确保您的设备与电视处于同一网络。",
|
||||
"pairingComplete": "配对完成"
|
||||
"pairingComplete": "配对完成",
|
||||
"faceRecognition": "Face recognition",
|
||||
"faceRecognitionIndexingDescription": "Please note that this will result in a higher bandwidth and battery usage until all items are indexed."
|
||||
}
|
|
@ -6,6 +6,7 @@ import "package:photos/core/event_bus.dart";
|
|||
import 'package:photos/events/embedding_updated_event.dart';
|
||||
import "package:photos/generated/l10n.dart";
|
||||
import "package:photos/service_locator.dart";
|
||||
import "package:photos/services/machine_learning/face_ml/face_ml_service.dart";
|
||||
import 'package:photos/services/machine_learning/semantic_search/frameworks/ml_framework.dart';
|
||||
import 'package:photos/services/machine_learning/semantic_search/semantic_search_service.dart';
|
||||
import "package:photos/theme/ente_theme.dart";
|
||||
|
@ -89,6 +90,8 @@ class _MachineLearningSettingsPageState
|
|||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_getMagicSearchSettings(context),
|
||||
const SizedBox(height: 12),
|
||||
_getFacesSearchSettings(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
@ -147,7 +150,7 @@ class _MachineLearningSettingsPageState
|
|||
children: [
|
||||
_state == InitializationState.initialized
|
||||
? const MagicSearchIndexStatsWidget()
|
||||
: ModelLoadingState(_state),
|
||||
: MagicSearchModelLoadingState(_state),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
|
@ -174,12 +177,54 @@ class _MachineLearningSettingsPageState
|
|||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _getFacesSearchSettings(BuildContext context) {
|
||||
final colorScheme = getEnteColorScheme(context);
|
||||
final hasEnabled = LocalSettings.instance.isFaceIndexingEnabled;
|
||||
return Column(
|
||||
children: [
|
||||
MenuItemWidget(
|
||||
captionedTextWidget: CaptionedTextWidget(
|
||||
title: S.of(context).faceRecognition,
|
||||
),
|
||||
menuItemColor: colorScheme.fillFaint,
|
||||
trailingWidget: ToggleSwitchWidget(
|
||||
value: () => LocalSettings.instance.isFaceIndexingEnabled,
|
||||
onChanged: () async {
|
||||
final isEnabled =
|
||||
await LocalSettings.instance.toggleFaceIndexing();
|
||||
if (isEnabled) {
|
||||
unawaited(FaceMlService.instance.ensureInitialized());
|
||||
} else {
|
||||
FaceMlService.instance.pauseIndexing();
|
||||
}
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
},
|
||||
),
|
||||
singleBorderRadius: 8,
|
||||
alignCaptionedTextToLeft: true,
|
||||
isGestureDetectorDisabled: true,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
MenuSectionDescriptionWidget(
|
||||
content: S.of(context).faceRecognitionIndexingDescription,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ModelLoadingState extends StatelessWidget {
|
||||
class MagicSearchModelLoadingState extends StatelessWidget {
|
||||
final InitializationState state;
|
||||
|
||||
const ModelLoadingState(
|
||||
const MagicSearchModelLoadingState(
|
||||
this.state, {
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
|
Loading…
Reference in a new issue