[mob] Make linter happy
This commit is contained in:
parent
ef03c6f40a
commit
199dad3705
6 changed files with 31 additions and 8 deletions
|
@ -215,7 +215,7 @@ class FaceMLDataDB {
|
|||
final List<int> fileId = [recentFileID];
|
||||
int? avatarFileId;
|
||||
if (avatarFaceId != null) {
|
||||
avatarFileId = int.tryParse(avatarFaceId!.split('_')[0]);
|
||||
avatarFileId = int.tryParse(avatarFaceId.split('_')[0]);
|
||||
if (avatarFileId != null) {
|
||||
fileId.add(avatarFileId);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
import "package:photos/face/model/person.dart";
|
||||
|
||||
enum MappingSource {
|
||||
local,
|
||||
remote,
|
||||
}
|
||||
|
||||
class ClustersMapping {
|
||||
final Map<int, Set<int>> fileIDToClusterIDs;
|
||||
final Map<int, String> clusterToPersonID;
|
||||
// personIDToPerson is a map of personID to PersonEntity, and it's same for
|
||||
// both local and remote sources
|
||||
final Map<String, PersonEntity> personIDToPerson;
|
||||
final MappingSource source;
|
||||
|
||||
ClustersMapping({
|
||||
required this.fileIDToClusterIDs,
|
||||
required this.clusterToPersonID,
|
||||
required this.personIDToPerson,
|
||||
required this.source,
|
||||
});
|
||||
}
|
|
@ -503,7 +503,7 @@ class FaceClustering {
|
|||
"[ClusterIsolate] ${DateTime.now()} Copied to isolate ${x.length} faces",
|
||||
);
|
||||
|
||||
DBSCAN dbscan = DBSCAN(
|
||||
final DBSCAN dbscan = DBSCAN(
|
||||
epsilon: eps,
|
||||
minPoints: minPts,
|
||||
distanceMeasure: cosineDistForNormVectors,
|
||||
|
|
|
@ -49,11 +49,11 @@ class PersonService {
|
|||
Future<Map<String, PersonEntity>> getPersonsMap() async {
|
||||
final entities = await entityService.getEntities(EntityType.person);
|
||||
final Map<String, PersonEntity> map = {};
|
||||
entities.forEach((e) {
|
||||
for (var e in entities) {
|
||||
final person =
|
||||
PersonEntity(e.id, PersonData.fromJson(json.decode(e.data)));
|
||||
map[person.remoteID] = person;
|
||||
});
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -745,7 +745,6 @@ class SearchService {
|
|||
final clusterIDToPerson =
|
||||
await FaceMLDataDB.instance.getClusterIdToPerson(personIdToPerson);
|
||||
|
||||
debugPrint("building result");
|
||||
final List<GenericSearchResult> facesResult = [];
|
||||
final Map<int, List<EnteFile>> clusterIdToFiles = {};
|
||||
final Map<String, List<EnteFile>> personIdToFiles = {};
|
||||
|
|
|
@ -26,8 +26,10 @@ class PersonFaceWidget extends StatelessWidget {
|
|||
this.personId,
|
||||
this.clusterID,
|
||||
Key? key,
|
||||
}) : assert(personId != null || clusterID != null,
|
||||
"PersonFaceWidget requires either personId or clusterID to be non-null"),
|
||||
}) : assert(
|
||||
personId != null || clusterID != null,
|
||||
"PersonFaceWidget requires either personId or clusterID to be non-null",
|
||||
),
|
||||
super(key: key);
|
||||
|
||||
@override
|
||||
|
@ -85,7 +87,7 @@ class PersonFaceWidget extends StatelessWidget {
|
|||
Future<Face?> _getFace() async {
|
||||
String? personAvatarFaceID;
|
||||
if (personId != null) {
|
||||
PersonEntity? personEntity =
|
||||
final PersonEntity? personEntity =
|
||||
await PersonService.instance.getPerson(personId!);
|
||||
if (personEntity != null) {
|
||||
personAvatarFaceID = personEntity.data.avatarFaceId;
|
||||
|
|
Loading…
Add table
Reference in a new issue