[mob][photos] Fetch remote feedback before clustering (#1888)
## Description See title
This commit is contained in:
commit
05579ef368
|
@ -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
|
||||||
|
|
|
@ -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));
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue