π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Remove unused fromRustResult factories from pet DB mappers
Amrithesh Kakkoth Ente9411fa42752a
diff --git a/mobile/apps/photos/lib/db/ml/db_pet_model_mappers.dart b/mobile/apps/photos/lib/db/ml/db_pet_model_mappers.dartindex 0b1304879c..75e35e96f1 100644--- a/mobile/apps/photos/lib/db/ml/db_pet_model_mappers.dart+++ b/mobile/apps/photos/lib/db/ml/db_pet_model_mappers.dart@@ -1,12 +1,7 @@-import "dart:convert";import "dart:typed_data" show Uint8List;import "package:ente_pure_utils/ente_pure_utils.dart";import "package:photos/db/ml/schema.dart";-import "package:photos/models/ml/face/box.dart";-import "package:photos/models/ml/face/detection.dart";-import "package:photos/models/ml/face/landmark.dart";-import "package:photos/services/machine_learning/ml_result.dart";// ββ Pet Face DB Mapper ββ@@ -38,43 +33,6 @@ class DBPetFace {this.embeddingBlob,});- /// Convert a [FaceResult] (from Rust) into a DB row, embedding the assigned [vectorId].- factory DBPetFace.fromRustResult({- required int fileId,- required FaceResult rustResult,- required int vectorId,- required int imageHeight,- required int imageWidth,- required int mlVersion,- required String speciesLabel,- }) {- // Mirror the human face detection JSON structure- final detectionObj = Detection(- box: FaceBox(- x: rustResult.detection.xMinBox,- y: rustResult.detection.yMinBox,- width: rustResult.detection.width,- height: rustResult.detection.height,- ),- landmarks: rustResult.detection.allKeypoints- .map((kp) => Landmark(x: kp[0], y: kp[1]))- .toList(),- );-- return DBPetFace(- fileId: fileId,- petFaceId: rustResult.faceId,- detection: jsonEncode(detectionObj.toJson()),- landmarks: jsonEncode(rustResult.detection.allKeypoints),- faceVectorId: vectorId,- species: speciesLabel,- faceScore: rustResult.detection.score,- imageHeight: imageHeight,- imageWidth: imageWidth,- mlVersion: mlVersion,- );- }-Map<String, dynamic> toMap() {return {fileIDColumn: fileId,@@ -136,45 +94,6 @@ class DBPetBody {this.embeddingBlob,});- /// Convert to DB row given the bounding box, class, and assigned [vectorId].- /// boxXyxy: [xMin, yMin, xMax, yMax]- factory DBPetBody.fromRustResult({- required int fileId,- required String petBodyId,- required List<double> boxXyxy,- required double score,- required int vectorId,- required int imageHeight,- required int imageWidth,- required int mlVersion,- required String speciesLabel,- }) {- final width = boxXyxy[2] - boxXyxy[0];- final height = boxXyxy[3] - boxXyxy[1];-- final detectionObj = Detection(- box: FaceBox(- x: boxXyxy[0],- y: boxXyxy[1],- width: width,- height: height,- ),- landmarks: const [], // Bodies don't have landmarks- );-- return DBPetBody(- fileId: fileId,- petBodyId: petBodyId,- detection: jsonEncode(detectionObj.toJson()),- bodyVectorId: vectorId,- species: speciesLabel,- faceScore: score,- imageHeight: imageHeight,- imageWidth: imageWidth,- mlVersion: mlVersion,- );- }-Map<String, dynamic> toMap() {return {fileIDColumn: fileId,