Commit Graph

12 Commits

Author SHA1 Message Date
indigo 5594d49c76 Add char_masks preprocessing script for SCAIL-2 training (task 3.7)
scripts/process_char_masks.py turns per-sample character label-map videos/images
(integer pixel labels: 0 = environment, 1..K = characters -> binding slots) into
the pixel-space semantic-mask tensors the SCAIL training/inference path consumes:
{"mask": [K+1, F_pix, H_pix, W_pix]} (ch0 = environment switch, ch1..K = slots).

- Aligns to the target video's latent grid read from the saved latent metadata
  (F_pix=(F-1)*8+1, H*32, W*32), so char_masks/ lines up file-for-file with
  latents/ / driving_latents/ for PrecomputedDataset.
- Nearest-neighbour resize so integer labels are never blended; labels > K are
  dropped with a warning; ch0 filled uniformly with --environment-switch.
- Reuses process_videos.py helpers (naming, atomic save, VAE factors) and matches
  its typer CLI conventions.

Verified on CPU: a synthetic 2-character label map (plus an out-of-range id)
produces mask (7,17,128,128) with ch0 uniform, slots placed correctly, id>K
dropped, and feeds encode_mask_channels to the 8*(K+1)=56 channels. README +
docs/tasks.md 3.7 updated (upstream label-map generation via SAM/tracking is
dataset-specific and still out of scope).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 09:49:25 +08:00
github-actions[bot] f4b06fb977 Automated PR - 2026-06-17 2026-06-17 14:21:07 +00:00
github-actions[bot] 7df34dfa83 Automated PR - 2026-05-11 2026-05-11 13:14:05 +00:00
github-actions[bot] b604d3fab3 Automated PR - 2026-04-23 2026-04-23 12:43:54 +00:00
github-actions[bot] d887bbd1e0 Automated PR - 2026-04-13 2026-04-13 14:29:35 +00:00
github-actions[bot] f4d0c1ec0e Automated PR - 2026-03-30 2026-03-30 17:59:34 +00:00
sync-bot d230aec5cd Automated PR - 2026-03-05 2026-03-05 15:47:20 +00:00
sync-bot 822ce3c4b1 Automated PR - 2026-03-04 2026-03-04 19:34:46 +00:00
sync-bot ca1623ad2a Automated PR - 2026-01-29 2026-01-29 18:42:17 +00:00
sync-bot 310103a53e Automated PR - 2026-01-15 2026-01-15 19:19:42 +00:00
sync-bot ac560b4775 Automated PR - 2026-01-08 2026-01-08 15:29:32 +00:00
sync-bot 9ce438b353 Automated PR - 2026-01-05 2026-01-05 20:10:38 +00:00