[mob][photos] Fetch remote feedback before clustering

This commit is contained in:
laurenspriem 2024-05-27 18:31:17 +05:30
parent 232acfa211
commit 90e467c7c0
3 changed files with 6 additions and 3 deletions

View file

@ -580,6 +580,9 @@ class FaceMlService {
_isIndexingOrClusteringRunning = true; _isIndexingOrClusteringRunning = true;
final clusterAllImagesTime = DateTime.now(); final clusterAllImagesTime = DateTime.now();
_logger.info('Pulling remote feedback before actually clustering');
await PersonService.instance.fetchRemoteClusterFeedback();
try { try {
// Get a sense of the total number of faces in the database // Get a sense of the total number of faces in the database
final int totalFaces = await FaceMLDataDB.instance final int totalFaces = await FaceMLDataDB.instance

View file

@ -73,7 +73,7 @@ class PersonService {
Future<void> reconcileClusters() async { Future<void> reconcileClusters() async {
final EnteWatch? w = kDebugMode ? EnteWatch("reconcileClusters") : null; final EnteWatch? w = kDebugMode ? EnteWatch("reconcileClusters") : null;
w?.start(); w?.start();
await storeRemoteFeedback(); await fetchRemoteClusterFeedback();
w?.log("Stored remote feedback"); w?.log("Stored remote feedback");
final dbPersonClusterInfo = final dbPersonClusterInfo =
await faceMLDataDB.getPersonToClusterIdToFaceIds(); await faceMLDataDB.getPersonToClusterIdToFaceIds();
@ -225,7 +225,7 @@ class PersonService {
Bus.instance.fire(PeopleChangedEvent()); Bus.instance.fire(PeopleChangedEvent());
} }
Future<void> storeRemoteFeedback() async { Future<void> fetchRemoteClusterFeedback() async {
await entityService.syncEntities(); await entityService.syncEntities();
final entities = await entityService.getEntities(EntityType.person); final entities = await entityService.getEntities(EntityType.person);
entities.sort((a, b) => a.updatedAt.compareTo(b.updatedAt)); entities.sort((a, b) => a.updatedAt.compareTo(b.updatedAt));

View file

@ -193,7 +193,7 @@ class _FaceDebugSectionWidgetState extends State<FaceDebugSectionWidget> {
trailingIconIsMuted: true, trailingIconIsMuted: true,
onTap: () async { onTap: () async {
try { try {
await PersonService.instance.storeRemoteFeedback(); await PersonService.instance.fetchRemoteClusterFeedback();
FaceMlService.instance.debugIndexingDisabled = false; FaceMlService.instance.debugIndexingDisabled = false;
await FaceMlService.instance await FaceMlService.instance
.clusterAllImages(clusterInBuckets: true); .clusterAllImages(clusterInBuckets: true);