fix(camera-ai): prefer front-facing camera candidates

This commit is contained in:
KINDNICK 2026-08-07 01:57:39 +09:00
parent a8d7f3f022
commit acc5ef9356
4 changed files with 30 additions and 7 deletions

View File

@ -214,3 +214,7 @@
## 0.4.5 ## 0.4.5
- Rebuilt the frozen worker so portable prepared-template rotation conversion is included in the executable. - Rebuilt the frozen worker so portable prepared-template rotation conversion is included in the executable.
## 0.4.6
- Added a soft front-facing preference so safe candidates do not systematically place the actor's back toward the camera.
- Bumped candidate cache logic version to invalidate stale orientation candidates.

Binary file not shown.

View File

@ -122,15 +122,15 @@ SEED_VARIATION_MAX_NORMAL_CANDIDATES = 16
SEED_VARIATION_MAX_SELECTION_SCORE_DELTA = 2.0 SEED_VARIATION_MAX_SELECTION_SCORE_DELTA = 2.0
GENERATION_PERFORMANCE_SCHEMA_VERSION = "hybrid-generation-performance-v1" GENERATION_PERFORMANCE_SCHEMA_VERSION = "hybrid-generation-performance-v1"
PREPARATION_LOGIC_CONTRACT_VERSION = "hybrid-preparation-logic-v2" PREPARATION_LOGIC_CONTRACT_VERSION = "hybrid-preparation-logic-v2"
CANDIDATE_LOGIC_CONTRACT_VERSION = "hybrid-candidate-logic-v15" CANDIDATE_LOGIC_CONTRACT_VERSION = "hybrid-candidate-logic-v16-front-facing"
CANDIDATE_CACHE_STAGE_VERSIONS = { CANDIDATE_CACHE_STAGE_VERSIONS = {
"shotSegmentation": "data-driven-candidates-ranker-global-dag-v1", "shotSegmentation": "data-driven-candidates-ranker-global-dag-v1",
"shotPlanning": "hierarchical-or-legacy-reconciliation-replay-v3-static-budget", "shotPlanning": "hierarchical-or-legacy-reconciliation-replay-v3-static-budget",
"candidateRanking": ( "candidateRanking": (
"template-rank-v11-adjacent-transition-v3-no-forced-side-alternation" "template-rank-v12-front-facing-adjacent-transition-v3-no-forced-side-alternation"
), ),
"trajectoryRetargeting": ( "trajectoryRetargeting": (
"retarget-v17-c2-yamo-turn-kinematics-semantic-baked-aim" "retarget-v18-front-facing-c2-yamo-turn-kinematics-semantic-baked-aim"
), ),
"compositionSafety": "person-safety-v9-derived-semantic-envelope", "compositionSafety": "person-safety-v9-derived-semantic-envelope",
"variationPool": ( "variationPool": (
@ -4685,6 +4685,23 @@ def retarget_template_to_shot(
motion_quality["motionSelectionAdjustment"] motion_quality["motionSelectionAdjustment"]
+ translation_kinematic_penalty + translation_kinematic_penalty
) )
root_forward = train.quat_rotate(
root_rotation,
np.broadcast_to(
np.asarray([0.0, 0.0, 1.0], dtype=np.float32),
root_rotation.shape[:1] + (3,),
),
)
camera_offset = camera_world_position - root_position
camera_offset /= np.maximum(
np.linalg.norm(camera_offset, axis=1, keepdims=True),
1e-5,
)
front_facing_alignment = float(
np.median(np.sum(root_forward * camera_offset, axis=1))
)
front_facing_penalty = max(0.0, -front_facing_alignment) * 3.0
quality_score += front_facing_penalty
transition_state = adjacent_transition.build_transition_state( transition_state = adjacent_transition.build_transition_state(
camera_world_position, camera_world_position,
camera_world_rotation, camera_world_rotation,
@ -4744,6 +4761,8 @@ def retarget_template_to_shot(
"realizedMotionType": realized_motion_type, "realizedMotionType": realized_motion_type,
"composition": composition_metrics, "composition": composition_metrics,
"motionQuality": motion_quality, "motionQuality": motion_quality,
"frontFacingAlignment": front_facing_alignment,
"frontFacingPenalty": front_facing_penalty,
"qualityScore": float(quality_score), "qualityScore": float(quality_score),
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "com.mingle.cw-ai", "name": "com.mingle.cw-ai",
"version": "0.4.5", "version": "0.4.6",
"displayName": "Mingle Camera Work AI", "displayName": "Mingle Camera Work AI",
"description": "Self-contained high-quality Unity Timeline camera generation with an embedded prepared reference library, per-shot editable clips, and A/B review tools.", "description": "Self-contained high-quality Unity Timeline camera generation with an embedded prepared reference library, per-shot editable clips, and A/B review tools.",
"unity": "6000.0", "unity": "6000.0",