Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Remove pet detection fields after FRB regeneration

Amrithesh Kakkoth Ente976685ab00bf
diff --git a/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart b/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
index 859a7a4779..06560f07d1 100644
--- a/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
+++ b/mobile/apps/photos/lib/utils/isolate/isolate_operations.dart
@@ -329,16 +329,6 @@ Future<void> _ensureRustRuntimePrepared(Map<String, dynamic> args) async {
faceEmbedding: (args["faceEmbeddingModelPath"] as String?) ?? "",
clipImage: (args["clipImageModelPath"] as String?) ?? "",
clipText: (args["clipTextModelPath"] as String?) ?? "",
- petFaceDetection: (args["petFaceDetectionModelPath"] as String?) ?? "",
- petFaceEmbeddingDog:
- (args["petFaceEmbeddingDogModelPath"] as String?) ?? "",
- petFaceEmbeddingCat:
- (args["petFaceEmbeddingCatModelPath"] as String?) ?? "",
- petBodyDetection: (args["petBodyDetectionModelPath"] as String?) ?? "",
- petBodyEmbeddingDog:
- (args["petBodyEmbeddingDogModelPath"] as String?) ?? "",
- petBodyEmbeddingCat:
- (args["petBodyEmbeddingCatModelPath"] as String?) ?? "",
);
final providerPolicy = rust_ml.RustExecutionProviderPolicy(
preferCoreml: args["preferCoreml"] as bool? ?? true,
@@ -400,12 +390,6 @@ String _runtimeConfigCacheKey(
modelPaths.faceEmbedding,
modelPaths.clipImage,
modelPaths.clipText,
- modelPaths.petFaceDetection,
- modelPaths.petFaceEmbeddingDog,
- modelPaths.petFaceEmbeddingCat,
- modelPaths.petBodyDetection,
- modelPaths.petBodyEmbeddingDog,
- modelPaths.petBodyEmbeddingCat,
providerPolicy.preferCoreml,
providerPolicy.preferNnapi,
providerPolicy.preferXnnpack,
diff --git a/mobile/apps/photos/lib/utils/ml_util.dart b/mobile/apps/photos/lib/utils/ml_util.dart
index 173a18665f..34dcbd470c 100644
--- a/mobile/apps/photos/lib/utils/ml_util.dart
+++ b/mobile/apps/photos/lib/utils/ml_util.dart
@@ -702,12 +702,6 @@ Future<MLResult> analyzeImageRust(Map args) async {
faceEmbedding: faceEmbeddingModelPath ?? "",
clipImage: clipImageModelPath ?? "",
clipText: "",
- petFaceDetection: petFaceDetectionModelPath ?? "",
- petFaceEmbeddingDog: petFaceEmbeddingDogModelPath ?? "",
- petFaceEmbeddingCat: petFaceEmbeddingCatModelPath ?? "",
- petBodyDetection: petBodyDetectionModelPath ?? "",
- petBodyEmbeddingDog: petBodyEmbeddingDogModelPath ?? "",
- petBodyEmbeddingCat: petBodyEmbeddingCatModelPath ?? "",
);
final providerPolicy = rust_ml.RustExecutionProviderPolicy(
preferCoreml: preferCoreml,
@@ -725,7 +719,6 @@ Future<MLResult> analyzeImageRust(Map args) async {
imagePath: analyzePath,
runFaces: runFaces,
runClip: runClip,
- runPets: runPets,
modelPaths: modelPaths,
providerPolicy: providerPolicy,
),
@@ -880,46 +873,7 @@ Future<MLResult> analyzeImageRust(Map args) async {
);
}
- if (runPets) {
- if (rustResult.petFaces != null) {
- result.petFaces = rustResult.petFaces!.map((face) {
- final detection = FaceDetectionRelative(
- score: face.detection.score,
- box: face.detection.boxXyxy.toList(growable: false),
- allKeypoints: face.detection.keypoints
- .map((point) => point.toList(growable: false))
- .toList(growable: false),
- );
- final alignment = AlignmentResult(
- // Pet alignment is done in Rust; no Dart-side affine matrix needed.
- affineMatrix: const [],
- center: face.alignment.center.toList(growable: false),
- size: face.alignment.cropSize,
- rotation: face.alignment.angle,
- );
- return PetFaceResult(
- fileId: enteFileID,
- petFaceId: face.petFaceId,
- detection: detection,
- alignment: alignment,
- species: face.species,
- embedding: Embedding.from(face.faceEmbedding),
- );
- }).toList(growable: false);
- }
-
- if (rustResult.petBodies != null) {
- result.petBodies = rustResult.petBodies!.map((body) {
- return PetBodyResult(
- boxXyxy: body.boxXyxy.toList(growable: false),
- score: body.score,
- cocoClass: body.cocoClass,
- petBodyId: body.petBodyId,
- embedding: Embedding.from(body.bodyEmbedding),
- );
- }).toList(growable: false);
- }
- }
+ // TODO: pet detection (petFaces/petBodies) pending Rust implementation
return result;
} catch (e, s) {