Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
---
|
| 2 |
pretty_name: Matrix-Game 2.0 Self-Consistency Reproduction
|
| 3 |
tags:
|
|
@@ -9,12 +10,13 @@ tags:
|
|
| 9 |
|
| 10 |
# Matrix-Game 2.0 Self-Consistency Reproduction
|
| 11 |
|
| 12 |
-
This
|
| 13 |
-
*Reasoning-Structured Videos: A Stratified Diagnostic Suite for Compositional
|
| 14 |
-
Consistency in World Models*.
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
## What is reproduced
|
| 20 |
|
|
@@ -22,122 +24,155 @@ The statistical unit is one relation graph:
|
|
| 22 |
|
| 23 |
- **Inverse-SC:** generated first frame versus generated final frame.
|
| 24 |
- **Loop-SC:** generated first frame versus generated final frame.
|
| 25 |
-
- **Equivalence-SC:** generated final frame of branch A versus generated final
|
| 26 |
-
frame of branch B.
|
| 27 |
-
|
| 28 |
-
The release contains 448 Inverse graphs, 445 Loop graphs, and 239 Equivalence A/B
|
| 29 |
-
pairs. The script checks these counts and pairing integrity before evaluation.
|
| 30 |
-
|
| 31 |
-
## Data
|
| 32 |
-
|
| 33 |
-
Reproduction bundle (videos, evaluator, and this README):
|
| 34 |
-
|
| 35 |
-
<https://huggingface.co/datasets/VideoWorldmodel/Evaluation>
|
| 36 |
-
|
| 37 |
-
The generated videos were originally released at:
|
| 38 |
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
-
|
| 42 |
-
reproduction:
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
|
| 47 |
|
|
|
|
| 48 |
```bash
|
| 49 |
python -m pip install -U huggingface_hub
|
|
|
|
| 50 |
hf download VideoWorldmodel/Evaluation \
|
| 51 |
--repo-type dataset \
|
| 52 |
--include "MatrixGame2_SC_videos.zip" \
|
| 53 |
--local-dir .
|
| 54 |
-
unzip MatrixGame2_SC_videos.zip -d data/Nips_WM_Eval_qzf
|
| 55 |
```
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|--
|
| 63 |
-
|--
|
| 64 |
-
|--
|
| 65 |
-
|
|
|
|
| 66 |
```
|
| 67 |
|
| 68 |
-
If
|
| 69 |
-
small pointer files before evaluation.
|
| 70 |
|
| 71 |
## Environment
|
| 72 |
|
| 73 |
-
Python 3.10 or newer is recommended.
|
| 74 |
|
|
|
|
| 75 |
```bash
|
| 76 |
python -m venv .venv
|
| 77 |
-
source .venv/bin/activate
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
python -m pip install --upgrade pip
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
```
|
| 82 |
|
| 83 |
-
For a specific CUDA build, install the matching
|
| 84 |
-
from the official PyTorch instructions first, then install NumPy, OpenCV, and
|
| 85 |
-
`lpips==0.1.4` from the command above without reinstalling PyTorch.
|
| 86 |
|
| 87 |
The first LPIPS run downloads the official AlexNet weights.
|
| 88 |
|
| 89 |
-
## Reproduce the paper
|
| 90 |
|
|
|
|
| 91 |
```bash
|
| 92 |
python evaluate_matrix_game_sc.py \
|
| 93 |
-
--data data/
|
| 94 |
--output results/matrix_game_sc \
|
| 95 |
--lpips \
|
| 96 |
--device auto \
|
| 97 |
--check-paper
|
| 98 |
```
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
`--
|
|
|
|
|
|
|
| 103 |
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
-
|
| 113 |
-
paper. Two Equivalence pairs are exact pixel matches. Their PSNR is infinite, so
|
| 114 |
-
they are reported in `psnr_exact_match_n` and excluded from the finite PSNR mean;
|
| 115 |
-
this produces the reported Equivalence PSNR.
|
| 116 |
|
| 117 |
## Outputs
|
| 118 |
|
| 119 |
The output directory contains:
|
| 120 |
-
|
| 121 |
-
``
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
audit.json # metric definitions, counts, versions, and bootstrap settings
|
| 126 |
-
report.md # compact Markdown result table
|
| 127 |
-
```
|
| 128 |
|
| 129 |
Confidence intervals use 10,000 graph-level bootstrap resamples with seed 2026.
|
| 130 |
-
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
## Tests
|
| 134 |
|
|
|
|
| 135 |
```bash
|
| 136 |
python -m unittest discover -s tests -v
|
| 137 |
```
|
| 138 |
|
| 139 |
## Scope
|
| 140 |
|
| 141 |
-
This code reproduces the Matrix-Game 2.0
|
| 142 |
-
claim to reproduce the paper
|
| 143 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
```markdown
|
| 2 |
---
|
| 3 |
pretty_name: Matrix-Game 2.0 Self-Consistency Reproduction
|
| 4 |
tags:
|
|
|
|
| 10 |
|
| 11 |
# Matrix-Game 2.0 Self-Consistency Reproduction
|
| 12 |
|
| 13 |
+
This README explains how to reproduce the Matrix-Game 2.0 self-consistency (SC) row in *Reasoning-Structured Videos: A Stratified Diagnostic Suite for Compositional Consistency in World Models*.
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
All experimental data, generated videos, and evaluation files required for this reproduction are available on the current dataset page under **Files and versions**:
|
| 16 |
+
|
| 17 |
+
<https://huggingface.co/datasets/VideoWorldmodel/Evaluation>
|
| 18 |
+
|
| 19 |
+
No external dataset or ground-truth video is required for this reproduction.
|
| 20 |
|
| 21 |
## What is reproduced
|
| 22 |
|
|
|
|
| 24 |
|
| 25 |
- **Inverse-SC:** generated first frame versus generated final frame.
|
| 26 |
- **Loop-SC:** generated first frame versus generated final frame.
|
| 27 |
+
- **Equivalence-SC:** generated final frame of branch A versus generated final frame of branch B.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
+
The released data contains:
|
| 30 |
+
- 448 Inverse graphs
|
| 31 |
+
- 445 Loop graphs
|
| 32 |
+
- 239 Equivalence A/B pairs
|
| 33 |
|
| 34 |
+
Before evaluation, the script verifies the expected file counts and checks the integrity of the Equivalence A/B pairings.
|
|
|
|
| 35 |
|
| 36 |
+
## Download the experimental data
|
| 37 |
|
| 38 |
+
The MP4-only reproduction archive is available under **Files and versions** on the current dataset page.
|
| 39 |
|
| 40 |
+
Install the Hugging Face CLI and download the archive:
|
| 41 |
```bash
|
| 42 |
python -m pip install -U huggingface_hub
|
| 43 |
+
|
| 44 |
hf download VideoWorldmodel/Evaluation \
|
| 45 |
--repo-type dataset \
|
| 46 |
--include "MatrixGame2_SC_videos.zip" \
|
| 47 |
--local-dir .
|
|
|
|
| 48 |
```
|
| 49 |
|
| 50 |
+
Extract the archive:
|
| 51 |
+
```bash
|
| 52 |
+
unzip MatrixGame2_SC_videos.zip -d data/matrix_game_sc
|
| 53 |
+
```
|
| 54 |
|
| 55 |
+
The expected directory layout is:
|
| 56 |
+
```
|
| 57 |
+
data/matrix_game_sc/
|
| 58 |
+
|-- inverse_easy/ # 246 MP4 files
|
| 59 |
+
|-- inverse_hard/ # 202 MP4 files
|
| 60 |
+
|-- loop_easy/ # 247 MP4 files
|
| 61 |
+
|-- loop_hard/ # 198 MP4 files
|
| 62 |
+
`-- equivalence/ # 478 MP4 files = 239 A/B pairs
|
| 63 |
```
|
| 64 |
|
| 65 |
+
If the dataset was cloned using Git LFS, verify that the downloaded files are real MP4 files rather than small Git LFS pointer files.
|
|
|
|
| 66 |
|
| 67 |
## Environment
|
| 68 |
|
| 69 |
+
Python 3.10 or newer is recommended.
|
| 70 |
|
| 71 |
+
Create and activate a virtual environment (Linux/macOS):
|
| 72 |
```bash
|
| 73 |
python -m venv .venv
|
| 74 |
+
source .venv/bin/activate
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
On Windows:
|
| 78 |
+
```powershell
|
| 79 |
+
.venv\Scripts\activate
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
Install the required dependencies:
|
| 83 |
+
```bash
|
| 84 |
python -m pip install --upgrade pip
|
| 85 |
+
|
| 86 |
+
python -m pip install \
|
| 87 |
+
"numpy>=1.26,<3" \
|
| 88 |
+
"opencv-python-headless>=4.8,<5" \
|
| 89 |
+
"torch>=2.2,<3" \
|
| 90 |
+
"torchvision>=0.17,<1" \
|
| 91 |
+
"lpips==0.1.4"
|
| 92 |
```
|
| 93 |
|
| 94 |
+
For a specific CUDA build, first install the matching torch and torchvision wheels by following the official PyTorch installation instructions. Then install NumPy, OpenCV, and lpips==0.1.4 without reinstalling PyTorch.
|
|
|
|
|
|
|
| 95 |
|
| 96 |
The first LPIPS run downloads the official AlexNet weights.
|
| 97 |
|
| 98 |
+
## Reproduce the paper results
|
| 99 |
|
| 100 |
+
Run the complete evaluation:
|
| 101 |
```bash
|
| 102 |
python evaluate_matrix_game_sc.py \
|
| 103 |
+
--data data/matrix_game_sc \
|
| 104 |
--output results/matrix_game_sc \
|
| 105 |
--lpips \
|
| 106 |
--device auto \
|
| 107 |
--check-paper
|
| 108 |
```
|
| 109 |
|
| 110 |
+
Available device options include:
|
| 111 |
+
- `--device auto`
|
| 112 |
+
- `--device cpu`
|
| 113 |
+
- `--device cuda`
|
| 114 |
+
- `--device cuda:0`
|
| 115 |
|
| 116 |
+
Example: run the evaluation explicitly on CPU:
|
| 117 |
+
```bash
|
| 118 |
+
python evaluate_matrix_game_sc.py \
|
| 119 |
+
--data data/matrix_game_sc \
|
| 120 |
+
--output results/matrix_game_sc \
|
| 121 |
+
--lpips \
|
| 122 |
+
--device cpu \
|
| 123 |
+
--check-paper
|
| 124 |
+
```
|
| 125 |
|
| 126 |
+
For a faster PSNR-only audit, omit `--lpips` and `--check-paper`:
|
| 127 |
+
```bash
|
| 128 |
+
python evaluate_matrix_game_sc.py \
|
| 129 |
+
--data data/matrix_game_sc \
|
| 130 |
+
--output results/matrix_game_sc_psnr \
|
| 131 |
+
--device auto
|
| 132 |
+
```
|
| 133 |
+
|
| 134 |
+
## Expected results
|
| 135 |
+
|
| 136 |
+
| Relation | Graph N | Recomputed LPIPS / PSNR | Paper LPIPS / PSNR |
|
| 137 |
+
|----------------|---------|-------------------------|--------------------|
|
| 138 |
+
| Inverse-SC | 448 | 0.7061 / 10.4476 | 0.71 / 10.45 |
|
| 139 |
+
| Loop-SC | 445 | 0.7173 / 10.6227 | 0.72 / 10.62 |
|
| 140 |
+
| Equivalence-SC | 239 | 0.5918 / 12.5732 | 0.59 / 12.57 |
|
| 141 |
+
|
| 142 |
+
The `--check-paper` option succeeds when all six computed values reproduce the precision reported in the paper.
|
| 143 |
|
| 144 |
+
Two Equivalence pairs are exact pixel matches. Their PSNR values are infinite, so they are recorded in `psnr_exact_match_n` and excluded from the finite PSNR mean. This produces the reported Equivalence PSNR.
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
## Outputs
|
| 147 |
|
| 148 |
The output directory contains:
|
| 149 |
+
- `per_graph.csv`: One row per Inverse/Loop graph or Equivalence A/B pair
|
| 150 |
+
- `summary.csv`: Means, standard deviations, and graph-bootstrap 95% CIs
|
| 151 |
+
- `paper_check.csv`: Computed values compared with the reported paper values
|
| 152 |
+
- `audit.json`: Metric definitions, counts, versions, and bootstrap settings
|
| 153 |
+
- `report.md`: Compact Markdown results table
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
Confidence intervals use 10,000 graph-level bootstrap resamples with seed 2026.
|
| 156 |
+
|
| 157 |
+
### Metric settings
|
| 158 |
+
- LPIPS uses `lpips==0.1.4` with AlexNet.
|
| 159 |
+
- LPIPS inputs are RGB images scaled to [-1, 1].
|
| 160 |
+
- PSNR is computed on decoded RGB uint8 endpoint frames.
|
| 161 |
+
- PSNR uses MAX=255.
|
| 162 |
+
- No resizing is applied.
|
| 163 |
+
- Exact pixel matches are reported separately from the finite PSNR mean.
|
| 164 |
|
| 165 |
## Tests
|
| 166 |
|
| 167 |
+
Run the test suite with:
|
| 168 |
```bash
|
| 169 |
python -m unittest discover -s tests -v
|
| 170 |
```
|
| 171 |
|
| 172 |
## Scope
|
| 173 |
|
| 174 |
+
This code reproduces the Matrix-Game 2.0 SC endpoint metrics only.
|
| 175 |
+
It does not claim to reproduce the paper’s GT-anchored metrics or FVD, which require additional generation-context and clip-sampling details.
|
| 176 |
+
|
| 177 |
+
All data required for the SC endpoint reproduction described in this README is available on the current dataset page.
|
| 178 |
+
```
|