Skip to content

ReShot — copy the shot, not the actors. Video → depth map, OpenPose skeleton or canny lines for Seedance 2.0/2.5 reference video, MiniMax H3 Fun ControlNet and Wan VACE. Apache-2.0. Open-sourced by Maosika 猫斯卡 (www.maosika.com), the AI short-drama production system.

scripts: mirror the three default weights to ModelScope (sha256-verified, token from env); model card documents weights/ and the modelscope download path

wangfeng36d6d797fc56
diff --git a/docs/MODELSCOPE.md b/docs/MODELSCOPE.md
index 5fb33fa..768a686 100644
--- a/docs/MODELSCOPE.md
+++ b/docs/MODELSCOPE.md
@@ -79,13 +79,22 @@ ReShot 吃进一个 `.mp4`,吐出一个 `.mp4`。输出是控制视频,三
pip install "reshot[pose]" # 需要 PATH 里有 ffmpeg;没有就装 "reshot[pose,ffmpeg]"
```
-模型权重首次运行自动下载(深度 111 MB,骨架 340 MB)。国内先设一个镜像:
+模型权重首次运行自动下载(深度 111 MB,骨架 340 MB)。国内两种办法,任选一种:
+
+**直接从这个魔搭仓库拿权重**(`weights/` 目录,和 Hugging Face 上的原文件逐字节相同,SHA-256 已核对),然后用参数指过去,完全不走 Hugging Face:
```bash
-export HF_ENDPOINT=https://hf-mirror.com
+pip install modelscope
+modelscope download --model maosika/reshot weights/video_depth_anything_vits.pth weights/yolox_l.onnx weights/dw-ll_ucoco_384.onnx --local_dir ./reshot-weights
+reshot 参考片.mp4 -o 深度图.mp4 --checkpoint ./reshot-weights/weights/video_depth_anything_vits.pth
+reshot 参考片.mp4 -o 骨架.mp4 --control pose --checkpoint-dir ./reshot-weights/weights
```
-也可以把权重放本地,`--checkpoint 深度权重.pth`、`--checkpoint-dir 骨架权重目录/` 直接指过去,不走网络。
+或者设一个 Hugging Face 镜像,让 `reshot` 自己下:
+
+```bash
+export HF_ENDPOINT=https://hf-mirror.com
+```
用 Claude Code、Codex、Cursor 之类的 AI 编程工具?把下面这段粘给它,它会替你装好、验显卡、跑一段测试片:
@@ -185,11 +194,13 @@ run(RunConfig(input=Path("参考片.mp4"), output=Path("深度图.mp4"), target=
## 模型与协议
-| 用途 | 模型 | 协议 |
-|---|---|---|
-| 深度图 | Video Depth Anything **Small**(字节跳动,CVPR 2025,28M 参数) | Apache-2.0 |
-| 骨架 | DWPose(YOLOX-L 检人 + RTMPose 全身估点,ONNX) | Apache-2.0 |
-| 线稿 | OpenCV Canny | 不用模型 |
+| 用途 | 模型 | 本仓库里的文件 | 协议 |
+|---|---|---|---|
+| 深度图 | Video Depth Anything **Small**(字节跳动,CVPR 2025,28M 参数) | `weights/video_depth_anything_vits.pth` | Apache-2.0 |
+| 骨架 | DWPose(YOLOX-L 检人 + RTMPose 全身估点,ONNX) | `weights/yolox_l.onnx`、`weights/dw-ll_ucoco_384.onnx` | Apache-2.0 |
+| 线稿 | OpenCV Canny | 不用模型 | – |
+
+`weights/` 是原作者发布文件的镜像,未做任何改动(来源 `depth-anything/Video-Depth-Anything-Small` 与 `yzd-v/DWPose`,镜像脚本与校验值在 GitHub 仓库 `scripts/mirror_weights_to_modelscope.py`)。
ReShot 本身 Apache-2.0,默认深度模型和骨架模型(代码和权重)也都是。用在产品、流水线、服务里都行。更大的研究用深度权重(Base、Large)是 CC-BY-NC,不主动指定不会加载。
diff --git a/scripts/mirror_weights_to_modelscope.py b/scripts/mirror_weights_to_modelscope.py
new file mode 100644
index 0000000..fe19292
--- /dev/null
+++ b/scripts/mirror_weights_to_modelscope.py
@@ -0,0 +1,124 @@
+#!/usr/bin/env python3
+"""Mirror ReShot's default model weights to ModelScope (modelscope.cn/models/maosika/reshot).
+
+Why: the ModelScope model page is marked "pre-release" until the repo contains weight files, and
+users in China download from modelscope.cn far faster than from Hugging Face. The three files are
+exactly the ones `reshot` pulls from Hugging Face on first run — same names, same bytes (SHA-256
+checked here before anything is uploaded), all Apache-2.0:
+
+ video_depth_anything_vits.pth depth-anything/Video-Depth-Anything-Small (ByteDance)
+ yolox_l.onnx yzd-v/DWPose (person detector)
+ dw-ll_ucoco_384.onnx yzd-v/DWPose (whole-body pose)
+
+Usage (one command; the token is read from the environment and never written anywhere):
+
+ pip install modelscope huggingface_hub
+ export MODELSCOPE_API_TOKEN=<your SDK token from https://modelscope.cn/my/myaccesstoken>
+ python scripts/mirror_weights_to_modelscope.py # download (or reuse cache) → verify → upload
+ python scripts/mirror_weights_to_modelscope.py --dry-run # download + verify only, no upload
+
+Uploaded layout in the ModelScope repo: `weights/<original filename>`. Keep that stable — a future
+`RESHOT_WEIGHTS_SOURCE=modelscope` would resolve against these paths.
+"""
+
+from __future__ import annotations
+
+import argparse
+import hashlib
+import os
+import sys
+from pathlib import Path
+
+REPO_ID = "maosika/reshot"
+DEST_DIR = "weights"
+
+# (hf_repo, filename, sha256). The hashes are the LFS object ids on Hugging Face, i.e. the bytes
+# `reshot` itself runs on; a mismatch means a corrupted or substituted download — abort, don't upload.
+WEIGHTS = [
+ (
+ "depth-anything/Video-Depth-Anything-Small",
+ "video_depth_anything_vits.pth",
+ "13379300b739e659f076a59d52e9801bd8d38c541a7e71f73bbca4dcfb013609",
+ ),
+ (
+ "yzd-v/DWPose",
+ "yolox_l.onnx",
+ "7860ae79de6c89a3c1eb72ae9a2756c0ccfbe04b7791bb5880afabd97855a411",
+ ),
+ (
+ "yzd-v/DWPose",
+ "dw-ll_ucoco_384.onnx",
+ "724f4ff2439ed61afb86fb8a1951ec39c6220682803b4a8bd4f598cd913b1843",
+ ),
+]
+
+
+def sha256(path: Path) -> str:
+ h = hashlib.sha256()
+ with path.open("rb") as f:
+ for chunk in iter(lambda: f.read(16 * 1024 * 1024), b""):
+ h.update(chunk)
+ return h.hexdigest()
+
+
+def fetch_and_verify() -> list[tuple[Path, str]]:
+ """Return [(local_path, path_in_repo)] for all three files, or exit non-zero."""
+ try:
+ from huggingface_hub import hf_hub_download
+ except ImportError:
+ sys.exit("huggingface_hub is missing: pip install huggingface_hub")
+
+ out: list[tuple[Path, str]] = []
+ for hf_repo, filename, expected in WEIGHTS:
+ print(f"→ {hf_repo}/{filename}", flush=True)
+ local = Path(hf_hub_download(hf_repo, filename)) # cache hit if already downloaded
+ got = sha256(local)
+ if got != expected:
+ sys.exit(f"SHA-256 mismatch for {filename}:\n expected {expected}\n got {got}\nNot uploading.")
+ print(f" {local.stat().st_size / 1e6:,.1f} MB sha256 ok")
+ out.append((local, f"{DEST_DIR}/{filename}"))
+ return out
+
+
+def upload(files: list[tuple[Path, str]], token: str) -> None:
+ try:
+ from modelscope.hub.api import HubApi
+ except ImportError:
+ sys.exit("modelscope is missing: pip install modelscope")
+
+ api = HubApi()
+ api.login(token)
+ for local, path_in_repo in files:
+ print(f"↑ {path_in_repo}", flush=True)
+ api.upload_file(
+ repo_id=REPO_ID,
+ repo_type="model",
+ path_or_fileobj=str(local),
+ path_in_repo=path_in_repo,
+ commit_message=f"weights: mirror {local.name} (same bytes as the Hugging Face original, sha256 verified)",
+ )
+ print(f"\nDone. https://modelscope.cn/models/{REPO_ID}/files")
+
+
+def main() -> None:
+ ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
+ ap.add_argument("--dry-run", action="store_true", help="download + verify only; do not upload")
+ args = ap.parse_args()
+
+ files = fetch_and_verify()
+ if args.dry_run:
+ print("\n--dry-run: all three files verified, nothing uploaded.")
+ return
+ token = os.environ.get("MODELSCOPE_API_TOKEN", "").strip()
+ if not token:
+ sys.exit(
+ "MODELSCOPE_API_TOKEN is not set.\n"
+ "Get your SDK token at https://modelscope.cn/my/myaccesstoken, then:\n"
+ " export MODELSCOPE_API_TOKEN=<token>\n"
+ "and run this script again. The token is only read from the environment."
+ )
+ upload(files, token)
+
+
+if __name__ == "__main__":
+ main()