Skip to content

💃 Free CC0 mannequin pose reference library for AI image tools (Nano Banana, ChatGPT, ComfyUI, Midjourney) — 250+ poses × 5 angles in line art, names in ja/zh/en/ko

feat(tools): costume intake, review sheets, QC merge, tier build and verify

wquguru515295ada51a
diff --git a/data/costume-qc-input/fail_hc_r1_aa.json b/data/costume-qc-input/fail_hc_r1_aa.json
new file mode 100644
index 00000000..178be43f
--- /dev/null
+++ b/data/costume-qc-input/fail_hc_r1_aa.json
@@ -0,0 +1,65 @@
+{
+ "prompt": "costume_prompt.md",
+ "reviewed": [
+ "C001",
+ "C002",
+ "C003",
+ "C004",
+ "C005",
+ "C006",
+ "C008",
+ "C009",
+ "C010",
+ "C011",
+ "C013",
+ "C016",
+ "C017",
+ "C018",
+ "C019",
+ "C020",
+ "C021",
+ "C022",
+ "C023",
+ "C024",
+ "C025",
+ "C026",
+ "C027",
+ "C028",
+ "C029",
+ "C030",
+ "C031",
+ "C032"
+ ],
+ "fails": [
+ {
+ "id": "C023",
+ "view": "front",
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out"
+ },
+ {
+ "id": "C023",
+ "view": "back",
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out"
+ },
+ {
+ "id": "C023",
+ "view": "side",
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out"
+ },
+ {
+ "id": "C023",
+ "view": "diag",
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out"
+ },
+ {
+ "id": "C025",
+ "view": "front",
+ "status": "consistency",
+ "reason": "belt tail hanging at front is black while the belt and tails in back/side/diag are white"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/data/costume-qc-input/fail_hc_r1_ab.json b/data/costume-qc-input/fail_hc_r1_ab.json
new file mode 100644
index 00000000..43c68b1e
--- /dev/null
+++ b/data/costume-qc-input/fail_hc_r1_ab.json
@@ -0,0 +1,53 @@
+{
+ "prompt": "costume_prompt.md",
+ "reviewed": [
+ "C033",
+ "C034",
+ "C035",
+ "C036",
+ "C037",
+ "C038",
+ "C039",
+ "C040",
+ "C041",
+ "C042",
+ "C043",
+ "C044",
+ "C045",
+ "C046",
+ "C047",
+ "C048",
+ "C049",
+ "C050",
+ "C051",
+ "C052",
+ "C053",
+ "C054",
+ "C055",
+ "C056",
+ "C057",
+ "C058",
+ "C059",
+ "C060"
+ ],
+ "fails": [
+ {
+ "id": "C034",
+ "view": "side",
+ "status": "consistency",
+ "reason": "inner garment and skirt read dark/black with a dark rounded blob at the collar (looks like a mannequin neck), while front/back/diag show a white inner jacket and grey skirt"
+ },
+ {
+ "id": "C043",
+ "view": "side",
+ "status": "matte",
+ "reason": "skirt hem fades out into a blurry, feathered edge instead of a clean cut-out"
+ },
+ {
+ "id": "C059",
+ "view": "diag",
+ "status": "consistency",
+ "reason": "jacket shows a stand collar with a centre row of frog buttons, unlike the cross collar on the front panel; sheer sleeve streamers also look different. Unsure, please check"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/data/costume-qc-input/gen_hc_run01.json b/data/costume-qc-input/gen_hc_run01.json
new file mode 100644
index 00000000..96942026
--- /dev/null
+++ b/data/costume-qc-input/gen_hc_run01.json
@@ -0,0 +1,21 @@
+{
+ "run": "hc_run01",
+ "missing": {
+ "C007_back": "skipped: no accepted front",
+ "C007_diag": "skipped: no accepted front",
+ "C007_front": "Best attempt a1 kept in work/gateD (media-generation-costume-hc-c007-front-a1...png) 3/4: open white sheer daxiu + red/dark-green vertical jianse stripes + inner cross-collar to image-left OK, but skirt top/sash sat at natural waist not high below bust. a2 rewrite: 'The skirt's top band and its narr",
+ "C007_side": "skipped: no accepted front",
+ "C012_back": "skipped: no accepted front",
+ "C012_diag": "skipped: no accepted front",
+ "C012_front": "a1 2/4: skirt band at underbust not high on chest below collarbones (point1 miss) and large ivory jacket chest panel visible above skirt (point2 miss); points3-4 ok (no waist sash, celadon pibo over both sleeves). a2 rewrite: 'The top edge of the red skirt band is only one finger's width below the b",
+ "C012_side": "skipped: no accepted front",
+ "C014_back": "skipped: no accepted front",
+ "C014_diag": "skipped: no accepted front",
+ "C014_front": "a1 3/4: narrow long ivory sleeves + deep green short-sleeved banbi over + red/ivory vertical striped skirt + cross collar slanting to image-left all ok, but skirt band at natural waist not just below bust (point3 miss); a2 rewrite: 'The skirt top band sits HIGH at the ribcage, immediately below the ",
+ "C014_side": "skipped: no accepted front",
+ "C015_back": "skipped: no accepted front",
+ "C015_diag": "skipped: no accepted front",
+ "C015_front": "a1 3/4 at best on garment points 1-2 + stripes: long narrow pale yellow sleeves + red short-sleeved banbi over + mustard/dark-green vertical striped skirt present, but skirt tied at natural waist with a waist sash not just below bust (point3 miss), plus visible mannequin neck stub and standing colla",
+ "C015_side": "skipped: no accepted front"
+ }
+}
diff --git a/data/costume-qc-input/manual_hc_r1.json b/data/costume-qc-input/manual_hc_r1.json
new file mode 100644
index 00000000..2d9cf5b4
--- /dev/null
+++ b/data/costume-qc-input/manual_hc_r1.json
@@ -0,0 +1,8 @@
+{
+ "note": "Human review of the r1 reviewer output (2026-10-30): C025 front belt tail darker than the other views is shading, not a different garment; C018 diag lost most of the sheer right sleeve to the matte.",
+ "reviewed": [],
+ "fails": [
+ {"id": "C025", "view": "front", "status": "pass", "reason": "belt tail shade only"},
+ {"id": "C018", "view": "diag", "status": "matte", "reason": "sheer right sleeve cut away to background"}
+ ]
+}
diff --git a/data/costume-qc.json b/data/costume-qc.json
new file mode 100644
index 00000000..76d40841
--- /dev/null
+++ b/data/costume-qc.json
@@ -0,0 +1,1115 @@
+{
+ "views": [
+ "front",
+ "diag",
+ "side",
+ "back"
+ ],
+ "items": {
+ "C001": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C002": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C003": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C004": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C005": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C006": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C007": {
+ "front": {
+ "status": "missing",
+ "reason": "Best attempt a1 kept in work/gateD (media-generation-costume-hc-c007-front-a1...png) 3/4: open white sheer daxiu + red/dark-green vertical jianse stripes + inner cross-collar to image-left OK, but ski",
+ "by": "gen_hc_run01.json"
+ },
+ "diag": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "side": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "back": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ }
+ },
+ "C008": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C009": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C010": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C011": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C012": {
+ "front": {
+ "status": "missing",
+ "reason": "a1 2/4: skirt band at underbust not high on chest below collarbones (point1 miss) and large ivory jacket chest panel visible above skirt (point2 miss); points3-4 ok (no waist sash, celadon pibo over b",
+ "by": "gen_hc_run01.json"
+ },
+ "diag": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "side": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "back": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ }
+ },
+ "C013": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C014": {
+ "front": {
+ "status": "missing",
+ "reason": "a1 3/4: narrow long ivory sleeves + deep green short-sleeved banbi over + red/ivory vertical striped skirt + cross collar slanting to image-left all ok, but skirt band at natural waist not just below ",
+ "by": "gen_hc_run01.json"
+ },
+ "diag": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "side": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "back": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ }
+ },
+ "C015": {
+ "front": {
+ "status": "missing",
+ "reason": "a1 3/4 at best on garment points 1-2 + stripes: long narrow pale yellow sleeves + red short-sleeved banbi over + mustard/dark-green vertical striped skirt present, but skirt tied at natural waist with",
+ "by": "gen_hc_run01.json"
+ },
+ "diag": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "side": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ },
+ "back": {
+ "status": "missing",
+ "reason": "skipped: no accepted front",
+ "by": "gen_hc_run01.json"
+ }
+ },
+ "C016": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C017": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C018": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "matte",
+ "reason": "sheer right sleeve cut away to background",
+ "by": "manual_hc_r1.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C019": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C020": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C021": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C022": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C023": {
+ "front": {
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "matte",
+ "reason": "pleated skirt is smeared with grey/dark blurry patches, background left in the cut-out",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C024": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C025": {
+ "front": {
+ "status": "pass",
+ "reason": "belt tail shade only",
+ "by": "manual_hc_r1.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C026": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C027": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C028": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C029": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C030": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C031": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C032": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_aa.json"
+ }
+ },
+ "C033": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C034": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "consistency",
+ "reason": "inner garment and skirt read dark/black with a dark rounded blob at the collar (looks like a mannequin neck), while front/back/diag show a white inner jacket and grey skirt",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C035": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C036": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C037": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C038": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C039": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C040": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C041": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C042": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C043": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "matte",
+ "reason": "skirt hem fades out into a blurry, feathered edge instead of a clean cut-out",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C044": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C045": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C046": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C047": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C048": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C049": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C050": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C051": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C052": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C053": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C054": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C055": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C056": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C057": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C058": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C059": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "consistency",
+ "reason": "jacket shows a stand collar with a centre row of frog buttons, unlike the cross collar on the front panel; sheer sleeve streamers also look different. Unsure, please check",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ },
+ "C060": {
+ "front": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "diag": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "side": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ },
+ "back": {
+ "status": "pass",
+ "by": "fail_hc_r1_ab.json"
+ }
+ }
+ }
+}
diff --git a/docs/costume/PLAN.md b/docs/costume/PLAN.md
index da605fe8..3b11aa74 100644
--- a/docs/costume/PLAN.md
+++ b/docs/costume/PLAN.md
@@ -302,7 +302,23 @@ C01 齐胸襦裙 3/3 画成齐腰;C03 宋裤成灯笼裤、C04 琵琶袖成西
一条命令:统一尺寸 → 抠图 → 合成统一底色 → 三视图审图板 → Sonnet 按要点审 → 人复核 → 通过的入库,失败的带原因进下一批。
Muse 生成下一批时验证上一批。某批正面通过率 < 70% 或三视图一致 < 60% 就停下改模板。
-## 11. 待定(D-10)
+## 11. 第一套 HC 结果(costume-HC-run01,2026-10-30)
+
+Muse 一次交付 4 个包:60 件里 56 件四视角全出,224 张 0 拒绝;4 件正面 3 次都没过(C007 魏晋大袖衫间色裙、
+C012 齐胸石榴红、C014 / C015 初唐高腰襦裙),仍是“裙头 / 腰线相对胸的位置”这一类。
+收图:`costume_intake.py` 抠 224 张用 167 秒;`costume_sheets.py` 每件一张审图(深色底合成,抠图问题一起审);
+2 个 Sonnet 按 [costume_prompt.md](../qc/costume_prompt.md) 审,人工复核后改判 1 处、补判 1 处(`manual_hc_r1.json`)。
+结果 216 / 240 通过,55 件上架:
+- matte 6:C023 百迭裙的薄纱细褶四视角都抠出灰斑;C018 斜侧薄纱袖被抠掉;C043 侧面下摆糊边。
+- consistency 2:C034 侧面内裙变黑并露出人台颈部;C059 斜侧变成立领对襟。
+- missing 16:上面 4 件 × 4 视角。
+
+体积:60 件两种底 × 三档约 32 MB(透明版约为浅灰版两倍),400 件约 210 MB,要不要给透明版只留 w600 / w900 再定。
+
+下一步:抠图类先换 BiRefNet 重抠再审,不用重画;缺视角的件以已通过的正面为参考只补那一格;
+4 件缺正面的改写结构句后整件重做。
+
+## 12. D-10(已决定,见 DECISIONS)
1. **画面格式**:隐形人台三视图(推荐)还是平铺图。
2. **数据放哪**:`tools/verify.py`、`build_site.py`、`web/app.js` 都把机位写死成 `front, diag, side, above, below`。推荐服装单独放 `data/costumes.json`,视图是 `front, back, side`,verify 和网站各加一段;不和 `catalog.json` 混用。
diff --git a/docs/qc/costume_prompt.md b/docs/qc/costume_prompt.md
new file mode 100644
index 00000000..93b37149
--- /dev/null
+++ b/docs/qc/costume_prompt.md
@@ -0,0 +1,51 @@
+# 服装逐格质检提示词
+
+服装库(docs/costume/PLAN.md,D-10)每件一张审图:表头是编号、名称、应有性别和“要点”(形制检查清单),下面四格依次是
+正面、背面、侧面、斜侧,都是抠图后合成在深色底上的样子,所以抠图问题也在这里审。批次文件每行一张审图,输出给
+`tools/costume_qc.py` 合并。状态:`pass`,或 `form`(形制不对)/ `consistency`(和本件其他视角不是同一件)/
+`view`(视角不对或镜像)/ `content`(出现人、皮肤、文字、标识等)/ `matte`(抠图坏了)。
+
+---
+
+You review AI-generated costume reference images for the Shisei costume library. Each sheet shows ONE costume:
+the header gives its ID, name, the expected gender of the cut, and numbered 要点 (the construction points that define
+this garment). Below are four panels: 正面 front, 背面 back, 侧面 side, 斜侧 diag (a 45° three-quarter view). Each
+image is a garment on an invisible ghost mannequin, cut out and placed on a dark background. A panel that says 未生成
+was not generated; ignore it.
+
+Judge every panel. A panel passes only if ALL of these hold; otherwise give the FIRST status that applies:
+
+1. `content` — any person, face, head, hair, skin, hands, a visible mannequin body or stand, a hanger, props, weapons,
+ readable text, a logo, a brand mark, a flag or a real institution's badge. (Embroidered rank badges and patterns
+ that are part of the garment named in the header are fine.) Anything that sexualises the garment also fails here.
+2. `matte` — the cut-out is broken: parts of the garment missing or chopped off (sleeve ends, hems, shoes, sheer
+ panels gone), background left as grey blocks or a grey halo/outline around the garment, or holes cut into solid
+ fabric. Gaps that really are empty (between trouser legs, inside an open sleeve or collar) are correct.
+ A sheer fabric that looks lighter or greyish because the old background shows through it is acceptable.
+3. `view` — the panel is not the stated view: a "back" that shows the front or is a mirror of the front (the front's
+ overlap or fastenings simply flipped), a "side" that is not a near-profile, a "diag" that is just front or side.
+ A side or diag showing the garment's other side (turned the opposite way) is acceptable.
+4. `consistency` — this panel is not the same garment as the others on the sheet: different colour, pattern, length,
+ sleeve shape, layers, or a trim that appears or disappears. Judge against the majority of the panels; small
+ lighting or fold differences are fine.
+5. `form` — the garment does not match the header's 要点: check each numbered point that is visible in this view.
+ Points that cannot be seen from this angle (e.g. a front closure on the back view) are not judged here. For
+ cross collars, 交领右衽 means: seen from the front, the overlapping edge runs from the neck diagonally down toward
+ IMAGE-LEFT (the collar looks like a y whose stem slants to the lower left); the opposite direction is `form`.
+ Look for features of the wrong culture too: a wide obi belt or obi bow (Japanese), a very short jacket with a
+ long ribbon tie (Korean), zippers or lace on Chinese historical garments.
+
+Be strict on 1–3 and on any 要点 that is clearly wrong; do not fail a panel for taste, minor added piping or
+embroidery, or slightly different proportions. When unsure whether a 要点 is met, fail it with a reason that says
+what you see — a person will look at it.
+
+Write the output file as JSON:
+{
+ "prompt": "costume_prompt.md",
+ "reviewed": ["C001", "C002", …], // one entry per sheet in the batch, in batch order (ID from the file name)
+ "fails": [
+ {"id": "C001", "view": "side", "status": "form", "reason": "short English reason naming the 要点 or problem"}
+ ]
+}
+Only failing panels go in `fails`; every panel not listed counts as pass. Reply with one line:
+`<batch file>: <sheets> sheets, <fails> failing panels (form x, consistency y, view z, content w, matte v)`.
diff --git a/tools/costume_build.py b/tools/costume_build.py
new file mode 100644
index 00000000..d8ca9328
--- /dev/null
+++ b/tools/costume_build.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+"""Build the costume image tiers from the costume source set and record them in data/costumes.json.
+
+Only views with `pass` in data/costume-qc.json are built; everything else under images/costume/ is removed, and the
+item's view becomes null with the QC status in `gaps` (same rule as poses, AGENTS §2). Two looks per view (D-10):
+ images/costume/grey/{w300,w600,w900}/costume_<ID>_<view>.webp on the house background #D9D9D9
+ images/costume/alpha/{w300,w600,w900}/costume_<ID>_<view>.webp transparent cut-out
+Usage: python3 -I tools/costume_build.py ~/Downloads/costume-hc [more source sets…]
+"""
+import json, pathlib, subprocess, sys
+
+ROOT = pathlib.Path(__file__).resolve().parent.parent
+TIERS = {"w300": (300, 400, 70), "w600": (600, 800, 72), "w900": (900, 1200, 75)} # same sizes and q as poses
+LOOKS = ("grey", "alpha")
+OUT = ROOT / "images/costume"
+
+
+def cwebp(src: pathlib.Path, dst: pathlib.Path, w: int, h: int, q: int, alpha: bool) -> None:
+ if dst.exists() and dst.stat().st_mtime >= src.stat().st_mtime:
+ return
+ dst.parent.mkdir(parents=True, exist_ok=True)
+ extra = ["-alpha_q", "100", "-exact"] if alpha else []
+ subprocess.run(["cwebp", "-quiet", "-q", str(q), "-resize", str(w), str(h), *extra, str(src), "-o", str(dst)],
+ check=True)
+
+
+def main() -> None:
+ srcs = [pathlib.Path(p).expanduser() for p in sys.argv[1:]]
+ if not srcs:
+ raise SystemExit(__doc__)
+ data = json.loads((ROOT / "data/costumes.json").read_text())
+ qc = json.loads((ROOT / "data/costume-qc.json").read_text())["items"]
+ want, built = set(), 0
+ for it in data["items"]:
+ q = qc.get(it["id"], {})
+ for v in data["views"]:
+ st = q.get(v, {}).get("status")
+ name = f"costume_{it['id']}_{v}.webp"
+ src = {look: next((s / look / f"{it['id']}_{v}.png" for s in srcs
+ if (s / look / f"{it['id']}_{v}.png").exists()), None) for look in LOOKS}
+ if st == "pass" and all(src.values()):
+ for look in LOOKS:
+ for t, (w, h, qual) in TIERS.items():
+ dst = OUT / look / t / name
+ cwebp(src[look], dst, w, h, qual, look == "alpha")
+ want.add(dst)
+ it["views"][v] = name
+ it["gaps"].pop(v, None)
+ built += 1
+ else:
+ if st == "pass":
+ raise SystemExit(f"{it['id']} {v}: qc pass but no source image in {srcs}")
+ it["views"][v] = None
+ if st:
+ it["gaps"][v] = st
+ else:
+ it["gaps"].pop(v, None) # not generated or reviewed yet: no gap to report
+ for f in OUT.glob("*/*/*.webp"):
+ if f not in want:
+ f.unlink()
+ (ROOT / "data/costumes.json").write_text(json.dumps(data, ensure_ascii=False, indent=1) + "\n")
+ print(f"{built} views built ({built * 6} files)")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/costume_intake.py b/tools/costume_intake.py
new file mode 100644
index 00000000..2e0684c9
--- /dev/null
+++ b/tools/costume_intake.py
@@ -0,0 +1,99 @@
+#!/usr/bin/env python3
+"""Collect a Muse costume delivery into the costume source set and matte it (docs/costume/PLAN.md §9–10).
+
+Usage (needs numpy, pillow and onnxruntime, so it does not run on the bare system python):
+ uv run --with numpy --with pillow --with onnxruntime python -I tools/costume_intake.py \
+ ~/Downloads/costume-hc ~/Downloads/costume-HC-run01-part1 … [--model ~/.u2net/isnet-general-use.onnx]
+
+For every img/<ID>_<view>.png in the deliveries it writes, under SRC (read-only input for build steps):
+ raw/<ID>_<view>.png the delivered image, centre-cropped to exactly 3:4 and resized to 1344×1792
+ alpha/<ID>_<view>.png RGBA cut-out; edge pixels have the background colour removed so no grey halo
+ grey/<ID>_<view>.png the cut-out on the house background #D9D9D9 (D-10), so every image matches
+ dark/<ID>_<view>.png the cut-out on #18181B, used only by review sheets to expose matting errors
+and SRC/intake.json: per file the delivery it came from, Muse's outcome/note and the measured background.
+Files Muse marked wrong or refused are recorded as missing and not processed.
+"""
+import argparse, csv, json, pathlib, time
+import numpy as np, onnxruntime as ort
+from PIL import Image
+
+W, H = 1344, 1792
+HOUSE, DARK = (217, 217, 217), (24, 24, 27)
+VIEWS = ("front", "back", "side", "diag")
+
+
+def to_34(im: Image.Image) -> Image.Image:
+ w, h = im.size
+ if w * 4 > h * 3: # too wide: trim the sides
+ nw = h * 3 // 4
+ im = im.crop(((w - nw) // 2, 0, (w - nw) // 2 + nw, h))
+ elif w * 4 < h * 3:
+ nh = w * 4 // 3
+ im = im.crop((0, (h - nh) // 2, w, (h - nh) // 2 + nh))
+ return im.resize((W, H), Image.LANCZOS)
+
+
+def border_bg(a: np.ndarray) -> tuple:
+ """Median colour of a 24 px frame, and the spread between the four corners (a gradient shows up here)."""
+ f = np.concatenate([a[:24].reshape(-1, 3), a[-24:].reshape(-1, 3), a[:, :24].reshape(-1, 3), a[:, -24:].reshape(-1, 3)])
+ corners = [a[:40, :40], a[:40, -40:], a[-40:, :40], a[-40:, -40:]]
+ lum = [float(c.mean()) for c in corners]
+ return np.median(f, axis=0), max(lum) - min(lum)
+
+
+def matte(sess, name, im: Image.Image) -> np.ndarray:
+ x = np.asarray(im.resize((1024, 1024), Image.BILINEAR), np.float32) / 255.0 - 0.5
+ m = sess.run(None, {name: x.transpose(2, 0, 1)[None]})[0][0, 0]
+ m = (m - m.min()) / (m.max() - m.min() + 1e-8)
+ return np.asarray(Image.fromarray((m * 255).astype(np.uint8)).resize(im.size, Image.BILINEAR), np.float32) / 255.0
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("src")
+ ap.add_argument("deliveries", nargs="+")
+ ap.add_argument("--model", default="~/.u2net/isnet-general-use.onnx")
+ a = ap.parse_args()
+ src = pathlib.Path(a.src).expanduser()
+ for d in ("raw", "alpha", "grey", "dark"):
+ (src / d).mkdir(parents=True, exist_ok=True)
+ log_path = src / "intake.json"
+ log = json.loads(log_path.read_text()) if log_path.exists() else {}
+
+ sess = ort.InferenceSession(str(pathlib.Path(a.model).expanduser()),
+ providers=["CoreMLExecutionProvider", "CPUExecutionProvider"])
+ name = sess.get_inputs()[0].name
+ t0, n = time.time(), 0
+ for dl in map(lambda p: pathlib.Path(p).expanduser(), a.deliveries):
+ rows = {r["file"]: r for r in csv.DictReader(open(dl / "attempts.csv", encoding="utf-8"))}
+ for fname, r in rows.items():
+ stem = fname[:-4]
+ png = dl / "img" / fname
+ if r["outcome"] != "ok" or not png.exists():
+ # Muse's verdict wins only when it produced nothing usable; a later delivery may still fill it.
+ if stem not in log or log[stem].get("status") == "missing":
+ log[stem] = {"from": dl.name, "status": "missing", "muse": r["outcome"], "note": r["note"][:300]}
+ continue
+ im = to_34(Image.open(png).convert("RGB"))
+ rgb = np.asarray(im, np.float32)
+ bg, spread = border_bg(rgb)
+ al = matte(sess, name, im)
+ # Remove the background colour mixed into soft edges: C = aF + (1-a)B => F = (C - (1-a)B) / a.
+ a3 = al[..., None]
+ fg = np.where(a3 > 0.02, (rgb - (1 - a3) * bg) / np.maximum(a3, 1e-3), rgb).clip(0, 255)
+ alpha8 = (al * 255).round().astype(np.uint8)
+ Image.fromarray(np.dstack([fg.astype(np.uint8), alpha8]), "RGBA").save(src / "alpha" / f"{stem}.png")
+ for sub, col in (("grey", HOUSE), ("dark", DARK)):
+ out = fg * a3 + np.array(col, np.float32) * (1 - a3)
+ Image.fromarray(out.round().astype(np.uint8)).save(src / sub / f"{stem}.png")
+ im.save(src / "raw" / f"{stem}.png")
+ log[stem] = {"from": dl.name, "status": "ok", "muse": r["outcome"], "hits": r.get("hits", ""),
+ "note": r["note"][:300], "bg": [round(float(v)) for v in bg], "bg_spread": round(spread, 1)}
+ n += 1
+ log_path.write_text(json.dumps(dict(sorted(log.items())), ensure_ascii=False, indent=1) + "\n")
+ miss = sum(1 for v in log.values() if v["status"] == "missing")
+ print(f"{n} images matted in {time.time() - t0:.0f}s; {len(log)} logged, {miss} missing -> {src}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/costume_qc.py b/tools/costume_qc.py
new file mode 100644
index 00000000..4b49b010
--- /dev/null
+++ b/tools/costume_qc.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python3
+"""Merge the costume QC inputs into data/costume-qc.json (docs/qc/costume_prompt.md).
+
+Inputs in data/costume-qc-input/, applied in file-name order so a later round overrides an earlier one:
+ gen_<run>.json {"run", "missing": {"C007_front": "Muse note", …}}: cells the generator never produced
+ fail_<...>.json reviewer output {"reviewed": [ids], "fails": [{"id", "view", "status", "reason"}]}
+ manual_<...>.json same shape, written by a person; a fail entry with status "pass" re-admits a panel
+A view is pass when its item was reviewed and no later file fails it; missing comes from gen files.
+
+Usage: python3 -I tools/costume_qc.py
+ python3 -I tools/costume_qc.py --gen ~/Downloads/costume-hc/intake.json hc_run01 # record missing cells
+"""
+import argparse, json, pathlib
+
+ROOT = pathlib.Path(__file__).resolve().parent.parent
+INP, OUT = ROOT / "data/costume-qc-input", ROOT / "data/costume-qc.json"
+VIEWS = ("front", "diag", "side", "back")
+STATUSES = {"pass", "form", "consistency", "view", "content", "matte", "missing"}
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("--gen", nargs=2, metavar=("INTAKE_JSON", "RUN"))
+ a = ap.parse_args()
+ INP.mkdir(parents=True, exist_ok=True)
+ if a.gen:
+ log = json.loads(pathlib.Path(a.gen[0]).expanduser().read_text())
+ miss = {k: v.get("note", "") for k, v in log.items() if v["status"] == "missing"}
+ (INP / f"gen_{a.gen[1]}.json").write_text(
+ json.dumps({"run": a.gen[1], "missing": miss}, ensure_ascii=False, indent=1) + "\n")
+ print(f"gen_{a.gen[1]}.json: {len(miss)} missing")
+
+ items = {i["id"]: i for i in json.loads((ROOT / "data/costumes.json").read_text())["items"]}
+ qc = {}
+ for f in sorted(INP.glob("*.json")):
+ d = json.loads(f.read_text())
+ if f.name.startswith("gen_"):
+ for cell, note in d["missing"].items():
+ cid, v = cell.split("_")
+ qc.setdefault(cid, {})[v] = {"status": "missing", "reason": note[:200], "by": f.name}
+ continue
+ for cid in d["reviewed"]:
+ assert cid in items, f"{f.name}: unknown id {cid}"
+ for v in VIEWS:
+ cur = qc.setdefault(cid, {}).get(v)
+ if not cur or cur["status"] != "missing":
+ qc[cid][v] = {"status": "pass", "by": f.name}
+ for x in d["fails"]:
+ assert x["status"] in STATUSES and x["view"] in VIEWS, f"{f.name}: bad entry {x}"
+ if qc.get(x["id"], {}).get(x["view"], {}).get("status") == "missing":
+ continue
+ qc.setdefault(x["id"], {})[x["view"]] = {"status": x["status"], "reason": x.get("reason", ""), "by": f.name}
+ qc = {cid: {v: vs[v] for v in VIEWS if v in vs} for cid, vs in qc.items()}
+ OUT.write_text(json.dumps({"views": list(VIEWS), "items": dict(sorted(qc.items()))},
+ ensure_ascii=False, indent=1) + "\n")
+ c = {}
+ for vs in qc.values():
+ for v in vs.values():
+ c[v["status"]] = c.get(v["status"], 0) + 1
+ print(f"costume-qc.json: {len(qc)} items, {c}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/costume_sheets.py b/tools/costume_sheets.py
new file mode 100644
index 00000000..0fb1f85a
--- /dev/null
+++ b/tools/costume_sheets.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python3
+"""Costume review sheets: one sheet per item, its four views side by side on the dark composite (matting errors and
+stray grey show up there), with the ID, name, expected gender and the 形制要点 in the header. Also writes batch files
+of N sheets each for the qc-reviewer agents (docs/qc/costume_prompt.md).
+
+Usage: uv run --with pillow python -I tools/costume_sheets.py ~/Downloads/costume-hc OUT [--cat HC] [--per 28]
+"""
+import argparse, json, pathlib
+from PIL import Image, ImageDraw, ImageFont
+
+ROOT = pathlib.Path(__file__).resolve().parent.parent
+VIEWS = (("front", "正面"), ("back", "背面"), ("side", "侧面"), ("diag", "斜侧"))
+PW, PH, HEAD = 450, 600, 150
+FONT = "/System/Library/Fonts/Hiragino Sans GB.ttc"
+GENDER = {"F": "女装", "M": "男装", "U": "中性"}
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser()
+ ap.add_argument("src")
+ ap.add_argument("out")
+ ap.add_argument("--cat", default="")
+ ap.add_argument("--per", type=int, default=28)
+ a = ap.parse_args()
+ src, out = pathlib.Path(a.src).expanduser(), pathlib.Path(a.out).expanduser()
+ (out / "sheets").mkdir(parents=True, exist_ok=True)
+ big, small = ImageFont.truetype(FONT, 30), ImageFont.truetype(FONT, 22)
+ items = [i for i in json.loads((ROOT / "data/costumes.json").read_text())["items"] if not a.cat or i["cat"] == a.cat]
+ made = []
+ for i in items:
+ files = [src / "dark" / f"{i['id']}_{v}.png" for v, _ in VIEWS]
+ if not any(f.exists() for f in files):
+ continue
+ sheet = Image.new("RGB", (PW * 4, PH + HEAD), (245, 242, 237))
+ d = ImageDraw.Draw(sheet)
+ era = f"{i['era_zh']} · " if i.get("era_zh") else ""
+ d.text((16, 12), f"{i['id']} {era}{i['name_zh']} [{GENDER[i['gender']]}]", font=big, fill=(24, 24, 27))
+ d.text((16, 56), "要点:" + " ".join(f"{'①②③④⑤⑥'[k]}{t}" for k, t in enumerate(i["checks"])),
+ font=small, fill=(63, 61, 57))
+ for k, ((v, zh), f) in enumerate(zip(VIEWS, files)):
+ x = k * PW
+ d.text((x + 16, HEAD - 40), f"{zh} {v}", font=small, fill=(24, 24, 27))
+ if f.exists():
+ sheet.paste(Image.open(f).resize((PW, PH), Image.LANCZOS), (x, HEAD))
+ else:
+ d.rectangle((x + 8, HEAD + 8, x + PW - 8, HEAD + PH - 8), outline=(150, 150, 150), width=3)
+ d.text((x + 150, HEAD + PH // 2), "未生成", font=big, fill=(120, 120, 120))
+ p = out / "sheets" / f"{i['id']}.jpg"
+ sheet.save(p, quality=88)
+ made.append(str(p))
+ for n in range(0, len(made), a.per):
+ (out / f"batch_{n // a.per + 1:02d}.txt").write_text("\n".join(made[n:n + a.per]) + "\n")
+ print(f"{len(made)} sheets, {(len(made) + a.per - 1) // a.per} batches -> {out}")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/verify.py b/tools/verify.py
index fb040bea..846741d0 100755
--- a/tools/verify.py
+++ b/tools/verify.py
@@ -76,6 +76,7 @@ def main() -> int:
for m in re.finditer(r"releases/download/v([\d.]+)/(shisei-[\w]+-v[\d.]+\.zip)", (ROOT / md).read_text()):
if m.group(1) != packs["version"] or m.group(2) not in files:
errs.append(f"{md}: download link {m.group(2)} is not in data/packs.json v{packs['version']}")
+ errs += check_costumes()
for s in sorted({p["series"] for p in cat}):
ps = [p for p in cat if p["series"] == s]
shown = [p for p in ps if any(p["views"].values())]
@@ -86,5 +87,42 @@ def main() -> int:
return 1 if errs else 0
+def check_costumes() -> list:
+ """Costume library (D-10): data/costumes.json ↔ data/costume-qc.json ↔ images/costume/{grey,alpha}/<tier>/."""
+ path = ROOT / "data/costumes.json"
+ if not path.exists():
+ return []
+ data, errs, want = json.loads(path.read_text()), [], set()
+ qc_path = ROOT / "data/costume-qc.json"
+ qc = json.loads(qc_path.read_text())["items"] if qc_path.exists() else {}
+ ids = [i["id"] for i in data["items"]]
+ if len(ids) != len(set(ids)) or set(ids) & set(data.get("retired", {}).values()):
+ errs.append("costumes.json: duplicate or reused ids")
+ for it in data["items"]:
+ for k in ("form", "desc_en", "name_zh", "name_ja", "name_en", "name_ko"):
+ if not it.get(k):
+ errs.append(f"{it['id']}: empty {k}")
+ for v in data["views"]:
+ f, st = it["views"].get(v), qc.get(it["id"], {}).get(v, {}).get("status")
+ if f:
+ if st != "pass":
+ errs.append(f"{it['id']} {v}: in costumes.json but costume-qc says {st}")
+ for look in ("grey", "alpha"):
+ for t in TIERS:
+ want.add(ROOT / "images/costume" / look / t / f)
+ if not (ROOT / "images/costume" / look / t / f).exists():
+ errs.append(f"{it['id']} {v}: images/costume/{look}/{t}/{f} missing")
+ else:
+ if st == "pass":
+ errs.append(f"{it['id']} {v}: costume-qc pass but view is null (run costume_build.py)")
+ if st and it.get("gaps", {}).get(v) != st:
+ errs.append(f"{it['id']} {v}: gaps entry should be {st}")
+ errs += [f"orphan {f.relative_to(ROOT)}" for f in (ROOT / "images/costume").glob("*/*/*.webp") if f not in want]
+ shown = [i for i in data["items"] if any(i["views"].values())]
+ n = sum(1 for i in data["items"] for v in data["views"] if i["views"].get(v))
+ print(f"costume: {len(shown)}/{len(data['items'])} items shown, {n}/{len(data['items']) * len(data['views'])} views pass")
+ return errs
+
+
if __name__ == "__main__":
sys.exit(main())