[mob] Fix issue with random photo entering cluster
This commit is contained in:
@@ -736,7 +736,7 @@ class FaceMLDataDB {
|
||||
for (final enteFile in files) {
|
||||
fileIds.add(enteFile.uploadedFileID.toString());
|
||||
}
|
||||
int maxClusterID = DateTime.now().millisecondsSinceEpoch;
|
||||
int maxClusterID = DateTime.now().microsecondsSinceEpoch;
|
||||
final Map<String, int> faceIDToClusterID = {};
|
||||
for (final row in faceIdsResult) {
|
||||
final faceID = row[fcFaceId] as String;
|
||||
@@ -762,7 +762,7 @@ class FaceMLDataDB {
|
||||
for (final enteFile in files) {
|
||||
fileIds.add(enteFile.uploadedFileID.toString());
|
||||
}
|
||||
int maxClusterID = DateTime.now().millisecondsSinceEpoch;
|
||||
int maxClusterID = DateTime.now().microsecondsSinceEpoch;
|
||||
final Map<String, int> faceIDToClusterID = {};
|
||||
for (final row in faceIdsResult) {
|
||||
final faceID = row[fcFaceId] as String;
|
||||
|
||||
@@ -353,14 +353,8 @@ 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().millisecondsSinceEpoch;
|
||||
if (sortedFaceInfos.isNotEmpty) {
|
||||
if (sortedFaceInfos.first.clusterId == null) {
|
||||
sortedFaceInfos.first.clusterId = clusterID;
|
||||
} else {
|
||||
clusterID = sortedFaceInfos.first.clusterId!;
|
||||
}
|
||||
} else {
|
||||
int clusterID = DateTime.now().microsecondsSinceEpoch;
|
||||
if (sortedFaceInfos.isEmpty) {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user