Skip to content

[POC] MS-1608 Tracking capture PoC implementation - #1837

Draft
luhmirin-s wants to merge 8 commits into
mainfrom
spike/MS-1608-free-face-capture
Draft

luhmirin-s wants to merge 8 commits into
mainfrom
spike/MS-1608-free-face-capture

Conversation

@luhmirin-s

@luhmirin-s luhmirin-s commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Disclaimer:

This is a PoC implementation, not a intended to be merged as-is; PR was created to run CoPilot, create a debug build for delivery and for the curious.

JIRA ticket
Will be released in: 2027.1.0

Notable changes

  • Introduces a new toggle for the capture to replace the cutout with face tracking during capture. More details are available in the design doc
  • All new behaviour is hidden under 2 feature flags:
    • faceTrackingCaptureEnabled - to enable the new mode
    • faceTrackingProgressAroundCaptureButton - moves progress indicator from target to progress button
  • There are also temporary size configuration parameters for minimal and maximal cropped capture size.

Testing guidance

  • Add feature flags, run some face capture flows.

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

@luhmirin-s
luhmirin-s requested a lite review from Copilot September 22, 2026 11:53
@cla-bot cla-bot Bot added the ... label Sep 22, 2026
@luhmirin-s luhmirin-s changed the title MS-1608 Tracking capture PoC implementation [POC] MS-1608 Tracking capture PoC implementation Sep 22, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Critical bitmap-lifecycle issues and additional tracking, enrichment, and UI mapping defects remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 2 High severity

Open (2)
What changed in this PR

Adds feature-flagged face-tracking capture with dominant-face selection, square cropping, configurable sizing, detector support, tracking UI, and tests.

Changes:

  • Adds tracking configuration, face selection, geometry, and cropping.
  • Integrates tracking overlays, progress rendering, camera modes, and layouts.
  • Extends detectors and adds configuration, crop, detector, and ViewModel tests.
File Reviewed change / findings
infra/​core/​src/​main/​java/​com/​simprints/​core/​tools/​extensions/​RectF.ext.kt Adds rectangle scaling helpers.
infra/​config-store/​src/​test/​java/​com/​simprints/​infra/​config/​store/​models/​ExperimentalProjectConfigurationTest.kt Tests tracking configuration parsing.
infra/​config-store/​src/​main/​java/​com/​simprints/​infra/​config/​store/​models/​ExperimentalProjectConfiguration.kt Adds tracking flags and size settings.
face/​infra/​simface/​src/​test/​java/​com/​simprints/​face/​infra/​simface/​detection/​SimFaceDetectorTest.kt Tests face selector behavior.
face/​infra/​simface/​src/​main/​java/​com/​simprints/​face/​infra/​simface/​detection/​SimFaceDetector.kt Supports selected-face extraction.
face/​infra/​roc-v3/​src/​main/​java/​com/​simprints/​face/​infra/​rocv3/​detection/​RocV3Detector.kt Supports multiple detections and selection.
face/​infra/​roc-v1/​src/​main/​java/​com/​simprints/​face/​infra/​rocv1/​detection/​RocV1Detector.kt Supports multiple detections and selection.
face/​infra/​base-bio-sdk/​src/​main/​java/​com/​simprints/​face/​infra/​basebiosdk/​detection/​FaceDetector.kt Adds face-selection support.
face/​capture/​src/​test/​java/​com/​simprints/​face/​capture/​usecases/​SelectDominantFaceUseCaseTest.kt Tests dominant-face selection.
face/​capture/​src/​test/​java/​com/​simprints/​face/​capture/​usecases/​GetFaceTrackingConfigurationUseCaseTest.kt Tests tracking configuration mapping.
face/​capture/​src/​test/​java/​com/​simprints/​face/​capture/​usecases/​CropToFaceSquareUseCaseTest.kt Tests square cropping and scaling.
face/​capture/​src/​test/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​LiveFeedbackViewModelTest.kt Tests tracking flows and UI state.
face/​capture/​src/​main/​res/​layout/​fragment_live_feedback.xml Adds portrait tracking controls.
face/​capture/​src/​main/​res/​layout-land/​fragment_live_feedback.xml Adds landscape tracking controls.
face/​capture/​src/​main/​res/​drawable/​feedback_scrim_bottom.xml Adds the tracking control scrim.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​usecases/​SelectDominantFaceUseCase.kt Selects the dominant face.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​usecases/​GetFaceTrackingConfigurationUseCase.kt Resolves project tracking settings.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​usecases/​CropToFaceSquareUseCase.kt Builds and scales square crops.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​views/​TrackedProgressPainter.kt Draws progress around tracked squares.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​views/​FaceTrackingOverlay.kt Moderate (1 vote): button-anchored progress contours omit the outset and can be hidden inside the opaque button.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​LiveFeedbackViewModel.kt Integrates tracking capture. Critical (3 votes): bitmap recycling can invalidate the original used by spoof checking. Moderate (1 vote): analyzer coordinates are rendered without camera-preview mapping. Critical (1 vote): rejected detection frames are not recycled. Moderate (1 vote): enrichment can select a bystander from the cropped frame.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​LiveFeedbackState.kt Adds tracking UI state.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​LiveFeedbackFragment.kt Integrates tracking camera mode and UI rendering.
face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​models/​FaceTrackingConfiguration.kt Defines tracking configuration.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 4 High severity

Open (4)
Resolved since last review (2)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Enrichment may attribute age and gender to the wrong face

face/​capture/​src/​main/​java/​com/​simprints/​face/​capture/​screens/​livefeedback/​LiveFeedbackViewModel.kt:541

After this crop is stored, enrichWithAgeAndGender re-runs faceDetector.analyze on the cropped bitmap without the dominant-face selector used for the original template. The square is not guaranteed to contain only the selected person, so a second detected face can supply age/gender for an event whose template belongs to someone else. Enrich using the original frame with the same selection policy, or carry the selected face through enrichment.

This branch was successfully deployed

1 active (outdated) deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants