File size: 2,404 Bytes
0a2c21d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# <u>Data Preprocessing Pipeline</u> by *Helios*
This repository describes the data preprocessing pipeline used in the [Helios](https://arxiv.org/abs/2603.04379) paper. And we prepare a toy training data [here](https://huggingface.co/BestWishYsh/HeliosBench-Weights/tree/main/demo_data).


## βš™οΈ Requirements and Installation


### Environment

```bash
# Activate conda environment
conda activate helios
```

## πŸ—οΈ Usage

### Step 1 - Prepare Metadata and Organize Videos

To train your own video generation model, create JSON files following this [format](./example/toy_data/toy_filter.json):

```
[
    {
        "cut": [0, 81],
        "crop": [0, 832, 0, 480],
        "fps": 24.0,
        "num_frames": 81,
        "resolution": {
        "height": 480,
        "width": 832
        },
        "cap": [
        "A stunning mid-afternoon ..."
        ],
        "path": "videos/2_240_ori81.mp4"
    },
    {
        "cut": [0, 81],
        ...
    }
...
]
```

and arrange video files following this [structure](./example):

```
πŸ“¦ example/
β”œβ”€β”€ πŸ“‚ toy_data/
β”‚   β”œβ”€β”€ πŸ“‚ videos
β”‚   β”‚   β”œβ”€β”€ 2_240_ori81.mp4
β”‚   β”‚   β”œβ”€β”€ 239_120_ori129.mp4.mp4
β”‚   β”‚   └── ...
β”‚   └── πŸ“„ toy_data_1.json
β”‚
β”œβ”€β”€ πŸ“‚ toy_data_2/
β”‚   β”‚   β”œβ”€β”€ A.mp4
β”‚   β”‚   β”œβ”€β”€ B.mp4
β”‚   β”‚   └── ...
β”‚   └── πŸ“„ toy_data_2.json
...
```

### Step 2 - Prepare Autoregressive Real Data

These data can be used for training Stage-1, Stage-2, and Stage-3.

```bash
# Remember to modify the input and output paths before running
bash get_short-latents.py
```

### Step 3 - Prepare Autoregressive ODE Data

These data can only be used for training Stage-3.

```bash
# Remember to modify the input and output paths before running
bash get_ode-pairs.sh
```

### (Optional) Step 4 - Prepare Text Data 

If you want to use the [Self-Forcing](https://github.com/guandeh17/Self-Forcing) training approach, prepare text embeddings:

```bash
# Remember to modify the input and output paths before running
bash get_text-embedding.sh
```

## πŸ”’ Acknowledgement

* This project wouldn't be possible without the following open-sourced repositories: [OpenSora Plan](https://github.com/PKU-YuanGroup/Open-Sora-Plan), [OpenSora](https://github.com/hpcaitech/Open-Sora), [Video-Dataset-Scripts](https://github.com/huggingface/video-dataset-scripts)