Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge origin/main into codex/low-risk-quality-sweep-20260807

laurenspriem9a06f982c90b
diff --cc rust/crates/photos/src/ml/pet/detect.rs
index 071869b595,309329ad6e..4924a51f6a
--- a/rust/crates/photos/src/ml/pet/detect.rs
+++ b/rust/crates/photos/src/ml/pet/detect.rs
@@@ -16,41 -16,6 +16,34 @@@ const PET_FACE_MIN_SCORE: f32 = 0.3
const BODY_IOU_THRESHOLD: f32 = 0.5;
const BODY_MIN_SCORE: f32 = 0.3;
+impl NmsDetection for PetFaceDetection {
+ fn score(&self) -> f32 {
+ self.score
+ }
+
+ fn box_xyxy(&self) -> &[f32; 4] {
+ &self.box_xyxy
+ }
+
+ fn same_class(&self, other: &Self) -> bool {
+ self.class_id == other.class_id
+ }
+}
+
+impl NmsDetection for PetBodyDetection {
+ fn score(&self) -> f32 {
+ self.score
+ }
+
+ fn box_xyxy(&self) -> &[f32; 4] {
+ &self.box_xyxy
+ }
+
+ fn same_class(&self, other: &Self) -> bool {
+ self.coco_class == other.coco_class
+ }
+}
+
- // Species IDs used across both Rust and Dart:
- // 0 = dog (face detection class_id=0, COCO_DOG=16)
- // 1 = cat (face detection class_id=1, COCO_CAT=15)
- // Dart maps COCO β†’ species via: cocoClass == 15 ? 1 : 0
-
- /// Output format per row: [x, y, w, h, obj_conf, lx, ly, rx, ry, nx, ny, ...]
- /// 3 keypoints: left_eye, right_eye, nose (6 values for coords).
pub(crate) fn run_pet_face_detection(
runtime: &MlRuntimeView<'_>,
input: &YoloInput,