[mob] Minor changes to clustering
This commit is contained in:
parent
b5cff212bb
commit
f94aa400bf
2 changed files with 8 additions and 2 deletions
|
@ -131,12 +131,13 @@ class FaceLinearClustering {
|
|||
final errorStackTrace = receivedMessage['stackTrace'];
|
||||
final exception = Exception(errorMessage);
|
||||
final stackTrace = StackTrace.fromString(errorStackTrace);
|
||||
_activeTasks--;
|
||||
completer.completeError(exception, stackTrace);
|
||||
} else {
|
||||
_activeTasks--;
|
||||
completer.complete(receivedMessage);
|
||||
}
|
||||
});
|
||||
_activeTasks--;
|
||||
|
||||
return completer.future;
|
||||
}
|
||||
|
|
|
@ -374,11 +374,16 @@ class FaceMlService {
|
|||
final faceIdToEmbedding = await FaceMLDataDB.instance.getFaceEmbeddingMap(
|
||||
minScore: minFaceScore,
|
||||
);
|
||||
_logger.info('read embeddings ${faceIdToEmbedding.length} ');
|
||||
final gotFaceEmbeddingsTime = DateTime.now();
|
||||
_logger.info(
|
||||
'read embeddings ${faceIdToEmbedding.length} in ${gotFaceEmbeddingsTime.difference(clusterStartTime).inMilliseconds} ms',
|
||||
);
|
||||
|
||||
// Read the creation times from Files DB, in a map from fileID to creation time
|
||||
final fileIDToCreationTime =
|
||||
await FilesDB.instance.getFileIDToCreationTime();
|
||||
_logger.info('read creation times from FilesDB in '
|
||||
'${DateTime.now().difference(gotFaceEmbeddingsTime).inMilliseconds} ms');
|
||||
|
||||
// Cluster the embeddings using the linear clustering algorithm, returning a map from faceID to clusterID
|
||||
final faceIdToCluster = await FaceLinearClustering.instance.predict(
|
||||
|
|
Loading…
Add table
Reference in a new issue