Skip to content

タスクキルをしなくとも複数人数登録可能に - #27

Merged
Inlet-back merged 3 commits into
mainfrom
investigat/save-person
Oct 19, 2025
Merged

タスクキルをしなくとも複数人数登録可能に#27
Inlet-back merged 3 commits into
mainfrom
investigat/save-person

Conversation

@Inlet-back

@Inlet-back Inlet-back commented Oct 19, 2025

Copy link
Copy Markdown
Collaborator

最初の未認識だけを対象にしているため、複数いる場合の選択が不安定。
これがタスクキルしないとうまく行かなかった原因では?
https://discord.com/channels/1423306676039323730/1423308534841344122/1429157260118200521
を解消

正常に動くことは確認

タスクキルせずに以下の人数登録確認
スクリーンショット 2025-10-19 13 17 23

@Inlet-back
Inlet-back requested a review from Copilot October 19, 2025 02:00

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.

Pull Request Overview

This PR fixes face registration dialog selection to handle multiple unrecognized faces properly. The previous implementation only targeted the first unrecognized face, causing unstable selection when multiple faces were present.

  • Introduces explicit tracking ID management for dialog target selection
  • Updates dialog logic to prioritize previously selected faces, then stable unrecognized faces, then first unrecognized face
  • Passes tracking ID explicitly to the save function instead of relying on internal face detection

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
CameraViewModel.kt Adds tracking ID state management and updates face registration logic to handle multiple faces
CameraScreen.kt Updates UI to use explicit tracking ID instead of searching for first unrecognized face

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

dismissNameDialog()
} catch (e: Exception) {
println("Failed to save person name: ${e.message}")
fun savePersonName(trackingId: Int, name: String) {

Copilot AI Oct 19, 2025

Copy link

Choose a reason for hiding this comment

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

The function definition is missing proper indentation. It should be indented to match the class structure.

Copilot uses AI. Check for mistakes.
Comment thread daredakke/app/src/main/java/com/example/daredakke/ui/camera/CameraViewModel.kt Outdated
@Inlet-back
Inlet-back requested a review from Copilot October 19, 2025 02:05

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.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread daredakke/app/src/main/java/com/example/daredakke/ui/camera/CameraViewModel.kt Outdated
@Inlet-back

Copy link
Copy Markdown
Collaborator Author

Intに変えたのでIntを超えたらここでエラー

@Inlet-back
Inlet-back requested a review from Copilot October 19, 2025 02:31

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.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread daredakke/app/src/main/java/com/example/daredakke/ui/camera/CameraViewModel.kt Outdated
}
val trimmed = name.trim()
if (trimmed.isEmpty()) {
return@launch

Copilot AI Oct 19, 2025

Copy link

Choose a reason for hiding this comment

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

Early return when name is empty doesn't call dismissNameDialog(), leaving the dialog open with cleared tracking ID state. This creates an inconsistent UI state.

Suggested change
return@launch
println("Name is empty. Dialog will be dismissed.")
} else {
println("Attempting to save person with trackingId: $trackingId, name: $trimmed")
val personId = faceDetector?.saveNewPersonWithEmbedding(trackingId, trimmed)
if (personId != null) {
println("Successfully saved new person: $trimmed (ID: $personId)")
} else {
println("Failed to save new person: $trimmed. personId is null.")
}

Copilot uses AI. Check for mistakes.
@Inlet-back
Inlet-back force-pushed the investigat/save-person branch from 0101d12 to 40d4924 Compare October 19, 2025 04:15
@Inlet-back Inlet-back changed the title 顔の登録時に単独から複数に タスクキルをしなくとも複数人数登録可能に Oct 19, 2025
@Inlet-back
Inlet-back merged commit 2781c01 into main Oct 19, 2025
2 checks passed
@Inlet-back
Inlet-back deleted the investigat/save-person branch October 19, 2025 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants