Back to list
therealityreport

face-alignment

by therealityreport

0🍴 0📅 Jan 23, 2026

SKILL.md


name: face-alignment description: Face alignment, landmark extraction, and quality gating. Use when debugging alignment issues, reviewing rejected faces, or tuning quality thresholds.

Face Alignment Skill

Use this skill to debug face alignment artifacts and embedding gating behavior.

When to Use

  • Faces being rejected but you don't know why
  • Identity fragmentation that might be alignment-related
  • Need to adjust alignment quality thresholds
  • Debugging how alignment_quality is computed and consumed
  • Planning promotion/integration (FEATURE sandbox → production)

Sub-agents

Sub-agentPurpose
FaceAlign2DSubagentFAN 68-point 2D landmark extraction
FaceAlign3DSubagent3DDFA_V2 dense 3D alignment (planned)
AlignmentQualitySubagentLUVLi-style uncertainty scoring (planned; heuristic today)

Key Skills

Run FAN alignment on a face bbox

Run alignment on detected face boxes (produces 68-point landmarks; optional aligned crop).

from FEATURES.face_alignment.src.run_fan_alignment import FANAligner, align_face_crop

aligner = FANAligner(model_type="2d", landmarks_type="2D", device="cpu")
landmarks = aligner.align_face(image, bbox)  # 68 x 2
aligned_crop = align_face_crop(image, landmarks, output_size=112)

Compute alignment_quality (heuristic today)

Get a per-face quality score (0–1). Current implementation is heuristic-based.

from FEATURES.face_alignment.src.alignment_quality import compute_alignment_quality

quality = compute_alignment_quality(bbox=bbox, landmarks_68=landmarks)

Generate episode artifacts

python -m FEATURES.face_alignment --episode-id <EP_ID>

Config Reference

Alignment Artifact Config: config/pipeline/face_alignment.yaml

KeyDefaultDescription
face_alignment.enabledtrueProduce face_alignment/aligned_faces.jsonl
face_alignment.model.type2dFAN model variant (2d / 3d)
face_alignment.processing.stride1Sample every Nth frame
face_alignment.processing.batch_size16Faces per batch
face_alignment.processing.deviceautoauto / cuda / cpu

Embedding Gating Config: config/pipeline/embedding.yaml

KeyDefaultDescription
face_alignment.enabledtrueEnable/disable gating logic
face_alignment.min_alignment_quality0.3Skip faces below this threshold

Common Issues

Faces unexpectedly skipped before embedding

Cause: Face below quality threshold

Check: alignment_quality in data/manifests/{ep_id}/face_alignment/aligned_faces.jsonl

Fix: Lower threshold in config/pipeline/embedding.yaml:

face_alignment:
  min_alignment_quality: 0.2  # default is 0.3

High landmark_jitter

Cause: Unstable landmarks across frames

Check: Per-frame landmark variance in track

Fix:

  • Ensure FAN model loaded correctly
  • Check input face crop quality
  • May need temporal smoothing

3D head pose / profile gating isn’t available

Cause: 3DDFA_V2 isn’t implemented yet (planned).

Diagnostic Output

{
  "face_id": "F_42_100",
  "alignment_quality": 0.72,
  "landmarks_detected": 68,
  "head_pose": {
    "yaw": -25.5,
    "pitch": 10.2,
    "roll": 3.1
  },
  "quality_breakdown": {
    "eyes": 0.85,
    "nose": 0.80,
    "mouth": 0.65,
    "chin": 0.55
  },
  "aligner_used": "fan_2d"
}

Key Files

FilePurpose
FEATURES/face_alignment/src/run_fan_alignment.pyFAN landmarks + crop utilities
FEATURES/face_alignment/src/face_alignment_runner.pyEpisode runner (python -m FEATURES.face_alignment)
FEATURES/face_alignment/src/alignment_quality.pyHeuristic alignment_quality
FEATURES/face_alignment/src/run_luvli_quality.pyLUVLi-style scaffolding (not true LUVLi yet)
config/pipeline/face_alignment.yamlAlignment artifact config
config/pipeline/embedding.yamlEmbedding gating config
FEATURES/face_alignment/tests/test_face_alignment.pyUnit tests (synthetic)
tests/integration/test_face_alignment_pipeline.pyPipeline integration helpers/tests

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon