chence-heygen commited on
Commit
04dbac5
·
unverified ·
1 Parent(s): b26ba5b

Add model card

Browse files

The card was three lines of front matter. It now describes what the checkpoint is, and leads with
the thing a reader has to know before anything else: the vision tower takes six channels, RGB
concatenated with an optical-flow visualisation, so a standard AutoProcessor pipeline feeds three
and returns nonsense. The weights load either way, which is what makes that failure worth a
warning rather than a footnote.

No standalone transformers snippet is given, on purpose. A three-channel one would run. Instead the
usage section is the real path end to end, including the cuDNN pin that a uv sync silently undoes
and that a Conv3d patch embed cannot do without.

Metrics are not quoted here. Comparisons live on the project page with the protocol attached, and
the evaluation README states plainly which released artifacts are missing for a bit-exact
reproduction of the published figures.

README.md CHANGED
@@ -9,4 +9,168 @@ tags:
9
  - Transition Detection
10
  - Video Transition
11
  - Video Processing
12
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  - Transition Detection
10
  - Video Transition
11
  - Video Processing
12
+ ---
13
+
14
+ <p align="center">
15
+ <a href="https://www.heygen.com/research">
16
+ <picture>
17
+ <source media="(prefers-color-scheme: dark)" srcset="assets/heygen-full-white-color-logo.svg">
18
+ <img src="assets/heygen-full-black-color-logo.svg" width="240" alt="HeyGen Research">
19
+ </picture>
20
+ </a>
21
+ </p>
22
+
23
+ <h1 align="center">TransVLM</h1>
24
+
25
+ <p align="center">
26
+ <b>A Vision-Language Framework and Benchmark for Detecting Any Shot Transitions</b>
27
+ </p>
28
+
29
+ <p align="center">
30
+ University of Melbourne &nbsp;·&nbsp; HeyGen Research &nbsp;·&nbsp; Nanyang Technological University
31
+ </p>
32
+
33
+ <p align="center">
34
+ <a href="https://arxiv.org/abs/2604.27975"><img src="https://img.shields.io/badge/arXiv-2604.27975-b31b1b.svg" alt="arXiv"></a>
35
+ <a href="https://heygen-com.github.io/TransVLM/"><img src="https://img.shields.io/badge/Project-Page-1f6feb.svg" alt="Project Page"></a>
36
+ <a href="https://github.com/heygen-com/TransVLM"><img src="https://img.shields.io/badge/GitHub-heygen--com%2FTransVLM-181717.svg" alt="GitHub"></a>
37
+ <a href="https://www.apache.org/licenses/LICENSE-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-3da639.svg" alt="License"></a>
38
+ </p>
39
+
40
+ <p align="center">
41
+ <b>Accepted to ECCV 2026 (Poster)</b>
42
+ </p>
43
+
44
+ > [!IMPORTANT]
45
+ > **This is not a drop-in Qwen3-VL checkpoint.** Its vision tower takes **6 channels**: RGB
46
+ > concatenated with an optical-flow visualisation (`config.json` → `vision_config.in_channels: 6`).
47
+ > A standard `AutoProcessor` / `Qwen3VLForConditionalGeneration` pipeline supplies 3 channels and
48
+ > will not produce correct results. The weights load, but the input is wrong.
49
+ >
50
+ > Run it through the released inference code: **https://github.com/heygen-com/TransVLM**
51
+
52
+ ## Model Description
53
+
54
+ Traditional Shot Boundary Detection (SBD) looks for isolated cut *points*, which breaks down on
55
+ gradual transitions and frequently yields corrupted shots. **TransVLM** targets Shot Transition
56
+ Detection (STD) instead: it predicts the continuous temporal *segments* over which a transition
57
+ happens.
58
+
59
+ The model is Qwen3-VL-4B-Instruct with one architectural change. Its vision patch embedding is
60
+ widened from 3 to 6 input channels (zero-padded at initialisation), so an optical-flow
61
+ visualisation enters the model alongside RGB at the input stage. Motion is what separates a
62
+ dissolve from a camera pan, and a model that only sees appearance has to infer it. Because the
63
+ flow is fused *before* patchification, the language backbone carries no additional visual tokens,
64
+ so temporal awareness comes for free at the token budget.
65
+
66
+ Training used a scalable FFmpeg-based data engine covering 59 transition effects, which addresses
67
+ the severe class imbalance in public shot-boundary data.
68
+
69
+ ## Model Details
70
+
71
+ | | |
72
+ |---|---|
73
+ | Base model | [Qwen/Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct) |
74
+ | Architecture | `Qwen3VLForConditionalGeneration` |
75
+ | Precision | `bfloat16` |
76
+ | Vision input channels | **6** (RGB + optical-flow visualisation, concatenated on the channel axis) |
77
+ | Sampling frame rate | 25 fps |
78
+ | Optical flow | [NeuFlow v2](https://huggingface.co/Study-is-happy/neuflow-v2), computed at inference time. Its weights (~30 MB) come from the Hub on first use, so expect a second download |
79
+ | Input | One video; flow is computed for you |
80
+ | Output | Transition segments as start/end times in seconds |
81
+ | Saved with | `transformers` 4.57.3 |
82
+
83
+ ## Intended Use and Limitations
84
+
85
+ **Intended for** detecting shot transitions in videos, both hard cuts and gradual effects, and
86
+ as a baseline on the STD benchmark.
87
+
88
+ **Limitations**
89
+
90
+ - Not a frame-level cut-point classifier. The output is a time span per transition, not a single
91
+ boundary frame.
92
+ - Not a general video-chat model. It was fine-tuned on one task with one prompt; the prompt ships
93
+ with the inference code and changing it changes the task.
94
+ - Long videos should be split before inference. Cost is linear in duration, and the flow
95
+ visualisation is normalised over its whole input, so a long video and its parts are not the same
96
+ signal.
97
+
98
+ ## Usage
99
+
100
+ No standalone `transformers` snippet is given here on purpose: a 3-channel one would run and
101
+ return nonsense. Use the inference package, which needs Python 3.12, a CUDA GPU, and `ffmpeg`
102
+ on `PATH`:
103
+
104
+ ```bash
105
+ git clone https://github.com/heygen-com/TransVLM
106
+ cd TransVLM/inference
107
+
108
+ uv venv && source .venv/bin/activate
109
+ uv sync --group cu130 --group dev # cu128 if your driver is older than 570
110
+
111
+ # Do not skip this. PyTorch 2.9.1 has a Conv3d bug below cuDNN 9.15, and the 6-channel
112
+ # patch embed IS a Conv3d, so it is on the hot path of every forward pass. `uv sync`
113
+ # resolves cuDNN back down, so re-run this after every sync. Activate the venv first:
114
+ # unlike `uv sync`, `uv pip` installs into whatever environment is active.
115
+ uv pip install nvidia-cudnn-cu13==9.16.0.29 # nvidia-cudnn-cu12 for cu128 / cu126
116
+ python -c "import torch; print(torch.backends.cudnn.version())" # must print 91600
117
+
118
+ hf download HeyGenAI/TransVLM-Qwen3-VL-4B-Instruct --local-dir ./pretrained/TransVLM-v1
119
+
120
+ python infer_video.py \
121
+ --video /path/to/video.mp4 \
122
+ --ckpt-dir ./pretrained/TransVLM-v1 \
123
+ --output-jsonl out.jsonl
124
+ ```
125
+
126
+ The cuDNN package name tracks the CUDA flavour, and installing the wrong one is a silent
127
+ no-op: it lands an unused package while torch keeps loading the other family. That is why
128
+ the check prints a version number instead of trusting the install.
129
+
130
+ Each output line carries `segments` as `{start_time, end_time}` pairs in seconds on the original
131
+ video's timeline, plus timings and the full configuration that produced them.
132
+
133
+ Three backends are supported: HuggingFace (default), vLLM and SGLang. Environment setup, every
134
+ option and the output schema are documented in
135
+ [`inference/README.md`](https://github.com/heygen-com/TransVLM/blob/main/inference/README.md).
136
+
137
+ ## Evaluation
138
+
139
+ Qualitative results and the comparison against baselines are on the
140
+ [project page](https://heygen-com.github.io/TransVLM/).
141
+
142
+ The scorer that produced the paper's metric is released at
143
+ [`evaluation/`](https://github.com/heygen-com/TransVLM/tree/main/evaluation). Note that the
144
+ published figures cannot be reproduced bit-for-bit from the released artifacts alone. The
145
+ benchmark ground truth and the pre-computed optical flow used for that run are not part of this
146
+ release. The reasons are spelled out in
147
+ [`evaluation/README.md`](https://github.com/heygen-com/TransVLM/blob/main/evaluation/README.md).
148
+
149
+ ## Release Progress
150
+
151
+ - [x] Model weights
152
+ - [x] Inference code
153
+ - [x] Evaluation code
154
+ - [ ] Data engine code
155
+ - [ ] STD benchmark data
156
+ - [ ] Re-annotated dataset labels
157
+ - [ ] Leaderboard
158
+
159
+ 🚧 The remaining items are being prepared for release.
160
+
161
+ ## Citation
162
+
163
+ ```bibtex
164
+ @inproceedings{chen2026transvlm,
165
+ title={TransVLM: A Vision-Language Framework and Benchmark for Detecting Any Shot Transitions},
166
+ author={Chen, Ce and Ren, Yi and Li, Yuanming and Goriachko, Viktor and
167
+ Ye, Zhenhui and Guo, Zujin and Hong, Zhibin and Gong, Mingming},
168
+ booktitle={European Conference on Computer Vision},
169
+ year={2026},
170
+ organization={Springer}
171
+ }
172
+ ```
173
+
174
+ ## License
175
+
176
+ Apache License 2.0, inherited from [Qwen3-VL-4B-Instruct](https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct).
assets/heygen-full-black-color-logo.svg ADDED
assets/heygen-full-white-color-logo.svg ADDED