[mob][face] Fix handling of case when noCluster id is assigned
This commit is contained in:
parent
67f26a1551
commit
412e93c9fa
1 changed files with 9 additions and 2 deletions
|
@ -240,6 +240,7 @@ class FaceClustering {
|
|||
isRunning = false;
|
||||
return faceIdToCluster;
|
||||
} catch (e, stackTrace) {
|
||||
_logger.severe('Error while running clustering', e, stackTrace);
|
||||
isRunning = false;
|
||||
rethrow;
|
||||
}
|
||||
|
@ -355,8 +356,7 @@ class FaceClustering {
|
|||
|
||||
// Make sure the first face has a clusterId
|
||||
final int totalFaces = sortedFaceInfos.length;
|
||||
// set current epoch time as clusterID
|
||||
int clusterID = DateTime.now().microsecondsSinceEpoch;
|
||||
|
||||
if (sortedFaceInfos.isEmpty) {
|
||||
return {};
|
||||
}
|
||||
|
@ -365,6 +365,13 @@ class FaceClustering {
|
|||
log(
|
||||
"[ClusterIsolate] ${DateTime.now()} Processing $totalFaces faces",
|
||||
);
|
||||
// set current epoch time as clusterID
|
||||
int clusterID = DateTime.now().microsecondsSinceEpoch;
|
||||
if (facesWithClusterID.isEmpty) {
|
||||
// assign a clusterID to the first face
|
||||
sortedFaceInfos[0].clusterId = clusterID;
|
||||
clusterID++;
|
||||
}
|
||||
final Map<String, int> newFaceIdToCluster = {};
|
||||
final stopwatchClustering = Stopwatch()..start();
|
||||
for (int i = 1; i < totalFaces; i++) {
|
||||
|
|
Loading…
Add table
Reference in a new issue