mirror of
https://github.com/ente-io/ente.git
synced 2025-08-08 15:30:40 +00:00
[mob][photos] Skip cluster bucket if everything already has a clusterID
This commit is contained in:
parent
50968fd6a1
commit
b64077d5e7
@ -506,9 +506,7 @@ class FaceClusteringService {
|
|||||||
// WARNING: The loop below is now O(n^2) so be very careful with anything you put in there!
|
// WARNING: The loop below is now O(n^2) so be very careful with anything you put in there!
|
||||||
for (int j = i - 1; j >= 0; j--) {
|
for (int j = i - 1; j >= 0; j--) {
|
||||||
final double distance = 1 -
|
final double distance = 1 -
|
||||||
sortedFaceInfos[i]
|
sortedFaceInfos[i].vEmbedding!.dot(sortedFaceInfos[j].vEmbedding!);
|
||||||
.vEmbedding!
|
|
||||||
.dot(sortedFaceInfos[j].vEmbedding!);
|
|
||||||
if (distance < closestDistance) {
|
if (distance < closestDistance) {
|
||||||
if (sortedFaceInfos[j].badFace! &&
|
if (sortedFaceInfos[j].badFace! &&
|
||||||
distance > conservativeDistanceThreshold) {
|
distance > conservativeDistanceThreshold) {
|
||||||
|
@ -651,6 +651,18 @@ class FaceMlService {
|
|||||||
min(offset + bucketSize, allFaceInfoForClustering.length),
|
min(offset + bucketSize, allFaceInfoForClustering.length),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (faceInfoForClustering.every((face) => face.clusterId != null)) {
|
||||||
|
_logger.info('Everything in bucket $bucket is already clustered');
|
||||||
|
if (offset + bucketSize >= totalFaces) {
|
||||||
|
_logger.info('All faces clustered');
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
_logger.info('Skipping to next bucket');
|
||||||
|
offset += offsetIncrement;
|
||||||
|
bucket++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
final clusteringResult =
|
final clusteringResult =
|
||||||
await FaceClusteringService.instance.predictLinear(
|
await FaceClusteringService.instance.predictLinear(
|
||||||
faceInfoForClustering.toSet(),
|
faceInfoForClustering.toSet(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user