nc-photos/app/lib/entity/person/builder.dart

33 lines
1,021 B
Dart
Raw Normal View History

2023-07-03 19:23:42 +02:00
import 'package:nc_photos/account.dart';
import 'package:nc_photos/entity/face_recognition_person.dart';
import 'package:nc_photos/entity/person.dart';
import 'package:nc_photos/entity/person/content_provider/face_recognition.dart';
2023-07-16 13:30:23 +02:00
import 'package:nc_photos/entity/person/content_provider/recognize.dart';
import 'package:nc_photos/entity/recognize_face.dart';
import 'package:nc_photos/entity/recognize_face_item.dart';
2023-07-03 19:23:42 +02:00
class PersonBuilder {
static Person byFaceRecognitionPerson(
Account account, FaceRecognitionPerson person) {
return Person(
name: person.name,
contentProvider: PersonFaceRecognitionProvider(
account: account,
person: person,
),
);
}
2023-07-16 13:30:23 +02:00
static Person byRecognizeFace(
Account account, RecognizeFace face, List<RecognizeFaceItem>? items) {
return Person(
name: face.isNamed ? face.label : "",
contentProvider: PersonRecognizeProvider(
account: account,
face: face,
items: items,
),
);
}
2023-07-03 19:23:42 +02:00
}