extract-avatar-headshotlisted
Install: claude install-skill huodebing-alt/Agentic-Headshot-Video-Studio
# Extract Avatar Headshot / 抽取头像
## When to use / 何时使用
HeyGen avatar enrollment requires a centered, well-lit headshot. This skill crops one from a photo.
HeyGen 录制头像需要居中、光线良好的头像照。本 skill 从用户照片中裁出。
## Inputs / 输入
- `inputs/user_photo.jpg` or `inputs/user_clip.mp4`.
## Output / 输出
- `workspace/avatar/headshot.png` (1024×1024, face-centered, neutral bg if `--matte` set).
## Steps / 步骤
1. Detect face (mediapipe / opencv).
2. Crop to square, face center at 50%/40% (Y), pad 25%.
3. Optional background matte via `rembg`.
4. Save PNG; if `--matte`, also save `headshot_matte.png`.
## Examples / 示例
```
claude run extract-avatar-headshot --input inputs/user_photo.jpg --matte
```
## Failure recovery / 失败回退
- If no face detected, surface error and ask for a clearer photo.
- If multiple faces, pick largest and warn.