[mob] Fix face cluster suggestion

This commit is contained in:
Neeraj Gupta
2024-04-02 13:35:32 +05:30
parent 8e322114b7
commit c85692360c
2 changed files with 6 additions and 4 deletions

View File

@@ -545,13 +545,14 @@ class FaceMLDataDB {
final db = instance.database;
return db.then((db) async {
final List<Map<String, dynamic>> maps = await db.rawQuery(
'SELECT $cluserIDColumn, $fileIDColumn FROM $facesTable '
'WHERE $cluserIDColumn IN (${clusterIDs.join(",")})',
'SELECT $fcClusterID, $fcFaceId FROM $faceClustersTable '
'WHERE $fcClusterID IN (${clusterIDs.join(",")})',
);
final Map<int, Set<int>> result = {};
for (final map in maps) {
final clusterID = map[cluserIDColumn] as int;
final fileID = map[fileIDColumn] as int;
final clusterID = map[fcClusterID] as int;
final faceId = map[fcFaceId] as String;
final fileID = int.parse(faceId.split("_").first);
result[fileID] = (result[fileID] ?? {})..add(clusterID);
}
return result;

View File

@@ -186,6 +186,7 @@ class _FaceDebugSectionWidgetState extends State<FaceDebugSectionWidget> {
pressedColor: getEnteColorScheme(context).fillFaint,
trailingIcon: Icons.chevron_right_outlined,
trailingIconIsMuted: true,
alwaysShowSuccessState: true,
onTap: () async {
await showChoiceDialog(
context,