💃 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
Python ai-artai-image-generationart-referencecc0comfyuicontrolnetdatasetdrawing-referencefigure-drawingline-artmannequinmidjourneymultilingualnano-bananapose-referencereference-imagesstable-diffusion
feat(tools): intake, review sheets, QC merge, tier build and verify for the five new libraries
wquguru4922a89fff14
diff --git a/.gitignore b/.gitignoreindex b7980d6a..3bf379ab 100644--- a/.gitignore+++ b/.gitignore@@ -10,3 +10,4 @@# share-card render cache (tools/og_cards.py)/build//.wrangler/+__pycache__/diff --git a/docs/qc/animal_prompt.md b/docs/qc/animal_prompt.mdnew file mode 100644index 00000000..7516491f--- /dev/null+++ b/docs/qc/animal_prompt.md@@ -0,0 +1,59 @@+# 动物逐格质检提示词++动物库(docs/animal/PLAN.md,D-14)每个动作一张审图:表头是编号、名称(体型·动作)、主图机位、“要点”和卡片的英文描述;+五格从主图开始(四足多为侧面,鸟和部分幻想生物为正面),依次是另一张平视图、斜侧、俯视、仰视。线稿不抠图。以+limbs_prompt.md 的逐肢追踪为底,扩展到四足、尾、翅、耳、角。批次文件每行一张审图,输出给 `tools/series_qc.py animal`+合并。状态:`pass`,或 `content` / `style`(画风不对:机器人、木偶、上色、加背景)/ `limbs`(肢体、尾、翅数目或连接不对)/+`view`(机位不对或镜像)/ `consistency`(和主图不是同一个姿势)/ `form`(和要点不符)。+小眼眶、鼻头轮廓、一条很淡的地面线不算失败(执行者已按此放行,人再定是否收紧)。++---++You review AI-generated pose-reference line art of animals for the Shisei animal library. Each sheet shows ONE+action of one animal: the header gives its ID, name (build · action), its main view (主图), numbered 要点 and the+card's English description of the pose. The style is an artist's anatomy construction sketch: one smooth organic+outer contour, thin light construction lines inside (spine, cross-contours) and small light circles at the joints,+black lines on white, no fur, no eyes, no colour, no ground. Panels: the first is the main view, then the other flat+view, then 斜侧 diag (45° toward the animal's left), 俯视 above (about 30° above, in front and to the left, the back+visible) and 仰视 below (about 45° below, in front and to the left, jaw, chest and belly visible, near paws large).+Side means the animal's left side with the head toward image-left; front faces its chest. A panel that says 未生成+was not generated; ignore it.++Before judging a panel, trace it like limbs_prompt.md: follow each leg from its shoulder or hip through every joint+to its paw or hoof, then each wing from the shoulder to the tip, the tail from its base, the ears and horns. Note+what you reached; anything left over is extra. Count: quadrupeds 4 legs, 4 paws or hooves, 1 tail (unless the 要点+say otherwise: a nine-tailed fox has nine, a bird 2 legs and 2 wings, a dragon as described). A limb hidden by the+body in this view is fine.++Judge every panel. A panel passes only if ALL of these hold; otherwise give the FIRST status that applies:++1. `content` — a person, hand or second animal; prey, a collar, harness, saddle or clothing; readable text; a young+ animal (kitten, puppy, foal, chick proportions); anything sexual or violent.+2. `style` — not the construction-sketch style: mechanical parts (tube or cylinder segments, bolts, pins, hinges, a+ ribbed or segmented neck or tail, a coiled-spring tail), a wooden toy look, fur rendering, shading or colour, a+ background or a solid floor. Small eye outlines, a nose outline or one very faint ground line are tolerated.+3. `limbs` — a leg, paw, wing, tail, ear or horn extra, missing without a visible reason, merged into another, or+ connected to nothing; two paws drawn on one leg; a joint bending the wrong way (a cat or dog hock bends backward,+ a horse's knee forward).+4. `view` — the panel is not its stated camera: a front that is a side or three-quarter, a diag that stays a flat+ profile or flat front, an above that does not show the back, a below that does not show the underside, or a panel+ that is the main view mirrored.+5. `consistency` — not the same pose as the main view: legs in a different phase or position, lying became sitting,+ the head turned the other way, the tail moved to a different position, or the build changed (short legs became+ long, a drop ear became a prick ear).+6. `form` — the 要点 visible in this view are not met (e.g. the paw is not behind the ear, the tail does not cover+ the nose).++Be strict on 1–3; for 4–5 compare carefully with the main view. Do not fail a panel for line weight or for slightly+different proportions. When unsure, fail it with a reason that says what you see — a person will look at it.++Write the output file as JSON:+{+ "prompt": "animal_prompt.md",+ "reviewed": ["A001", …], // one entry per sheet in the batch, in batch order (ID from the file name)+ "fails": [+ {"id": "A001", "view": "above", "status": "limbs", "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 (content a, style b, limbs c, view d, consistency e, form f)`.diff --git a/docs/qc/furniture_prompt.md b/docs/qc/furniture_prompt.mdnew file mode 100644index 00000000..72bef09e--- /dev/null+++ b/docs/qc/furniture_prompt.md@@ -0,0 +1,48 @@+# 家具逐格质检提示词++家具库(docs/furniture/PLAN.md,D-16 / D-17)每件一张审图:表头是编号、名称、“要点”和卡片的英文描述(含真实尺寸),+下面五格依次是正面、背面、侧面、斜侧、俯视,都是抠图后合成在深色底上的样子。批次文件每行一张审图,输出给+`tools/series_qc.py furniture` 合并。状态:`pass`,或 `content` / `matte` / `view` / `consistency` / `form` /+`scale`(比例和 dims 差太多)。++---++You review AI-generated product reference images for the Shisei furniture library: single pieces a posed figure can+sit, lean or lie on. Each sheet shows ONE piece: the header gives its ID, name, numbered 要点 (its construction:+legs, slats, cushions, joinery) and the card's English description with its real size. Below are five panels:+正面 front, 背面 back, 侧面 side (a true profile of its left side), 斜侧 diag (a 45° three-quarter view) and 俯视+above (looking down so the seat or top is visible). Each image is the piece 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` — a person, mannequin or animal; a floor, rug, wall or room around it; extra furniture or decorative+ objects placed on or beside it (cushions, books, vases that are not part of the piece in the 要点); readable text,+ a logo, or a faithful copy of a famous designer piece; anything sexual.+2. `matte` — the cut-out is broken: legs, rails, slats, castors or fringe missing or chopped off, background left as+ grey blocks or a halo, holes cut into solid wood or upholstery, or a floor shadow left as a dark patch. Gaps that+ really are open (between slats and rails, under a seat) are correct.+3. `view` — the panel is not the stated view: a back that is the front again or its mirror (an upholstered back+ should show its back panel); a side that is not a near-profile; a diag that is just the front or the side; an+ above view that does not show the top surface. A side or diag showing the other side is acceptable.+4. `consistency` — this panel is not the same piece as the others: the number of legs, slats, spindles, drawers or+ cushions changed, the colour or material changed, or a part appears or disappears. Judge against the majority.+5. `form` — the piece does not match the 要点 visible in this view; count what the 要点 count. Chinese pieces: check+ the joinery named (recessed legs on a 案, straight legs at the corners on a 桌, the 圈椅 continuous rail) and look+ for features of the wrong culture.+6. `scale` — the proportions are clearly far from the stated size (a bar stool drawn as a low stool, a coffee table+ as tall as a dining table, a seat height that is obviously wrong for the 45 cm-ish norm the description gives).++Be strict on 1–3 and on any count that is clearly wrong; do not fail a panel for taste or minor carving. When unsure,+fail it with a reason that says what you see — a person will look at it.++Write the output file as JSON:+{+ "prompt": "furniture_prompt.md",+ "reviewed": ["F001", …], // one entry per sheet in the batch, in batch order (ID from the file name)+ "fails": [+ {"id": "F001", "view": "side", "status": "consistency", "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 (content a, matte b, view c, consistency d, form e, scale f)`.diff --git a/docs/qc/light_prompt.md b/docs/qc/light_prompt.mdnew file mode 100644index 00000000..f09389fd--- /dev/null+++ b/docs/qc/light_prompt.md@@ -0,0 +1,47 @@+# 光线逐格质检提示词++光线库(docs/light/PLAN.md,D-15)每个预设一张审图:表头是编号、名称、“要点”(光从哪来、影子往哪去、球的高光在哪)+和卡片的英文描述,下面三格依次是正面、斜侧、侧面。不抠图。主体是灰色人台(TD / SN / AR / FX)或石膏胸像(PO),+旁边有一个灰球。批次文件每行一张审图,输出给 `tools/series_qc.py light` 合并。状态:`pass`,或 `content` /+`subject`(主体变了)/ `light`(光和描述不符)/ `turn`(转机位时光跟着相机走了,或是正面的镜像)。++---++You review AI-generated lighting reference photos for the Shisei light library. Each preset shows ONE lighting+set-up on a neutral subject: either a faceless smooth matte-grey fashion mannequin standing full length, or a grey+plaster head-and-shoulders cast; a matte grey reference sphere on a stand sits beside it. The header gives the ID,+name, numbered 要点 (where the light comes from, where shadows fall, where the sphere's highlight sits) and the+card's English description. Below are three panels of the same moment: 正面 front, 斜侧 diag (camera moved 45°+around toward the subject's left) and 侧面 side (camera moved 90° to the subject's left, subject in profile facing+image-left). 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` — the subject reads as a real person: a face with eyes, brows, lips, hair, skin texture, make-up or+ clothing; nipples, genital detail or any sexualised body; a figure that reads as a child; readable text or a logo;+ other people. Small spherical joints on the mannequin and a simplified smooth torso are expected.+2. `subject` — the subject changed between panels or against the description: a different pose, body proportions or+ head shape, the bust became a full figure (or the reverse), the sphere is missing or moved to another place, or+ the subject became a wooden or blocky jointed dummy.+3. `light` — the light does not match the 要点 and description in this view: read the sphere's highlight and shadow+ side, the softness of the shadow edge, the direction of cast shadows and the colour of the light. On the front+ panel, check each 要点 directly. On the diag and side panels, check that the light comes from where that same+ light would now appear after the camera moved (see 4), and that colour temperature and hardness are unchanged.+4. `turn` — the light "followed the camera": the lit side, sphere highlight and shadows sit in the same place in the+ frame on all three panels even though the camera moved 45° and 90°; or a panel is a mirror of the front; or the+ diag or side panel is not actually a new camera angle (subject still facing the camera full-on).++Be strict on 1 and on light that clearly contradicts the 要点; do not fail a panel for small exposure differences,+background tone or the exact shape of a soft shadow. When unsure, fail it with a reason that says what you see — a+person will look at it.++Write the output file as JSON:+{+ "prompt": "light_prompt.md",+ "reviewed": ["L001", …], // one entry per sheet in the batch, in batch order (ID from the file name)+ "fails": [+ {"id": "L001", "view": "diag", "status": "turn", "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 (content a, subject b, light c, turn d)`.diff --git a/docs/qc/prop_prompt.md b/docs/qc/prop_prompt.mdnew file mode 100644index 00000000..af5e95e5--- /dev/null+++ b/docs/qc/prop_prompt.md@@ -0,0 +1,47 @@+# 道具逐格质检提示词++道具库(docs/prop/PLAN.md,D-13 / D-17)每件一张审图:表头是编号、名称、“要点”和卡片的英文描述,下面四格依次是+正面、背面、侧面、斜侧,都是抠图后合成在深色底上的样子,所以抠图问题也在这里审。批次文件每行一张审图,输出给+`tools/series_qc.py prop` 合并。状态沿用服装库(costume_prompt.md):`pass`,或 `content` / `matte` / `view` /+`consistency` / `form`(要点,尤其是数量)。++---++You review AI-generated product reference images for the Shisei prop library: single objects a posed figure can+hold or use. Each sheet shows ONE object: the header gives its ID, name, numbered 要点 (the construction points that+define it, often counts: strings, pegs, ribs, frets) and the card's English description. Below are four panels:+正面 front, 背面 back, 侧面 side (a true profile of its left side), 斜侧 diag (a 45° three-quarter view). Each image+is the object 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` — a hand, person, face, mannequin, stand, hook or string holding the object; a second object or extra+ props; readable text, a logo, a brand name or a design that copies a real brand's trademark (the shape of a real+ product type is fine); a weapon; anything sexual. Printed numerals that are part of the object (a watch dial) are+ fine.+2. `matte` — the cut-out is broken: parts of the object missing or chopped off (thin strings, bow hair, straps,+ tassels, spokes), background left as grey blocks or a halo around the object, holes cut into solid parts, or a+ floor or shadow block left under it. Gaps that really are empty (between strings, inside a handle or wheel) are+ correct. Glass or clear parts that look greyish because the old background shows through are acceptable.+3. `view` — the panel is not the stated view: a back that shows the front or is a mirror of the front (front-only+ details such as sound holes, dials or decorations continuing onto the back); a side that is not a near-profile;+ a diag that is just the front or the side. A side or diag showing the object's other side is acceptable.+4. `consistency` — this panel is not the same object as the others: different colour, material, size ratio, number+ of parts, or a feature that appears or disappears. Judge against the majority of panels; lighting differences+ are fine.+5. `form` — the object does not match the 要点 visible in this view. Count what the 要点 count (strings, pegs, ribs,+ keys, frets) where the view lets you; points that cannot be seen from this angle are not judged.++Be strict on 1–3 and on any count that is clearly wrong; do not fail a panel for taste or small decorative extras.+When unsure, fail it with a reason that says what you see — a person will look at it.++Write the output file as JSON:+{+ "prompt": "prop_prompt.md",+ "reviewed": ["T001", …], // one entry per sheet in the batch, in batch order (ID from the file name)+ "fails": [+ {"id": "T001", "view": "back", "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 (content a, matte b, view c, consistency d, form e)`.diff --git a/docs/qc/scene_prompt.md b/docs/qc/scene_prompt.mdnew file mode 100644index 00000000..d427d4d5--- /dev/null+++ b/docs/qc/scene_prompt.md@@ -0,0 +1,49 @@+# 场景逐格质检提示词++场景库(docs/scene/PLAN.md,D-12 / D-17)每件一张审图:表头是编号、名称、“要点”和卡片的英文描述,下面三格依次是+平视 eye、俯视 above、仰视 below。场景不抠图,看的是交付原图。批次文件每行一张审图,输出给 `tools/series_qc.py scene`+合并。状态:`pass`,或 `content`(人、动物、文字、标识等)/ `spot`(中央站位被占)/ `view`(机位不对)/+`consistency`(三张不是同一地点同一时刻)/ `form`(和要点不符)。++---++You review AI-generated location reference photos for the Shisei scene library: empty places a pose or a person can+later be composited into. Each sheet shows ONE location: the header gives its ID, name, numbered 要点 (what must be in+the scene) and the card's English description. Below are three panels of the same place from the same spot facing+the same direction: 平视 eye (camera 1.6 m, level, horizon or the far wall's eye line at the vertical centre), 俯视+above (camera about 3.5 m, tilted about 30° down, more ground visible, the empty spot near the centre) and 仰视 below+(camera about 0.4 m, tilted up, ground only along the bottom edge, the rest walls and ceiling or trees and sky). 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, silhouette, reflection of a person, animal or bird, readable text or numbers, a logo or+ brand, a licence plate, a recognisable real landmark, or a religious figure or symbol used as decoration. Unreadable+ texture that only suggests signage at a distance is fine. Anything sexual or that sets a scene for minors fails too.+2. `spot` — the clear patch of ground in the centre of the frame (where one standing adult would go, about 4 m from+ the camera) is occupied: furniture, a vehicle, a plant, a puddle of light effects or any object stands there.+ Below views only show its edge; judge them on whether something now stands in front of the camera.+3. `view` — the panel is not its stated camera: an eye view with the horizon clearly far from the middle (outside+ roughly the middle third) or strongly tilted verticals; an above view that does not look down or shows no more+ ground than the eye view; a below view that does not look up, or where the ground fills more than about a third of+ the frame. Be lenient on exact angles; fail only when the view clearly does not read as that camera.+4. `consistency` — the panel is not the same place at the same moment as the eye view: windows, doors or the main+ furniture moved to another wall, the layout or architecture changed, a key element of the 要点 vanished, or the+ time of day, weather or season changed (day became night, rain appeared). Things that are simply out of frame+ from a new angle are fine.+5. `form` — the scene does not match the 要点 that are visible from this angle (historical and regional scenes:+ check the architecture and materials named, and look for features of the wrong culture or era).++Be strict on 1–2 and on any 要点 that is clearly wrong; do not fail a panel for taste, colour grading or small+props added at the edges. When unsure, fail it with a reason that says what you see — a person will look at it.++Write the output file as JSON:+{+ "prompt": "scene_prompt.md",+ "reviewed": ["E001", …], // one entry per sheet in the batch, in batch order (ID from the file name)+ "fails": [+ {"id": "E001", "view": "below", "status": "view", "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 (content a, spot b, view c, consistency d, form e)`.diff --git a/tools/series_build.py b/tools/series_build.pynew file mode 100644index 00000000..85271598--- /dev/null+++ b/tools/series_build.py@@ -0,0 +1,72 @@+#!/usr/bin/env python3+"""Build a library's image tiers from its source set and record them in data/<lib>.json (port of costume_build.py).++Only views with `pass` in data/<lib>-qc.json are built; everything else under images/<lib>/ is removed, and the+item's view becomes null with the QC status in `gaps` (same rule as poses, AGENTS §2). Looks and quality come from+series_kit.LOOKS / CWEBP:+ prop, furniture images/<lib>/grey/{w300,w600,w900}/ on #D9D9D9, and images/<lib>/alpha/w900/ transparent+ scene, light, animal images/<lib>/plain/{w300,w600,w900}/ the delivered image as is+File names <lib>_<ID>_<view>.webp. Full-size originals stay out of git (release packs only).+Usage: python3 -I tools/series_build.py prop ~/Downloads/run01-src/prop [more source sets…]+"""+import json, pathlib, subprocess, sys++ROOT = pathlib.Path(__file__).resolve().parent.parent+sys.path.insert(0, str(ROOT / "tools"))+import series_kit as K++SRC_DIR = {"grey": "grey", "alpha": "alpha", "plain": "raw"}+++def cwebp(src: pathlib.Path, dst: pathlib.Path, w: int, h: int, look: str, tier: str) -> None:+ if dst.exists() and dst.stat().st_mtime >= src.stat().st_mtime:+ return+ dst.parent.mkdir(parents=True, exist_ok=True)+ args = K.CWEBP[look][tier] if isinstance(K.CWEBP[look], dict) else K.CWEBP[look]+ subprocess.run(["cwebp", "-quiet", *args, "-resize", str(w), str(h), str(src), "-o", str(dst)], check=True)+++def main() -> None:+ if len(sys.argv) < 3 or sys.argv[1] not in K.LIBS:+ raise SystemExit(__doc__)+ lib, srcs = sys.argv[1], [pathlib.Path(p).expanduser() for p in sys.argv[2:]]+ cfg = K.LIBS[lib]+ looks = K.LOOKS[cfg["matte"]]+ out_dir = ROOT / "images" / lib+ data = json.loads((ROOT / cfg["out"]).read_text())+ qc_file = ROOT / K.qc_paths(lib)[1]+ qc = json.loads(qc_file.read_text())["items"] if qc_file.exists() else {}+ 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"{lib}_{it['id']}_{v}.webp"+ src = {look: next((s / SRC_DIR[look] / f"{it['id']}_{v}.png" for s in srcs+ if (s / SRC_DIR[look] / f"{it['id']}_{v}.png").exists()), None) for look in looks}+ if st == "pass" and all(src.values()):+ for look, tiers in looks.items():+ for t, (w, h) in tiers.items():+ dst = out_dir / look / t / name+ cwebp(src[look], dst, w, h, look, t)+ 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_dir.glob("*/*/*.webp"):+ if f not in want:+ f.unlink()+ (ROOT / cfg["out"]).write_text(json.dumps(data, ensure_ascii=False, indent=1) + "\n")+ print(f"{lib}: {built} views built ({built * sum(map(len, looks.values()))} files)")+++if __name__ == "__main__":+ main()diff --git a/tools/series_intake.py b/tools/series_intake.pynew file mode 100644index 00000000..7664ac65--- /dev/null+++ b/tools/series_intake.py@@ -0,0 +1,131 @@+#!/usr/bin/env python3+"""Collect Muse deliveries for the scene / prop / furniture / light / animal libraries into their source sets.++Port of costume_intake.py (docs/costume/PLAN.md §9–10). The library comes from each file's ID letter, so one call+can take every part of a run.++Usage (matting 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/series_intake.py \+ ~/Downloads/run01-src ~/Downloads/run01-out/run01-3-prop-part1 … [--model ~/.u2net/isnet-general-use.onnx]++For every img/<ID>_<view>.png that Muse marked ok, under ROOT/<lib>/ (read-only input for later steps):+ raw/<ID>_<view>.png the delivered image, centre-cropped to exactly 3:4 and resized to 1344×1792+and for the matted libraries (prop, furniture; series_kit.LIBS[lib]["matte"]) also, as in the costume library:+ alpha/ RGBA cut-out with the background colour removed from soft edges+ grey/ the cut-out on the house background #D9D9D9+ dark/ the cut-out on #18181B, used only by review sheets to expose matting errors+ROOT/<lib>/intake.json records per cell the delivery, Muse's outcome and note. Deliveries also hold their best+wrong attempts in img/; those are never taken (only `ok` rows), and cells nobody delivered are logged missing.+"""+import argparse, csv, json, pathlib, sys, time+from PIL import Image++sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))+import series_kit as K++W, H = 1344, 1792+HOUSE, DARK = (217, 217, 217), (24, 24, 27)+LIB_OF = {cfg["letter"]: lib for lib, cfg in K.LIBS.items()}+++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)+++class Matter:+ """isnet-general-use (MIT), loaded on first use so the unmatted libraries need no onnxruntime."""++ def __init__(self, model: str):+ self.model, self.sess = model, None++ def __call__(self, src: pathlib.Path, stem: str, im: Image.Image) -> dict:+ import numpy as np+ if self.sess is None:+ import onnxruntime as ort+ self.sess = ort.InferenceSession(str(pathlib.Path(self.model).expanduser()),+ providers=["CoreMLExecutionProvider", "CPUExecutionProvider"])+ self.name = self.sess.get_inputs()[0].name+ rgb = np.asarray(im, np.float32)+ f = np.concatenate([rgb[:24].reshape(-1, 3), rgb[-24:].reshape(-1, 3),+ rgb[:, :24].reshape(-1, 3), rgb[:, -24:].reshape(-1, 3)])+ bg = np.median(f, axis=0)+ x = np.asarray(im.resize((1024, 1024), Image.BILINEAR), np.float32) / 255.0 - 0.5+ m = self.sess.run(None, {self.name: x.transpose(2, 0, 1)[None]})[0][0, 0]+ m = (m - m.min()) / (m.max() - m.min() + 1e-8)+ al = np.asarray(Image.fromarray((m * 255).astype(np.uint8)).resize(im.size, Image.BILINEAR), np.float32) / 255+ # 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)+ # snap the faint floor and near-solid values: invisible, but they cost WebP bytes (costume D-10 7)+ al = np.where(al < 0.05, 0.0, np.where(al > 0.95, 1.0, al))+ a3 = al[..., None]+ Image.fromarray(np.dstack([fg.astype(np.uint8), (al * 255).round().astype(np.uint8)]), "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")+ return {"bg": [round(float(v)) for v in bg]}+++def main() -> None:+ ap = argparse.ArgumentParser()+ ap.add_argument("root", help="parent of the per-library source sets, e.g. ~/Downloads/run01-src")+ ap.add_argument("deliveries", nargs="+")+ ap.add_argument("--model", default="~/.u2net/isnet-general-use.onnx")+ ap.add_argument("--reset", help="manifest.json of a repair brief: its cells are cleared first, so a view turned "+ "from an old main view never stays next to a new one")+ a = ap.parse_args()+ root = pathlib.Path(a.root).expanduser()+ matter, logs, t0, n = Matter(a.model), {}, time.time(), 0++ def lib_dir(stem: str) -> tuple:+ lib = LIB_OF[stem[0]]+ src = root / lib+ if lib not in logs:+ for d in ("raw", "alpha", "grey", "dark") if K.LIBS[lib]["matte"] else ("raw",):+ (src / d).mkdir(parents=True, exist_ok=True)+ p = src / "intake.json"+ logs[lib] = json.loads(p.read_text()) if p.exists() else {}+ return lib, src, logs[lib]++ if a.reset:+ man = json.loads(pathlib.Path(a.reset).expanduser().read_text())+ for cid, views in man["need"].items():+ for v in views:+ lib, src, log = lib_dir(f"{cid}_{v}")+ for d in ("raw", "alpha", "grey", "dark"):+ (src / d / f"{cid}_{v}.png").unlink(missing_ok=True)+ log[f"{cid}_{v}"] = {"from": man["run"], "status": "missing", "muse": "", "note": "reset for " + man["run"]}++ for dl in map(lambda p: pathlib.Path(p).expanduser(), a.deliveries):+ for r in csv.DictReader(open(dl / "attempts.csv", encoding="utf-8")):+ stem = r["file"].rsplit(".", 1)[0]+ lib, src, log = lib_dir(stem)+ png = dl / "img" / r["file"]+ 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"))+ extra = matter(src, stem, im) if K.LIBS[lib]["matte"] else {}+ 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], **extra}+ n += 1+ for lib, log in logs.items():+ (root / lib / "intake.json").write_text(json.dumps(dict(sorted(log.items())), ensure_ascii=False, indent=1) + "\n")+ ok = sum(1 for v in log.values() if v["status"] == "ok")+ print(f"{lib}: {ok} ok, {len(log) - ok} missing -> {root / lib}")+ print(f"{n} images taken in {time.time() - t0:.0f}s")+++if __name__ == "__main__":+ main()diff --git a/tools/series_kit.py b/tools/series_kit.pyindex 3e9ec56d..78e7ab89 100644--- a/tools/series_kit.py+++ b/tools/series_kit.py@@ -243,13 +243,35 @@ def light_turn(subject: str) -> str:LIBS = {"scene": {"letter": "E", "src": "data/scene-src", "out": "data/scenes.json", "views": SCENE_VIEWS,- "label": "场景库", "plan": "docs/scene/PLAN.md"},+ "label": "场景库", "plan": "docs/scene/PLAN.md", "matte": False,+ "statuses": ("content", "spot", "view", "consistency", "form")},"prop": {"letter": "T", "src": "data/prop-src", "out": "data/props.json", "views": PROP_VIEWS,- "label": "道具库", "plan": "docs/prop/PLAN.md"},+ "label": "道具库", "plan": "docs/prop/PLAN.md", "matte": True,+ "statuses": ("content", "matte", "view", "consistency", "form")},"furniture": {"letter": "F", "src": "data/furniture-src", "out": "data/furniture.json", "views": FURN_VIEWS,- "label": "家具库", "plan": "docs/furniture/PLAN.md"},+ "label": "家具库", "plan": "docs/furniture/PLAN.md", "matte": True,+ "statuses": ("content", "matte", "view", "consistency", "form", "scale")},"light": {"letter": "L", "src": "data/light-src", "out": "data/lights.json", "views": LIGHT_VIEWS,- "label": "光线库", "plan": "docs/light/PLAN.md"},+ "label": "光线库", "plan": "docs/light/PLAN.md", "matte": False,+ "statuses": ("content", "subject", "light", "turn")},"animal": {"letter": "A", "src": "data/animal-src", "out": "data/animals.json", "views": ANIMAL_VIEWS,- "label": "动物库", "plan": "docs/animal/PLAN.md"},+ "label": "动物库", "plan": "docs/animal/PLAN.md", "matte": False,+ "statuses": ("content", "style", "limbs", "view", "consistency", "form")},}++# Image tiers once a view passes QC (series_build.py, verify.py). Matted libraries (prop, furniture) follow the costume+# library: house grey #D9D9D9 at q60 in three widths plus a transparent cut-out at w900 only (D-10 7). The others keep+# their own background and use the pose tiers. Settings checked side by side on run01 samples, 2026-11-01.+LOOKS = {+ True: {"grey": {"w300": (300, 400), "w600": (600, 800), "w900": (900, 1200)}, "alpha": {"w900": (900, 1200)}},+ False: {"plain": {"w300": (300, 400), "w600": (600, 800), "w900": (900, 1200)}},+}+CWEBP = {"grey": ["-q", "60", "-m", "6", "-sharp_yuv"],+ "alpha": ["-q", "65", "-alpha_q", "80", "-m", "6", "-sharp_yuv"],+ "plain": {"w300": ["-q", "70", "-m", "6"], "w600": ["-q", "72", "-m", "6"], "w900": ["-q", "75", "-m", "6"]}}+STATUSES_ALL = ("pass", "missing")+++def qc_paths(lib: str) -> tuple:+ """(qc input dir, qc json) for a library, e.g. data/prop-qc-input, data/prop-qc.json."""+ return f"data/{lib}-qc-input", f"data/{lib}-qc.json"diff --git a/tools/series_qc.py b/tools/series_qc.pynew file mode 100644index 00000000..1b212532--- /dev/null+++ b/tools/series_qc.py@@ -0,0 +1,74 @@+#!/usr/bin/env python3+"""Merge a library's QC inputs into data/<lib>-qc.json (port of costume_qc.py; prompts in docs/qc/<lib>_prompt.md).++Inputs in data/<lib>-qc-input/, applied gen files first, then by review round (`_r<N>` in the name), reviewer before+manual within a round, so a later round overrides an earlier one:+ gen_<run>.json {"run", "missing": {"E009_above": "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, the source set has it and no later file fails it; missing comes from gen+files. Statuses per library are series_kit.LIBS[lib]["statuses"].++Usage: python3 -I tools/series_qc.py scene+ python3 -I tools/series_qc.py scene --gen ~/Downloads/run01-src/scene/intake.json scene_run01 # record missing+"""+import argparse, json, pathlib, re, sys++ROOT = pathlib.Path(__file__).resolve().parent.parent+sys.path.insert(0, str(ROOT / "tools"))+import series_kit as K+++def main() -> None:+ ap = argparse.ArgumentParser()+ ap.add_argument("lib", choices=sorted(K.LIBS))+ ap.add_argument("--gen", nargs=2, metavar=("INTAKE_JSON", "RUN"))+ a = ap.parse_args()+ cfg = K.LIBS[a.lib]+ inp, out = (ROOT / p for p in K.qc_paths(a.lib))+ views, statuses = cfg["views"], set(cfg["statuses"]) | set(K.STATUSES_ALL)+ 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": dict(sorted(miss.items()))}, ensure_ascii=False, indent=1) + "\n")+ print(f"gen_{a.gen[1]}.json: {len(miss)} missing")++ items = {i["id"] for i in json.loads((ROOT / cfg["out"]).read_text())["items"]}+ qc = {}++ def order(f):+ m = re.search(r"_r(\d+)[_.]", f.name)+ return (not f.name.startswith("gen_"), int(m.group(1)) if m else 1, f.name.startswith("manual_"), f.name)++ for f in sorted(inp.glob("*.json"), key=order):+ 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"{out.name}: {len(qc)} items, {c}")+++if __name__ == "__main__":+ main()diff --git a/tools/series_sheets.py b/tools/series_sheets.pynew file mode 100644index 00000000..be63a6d5--- /dev/null+++ b/tools/series_sheets.py@@ -0,0 +1,77 @@+#!/usr/bin/env python3+"""Review sheets for the scene / prop / furniture / light / animal libraries (port of costume_sheets.py).++One sheet per item: ID, name, 要点 and the card's English description in the header, then its views in a grid of at+most three per row, so five-view items stay large enough to count legs, tails and furniture slats after the Read+tool downscales the sheet. Matted libraries show the cut-out on the dark composite (matting errors show up there);+the others show the delivered image. Also writes batch files of N sheets for the qc-reviewer agents+(docs/qc/<lib>_prompt.md).++Usage: uv run --with pillow python -I tools/series_sheets.py prop ~/Downloads/run01-src/prop OUT [--per 25] [--only T001,…]+"""+import argparse, json, pathlib, sys, textwrap+from PIL import Image, ImageDraw, ImageFont++ROOT = pathlib.Path(__file__).resolve().parent.parent+sys.path.insert(0, str(ROOT / "tools"))+import series_kit as K++PW, PH, COLS = 450, 600, 3+FONT = "/System/Library/Fonts/Hiragino Sans GB.ttc"+VIEW_ZH = {"eye": "平视", "above": "俯视", "below": "仰视", "front": "正面", "back": "背面", "side": "侧面", "diag": "斜侧"}+++def main() -> None:+ ap = argparse.ArgumentParser()+ ap.add_argument("lib", choices=sorted(K.LIBS))+ ap.add_argument("src")+ ap.add_argument("out")+ ap.add_argument("--per", type=int, default=25)+ ap.add_argument("--only", default="", help="comma-separated IDs, e.g. the items of a repair run")+ a = ap.parse_args()+ cfg = K.LIBS[a.lib]+ 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, 20)+ sub = "dark" if cfg["matte"] else "raw"+ items = [i for i in json.loads((ROOT / cfg["out"]).read_text())["items"]+ if not a.only or i["id"] in a.only.split(",")]+ made = []+ for i in items:+ # animals are drawn and reviewed from their main view outwards; others keep the library order+ views = K.ANIMAL_ORDER[i.get("main", "front")] if a.lib == "animal" else cfg["views"]+ files = [src / sub / f"{i['id']}_{v}.png" for v in views]+ if not any(f.exists() for f in files):+ continue+ desc = textwrap.wrap("desc: " + i["desc_en"], 120)[:5]+ checks = textwrap.wrap("要点:" + " ".join(f"{'①②③④⑤⑥⑦⑧'[k]}{t}" for k, t in enumerate(i["checks"])), 60)+ head = 60 + 30 * len(checks) + 26 * len(desc) + 50+ cols = min(COLS, len(views))+ rows = (len(views) + cols - 1) // cols+ sheet = Image.new("RGB", (PW * cols, head + (PH + 40) * rows), (245, 242, 237))+ d = ImageDraw.Draw(sheet)+ main = f" 主图 {VIEW_ZH[i['main']]}" if a.lib == "animal" else ""+ d.text((16, 12), f"{i['id']} {i['name_zh']}{main}", font=big, fill=(24, 24, 27))+ y = 60+ for t in checks:+ d.text((16, y), t, font=small, fill=(63, 61, 57)); y += 30+ for t in desc:+ d.text((16, y), t, font=small, fill=(110, 106, 100)); y += 26+ for k, (v, f) in enumerate(zip(views, files)):+ x, y = (k % cols) * PW, head + (k // cols) * (PH + 40)+ d.text((x + 16, y + 6), f"{VIEW_ZH[v]} {v}", font=small, fill=(24, 24, 27))+ if f.exists():+ sheet.paste(Image.open(f).convert("RGB").resize((PW, PH), Image.LANCZOS), (x, y + 40))+ else:+ d.rectangle((x + 8, y + 48, x + PW - 8, y + 40 + PH - 8), outline=(150, 150, 150), width=3)+ d.text((x + 150, y + 40 + 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"{a.lib}: {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.pyindex 4950817a..83a3467d 100755--- a/tools/verify.py+++ b/tools/verify.py@@ -77,6 +77,7 @@ def main() -> int: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()+ errs += check_series()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())]@@ -124,5 +125,47 @@ def check_costumes() -> list:return errs+def check_series() -> list:+ """Scene / prop / furniture / light / animal libraries: data/<lib>.json ↔ data/<lib>-qc.json ↔ images/<lib>/."""+ sys.path.insert(0, str(ROOT / "tools"))+ import series_kit as K+ errs = []+ for lib, cfg in K.LIBS.items():+ path = ROOT / cfg["out"]+ if not path.exists():+ continue+ data, want = json.loads(path.read_text()), set()+ qc_path = ROOT / K.qc_paths(lib)[1]+ qc = json.loads(qc_path.read_text())["items"] if qc_path.exists() else {}+ looks = K.LOOKS[cfg["matte"]]+ ids = [i["id"] for i in data["items"]]+ if len(ids) != len(set(ids)) or set(ids) & set(data.get("retired", {}).values()):+ errs.append(f"{path.name}: 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 {path.name} but {qc_path.name} says {st}")+ for look, tiers in looks.items():+ for t in tiers:+ want.add(ROOT / "images" / lib / look / t / f)+ if not (ROOT / "images" / lib / look / t / f).exists():+ errs.append(f"{it['id']} {v}: images/{lib}/{look}/{t}/{f} missing")+ else:+ if st == "pass":+ errs.append(f"{it['id']} {v}: {qc_path.name} pass but view is null (run series_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" / lib).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"{lib}: {len(shown)}/{len(data['items'])} items shown, {n}/{len(data['items']) * len(data['views'])} views pass")+ return errs++if __name__ == "__main__":sys.exit(main())