[mob] Store image height and width
This commit is contained in:
@@ -681,6 +681,8 @@ class FaceMlService {
|
||||
result.mlVersion,
|
||||
error: result.errorOccured ? true : null,
|
||||
),
|
||||
height: result.faceDetectionImageSize!.height.truncate(),
|
||||
width: result.faceDetectionImageSize!.width.truncate(),
|
||||
),
|
||||
);
|
||||
await FaceMLDataDB.instance.bulkInsertFaces(faces);
|
||||
|
||||
@@ -2,6 +2,8 @@ import "package:photos/face/model/face.dart";
|
||||
|
||||
class FileMl {
|
||||
final int fileID;
|
||||
final int? height;
|
||||
final int? width;
|
||||
// json: face
|
||||
final FaceEmbeddings faceEmbedding;
|
||||
final ClipEmbedding? clipEmbedding;
|
||||
@@ -11,12 +13,16 @@ class FileMl {
|
||||
FileMl(
|
||||
this.fileID,
|
||||
this.faceEmbedding, {
|
||||
this.height,
|
||||
this.width,
|
||||
this.clipEmbedding,
|
||||
});
|
||||
|
||||
// toJson
|
||||
Map<String, dynamic> toJson() => {
|
||||
'fileID': fileID,
|
||||
'height': height,
|
||||
'width': width,
|
||||
'faceEmbedding': faceEmbedding.toJson(),
|
||||
'clipEmbedding': clipEmbedding?.toJson(),
|
||||
};
|
||||
@@ -25,6 +31,8 @@ class FileMl {
|
||||
return FileMl(
|
||||
json['fileID'] as int,
|
||||
FaceEmbeddings.fromJson(json['faceEmbedding'] as Map<String, dynamic>),
|
||||
height: json['height'] as int?,
|
||||
width: json['width'] as int?,
|
||||
clipEmbedding: json['clipEmbedding'] == null
|
||||
? null
|
||||
: ClipEmbedding.fromJson(
|
||||
|
||||
Reference in New Issue
Block a user