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): pack_release rewrites README download links, verify checks them

wquguru5ea7b0515d81
diff --git a/tools/pack_release.py b/tools/pack_release.py
index 37914f7d..52e1c218 100644
--- a/tools/pack_release.py
+++ b/tools/pack_release.py
@@ -10,11 +10,14 @@ Writes to dist/:
Only files the catalog lists go in, so a view that failed QC never ships, even though the source sets still hold it.
Every zip carries LICENSE-images (CC0, the images), LICENSE (Apache-2.0) and NOTICE, which credits the pose list. The
images are already lossy WebP, so deflate barely shrinks them; it is used anyway because it costs nothing for the text.
+The four READMEs' download links, counts and sizes are rewritten to match (verify.py checks the links).
"""
-import hashlib, json, pathlib, sys, zipfile
+import hashlib, json, pathlib, re, sys, zipfile
ROOT = pathlib.Path(__file__).resolve().parent.parent
SERIES = ("std", "upper", "sexy", "duo")
+READMES = ("README.md", "docs/readme/README.zh-CN.md", "docs/readme/README.ja.md", "docs/readme/README.ko.md")
+LINK = re.compile(r"releases/download/v[\d.]+/shisei-(\w+)-v[\d.]+\.zip")
def entries(poses, original, srcs):
@@ -41,6 +44,31 @@ def pack(path, files):
return path.stat().st_size
+def update_readmes(ver, packs):
+ """Point the README download links at the new zips and refresh their counts and sizes.
+
+ A table row ends `| sets | images | size |`; any other line with a link (the one under the badges) carries just
+ the size. The Downloads section opens with the version, so a line starting `v<x.y.z>` is bumped too."""
+ for md in READMES:
+ path = ROOT / md
+ out = []
+ for line in path.read_text().split("\n"):
+ m = LINK.search(line)
+ if m and m.group(1) in packs:
+ p = packs[m.group(1)]
+ line = LINK.sub(lambda m: f"releases/download/v{ver}/{packs[m.group(1)]['file']}", line)
+ size = f"{p['bytes'] / 1e6:.1f} MB"
+ if line.startswith("|"):
+ cells = line.split("|")
+ cells[-4:-1] = [f" {p['sets']} ", f" {p['images']} ", f" {size} "]
+ line = "|".join(cells)
+ else:
+ line = re.sub(r"\d+(\.\d+)? MB", size, line, count=1)
+ line = re.sub(r"^v\d+\.\d+\.\d+(?=\W)", f"v{ver}", line)
+ out.append(line)
+ path.write_text("\n".join(out))
+
+
def main() -> None:
if len(sys.argv) < 2 or sys.argv[1].count(".") != 2:
sys.exit(__doc__)
@@ -65,6 +93,7 @@ def main() -> None:
packs[key] = {"file": name, "bytes": size, "sets": len(poses), "images": len(files)}
print(f"{name}: {len(poses)} sets, {len(files)} images, {size / 1e6:.1f} MB")
(ROOT / "data/packs.json").write_text(json.dumps({"version": ver, "packs": packs}, indent=1) + "\n")
+ update_readmes(ver, packs)
if __name__ == "__main__":
diff --git a/tools/verify.py b/tools/verify.py
index 199705e5..113653b3 100755
--- a/tools/verify.py
+++ b/tools/verify.py
@@ -5,13 +5,15 @@
- every null view has a non-pass qc status and a matching `gaps` entry (missing, line or structure);
- every rating override in data/rating_overrides.json is applied;
- every redrawn pose (catalog `source`) was merged as such: qc.json `sources` names the same source;
-- every photo has a `pass` in qc.json photos and exists in both tiers; nothing under images/ is unreferenced.
+- every photo has a `pass` in qc.json photos and exists in both tiers; nothing under images/ is unreferenced;
+- every README download link names a zip of the data/packs.json version.
"""
-import json, pathlib, sys
+import json, pathlib, re, sys
ROOT = pathlib.Path(__file__).resolve().parent.parent
VIEWS = ("front", "diag", "side", "above", "below")
TIERS = ("w300", "w600", "w900")
+README_FILES = ("README.md", "docs/readme/README.zh-CN.md", "docs/readme/README.ja.md", "docs/readme/README.ko.md")
def main() -> int:
@@ -58,6 +60,15 @@ def main() -> int:
for f in (ROOT / "images").glob("*/*/*.webp"):
if (f.parent.parent.name, f.parent.name, f.name) not in want:
errs.append(f"orphan {f.relative_to(ROOT)}")
+ # README download links are versioned file names; pack_release.py rewrites them, this catches a hand edit.
+ packs_path = ROOT / "data/packs.json"
+ if packs_path.exists():
+ packs = json.loads(packs_path.read_text())
+ files = {k["file"] for k in packs["packs"].values()}
+ for md in README_FILES:
+ 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']}")
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())]