Files
hao-ai-lab-FastVideo/pyproject.toml
T
shaoxiongduan f6275f8005 [feat] Port wm-eval into fastvideo as fastvideo.eval
Adds an in-process evaluation suite covering native (SSIM/PSNR/LPIPS/
optical_flow), audio, physics_iq, vbench (16 sub-metrics), and
videoscore2. Public API: create_evaluator/evaluate, BaseMetric +
@register, ensure_checkpoint, get_cache_dir. CLI: fastvideo eval
list/run.

VBench upstream pinned as a git submodule at
fastvideo/third_party/eval/vbench (Vchitect/VBench@45e79ec); modern-dep
compat is achieved via runtime shims in vbench/__init__.py rather than
on-disk patches. CLIP/torch.hub caches are routed through
${FASTVIDEO_EVAL_CACHE}; HF cache stays at the system default.
ensure_checkpoint delegates to fastvideo.utils.get_lock + huggingface_hub
primitives. Evaluator supports release_cuda_memory(), unload(),
reload() for training-time eval that frees GPU between calls.

Verified parity against upstream vbench (5/8 metrics bit-exact, others
within 1% drift driven by transformers/torch version skew) and against
upstream VideoScore2 (regex anchored on the actual model's output
format, soft-score formula matches upstream's argmax*max_prob/total).

Includes docs/contributing/eval-metrics.md as the porting guide.
Out of scope (deferred follow-ups): MIND, VBench-2.0, FVD as a
registered metric, training-time EvalCallback.
2026-05-01 23:17:19 +00:00

233 lines
4.7 KiB
TOML

[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "fastvideo"
version = "0.1.7"
description = "FastVideo"
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
]
dependencies = [
# Core Libraries
"scipy==1.14.1",
"six==1.16.0",
"h5py==3.12.1",
"requests>=2.32.2",
# Machine Learning & Transformers
"transformers==4.57.3",
"tokenizers>=0.20.1",
"sentencepiece==0.2.0",
"timm==1.0.11",
"peft>=0.15.0",
"diffusers>=0.33.1",
"torch>=2.10.0",
"torchvision",
"torchaudio",
# Acceleration & Optimization
"accelerate==1.0.1",
# Computer Vision & Image Processing
"opencv-python==4.10.0.84",
"pillow>=10.3.0",
"imageio==2.36.0",
"imageio-ffmpeg==0.5.1",
"einops",
# Experiment Tracking & Logging
"wandb>=0.21.0",
"loguru",
"test-tube==0.7.5",
# Miscellaneous Utilities
"tqdm",
"pytest",
"PyYAML==6.0.1",
"protobuf>=5.28.3",
"gradio==5.32.0",
"moviepy>=2.0.0",
"flask",
"flask_restful",
"aiohttp",
"aiofiles",
"huggingface_hub",
"cloudpickle",
"omegaconf",
# System & Monitoring Tools
"gpustat",
"watch",
"remote-pdb",
# Kernel & Packaging
"fastvideo-kernel==0.2.6",
"wheel",
# Training Dependencies
"torchdata",
"pyarrow",
"datasets==4.0.0",
"av",
# Preprocessing Dependencies
"torchcodec",
"ray>=2.49.1",
"ftfy==6.3.1",
# Job Runner
"fastapi==0.129.0",
"uvicorn==0.41.0"
]
[tool.uv]
prerelease = "allow"
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu", marker = "sys_platform != 'linux'" },
{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" },
]
torchvision = [
{ index = "pytorch-cpu", marker = "sys_platform != 'linux'" },
{ index = "pytorch-cu128", marker = "sys_platform == 'linux'" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[[tool.uv.index]]
name = "pytorch-cu128"
url = "https://download.pytorch.org/whl/cu128"
explicit = true
[project.optional-dependencies]
# flash-attn: pip install flash-attn==2.8.1 --no-cache-dir --no-build-isolation
lint = [
"pre-commit==4.0.1",
"types-aiofiles",
"types-requests",
]
test = [
"av",
"pytorch-msssim==1.0.0",
"pytest",
]
# Extra deps for `fastvideo.eval`. The vbench upstream submodule ships
# its own ad-hoc requirements list; this group covers the imports that
# the in-tree metric adapters (and vbench's pure-Python helpers) need.
# Heavier per-metric deps (detectron2, mmcv, ...) are left for users to
# install on demand — the metric registry surfaces a clear ImportError.
eval = [
"decord",
"openai-clip",
"open_clip_torch",
"pyiqa",
"ptlflow",
"lpips",
"torchmetrics",
"easydict",
"qwen-vl-utils",
]
dev = [ "fastvideo[lint]", "fastvideo[test]", ]
rocm = [
"amdsmi",
]
[project.scripts]
fastvideo = "fastvideo.entrypoints.cli.main:main"
[tool.setuptools.packages.find]
exclude = ["assets*", "docker*", "docs", "scripts*"]
[tool.wheel]
exclude = ["assets*", "docker*", "docs", "scripts*"]
[tool.mypy]
warn_unused_configs = true
ignore_missing_imports = true
disallow_untyped_calls = true
check_untyped_defs = true
follow_imports = "silent"
[tool.codespell]
skip = "./data,./wandb,ui/package-lock.json"
[tool.ruff]
# Allow lines to be as long as 120.
line-length = 120
extend-exclude = [
# Upstream submodules under fastvideo/third_party/ are not our style
# territory; modern-dep compat lives as runtime shims in our metric
# __init__.py files.
"fastvideo/third_party/**",
]
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
# "I",
"G",
]
ignore = [
# star imports
"F405", "F403",
# lambda expression assignment
"E731",
# Loop control variable not used within loop body
"B007",
# f-string format
"UP032",
# line too long
"E501",
]
[tool.ruff.lint.per-file-ignores]
# Ignore all files that end in `_test.py`.
"fastvideo/models/hunyuan/diffusion/pipelines/pipeline_hunyuan_video.py" = ["E741"]
[tool.yapf]
column_limit = 120
[tool.isort]
line_length = 120
use_parentheses = true
skip_gitignore = true
[project.urls]
Repository = "https://github.com/hao-ai-lab/FastVideo"
# Used by Comfy Registry https://comfyregistry.org
[tool.comfy]
PublisherId = "fastvideo"
DisplayName = "FastVideo"
Icon = "https://raw.githubusercontent.com/hao-ai-lab/FastVideo/main/comfyui/assets/icon_simple.svg"