README.md 2.24 KB
Newer Older
yangzhong's avatar
yangzhong committed
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
需要用到xformers,所以使用的镜像是 image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-ubuntu22.04-dtk24.04.3-py3.10

dtk25.04.1和dtk25.04.2的镜像中没有适配安装xformers

```
# 拉取镜像
docker pull image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-ubuntu22.04-dtk24.04.3-py3.10
# 创建容器
docker run -it --network=host --name=dtk24043_torch23 -v /opt/hyhal:/opt/hyhal:ro -v /usr/local/hyhal:/usr/local/hyhal:ro -v /public:/public:ro --privileged --device=/dev/kfd --device=/dev/dri --ipc=host --shm-size=128G  --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -u root --ulimit stack=-1:-1 --ulimit memlock=-1:-1 image.sourcefind.cn:5000/dcu/admin/base/pytorch:2.3.0-ubuntu22.04-dtk24.04.3-py3.10
```

```
git clone https://github.com/NJU-PCALab/STAR.git
cd STAR
pip install -r requirements.txt    # 安装环境中缺少的依赖,已有的进行注释,open-clip-torch要安装指定版本!!!
# 安装diffusers
git clone -b v0.30.0-release http://developer.sourcefind.cn/codes/OpenDAS/diffusers.git
cd diffusers/
python3 setup.py install
sudo apt-get update && sudo apt-get install ffmpeg libsm6 libxext6  -y
```

#### Step 1: 下载预训练模型 [HuggingFace](https://huggingface.co/SherryX/STAR).

We provide two versions for I2VGen-XL-based model, `heavy_deg.pt` for heavy degraded videos and `light_deg.pt` for light degraded videos (e.g., the low-resolution video downloaded from video websites).

You can put the weight into `pretrained_weight/`.

#### Step 2: 准备测试数据(pr中有,此步跳过)

You can put the testing videos in the `input/video/`.

As for the prompt, there are three options: 1. No prompt. 2. Automatically generate a prompt (e.g., [using Pllava](https://github.com/hpcaitech/Open-Sora/tree/main/tools/caption#pllava-captioning)). 3. Manually write the prompt. You can put the txt file in the `input/text/`.

#### Step 3: 修改为自己的本地路径

You need to change the paths in `video_super_resolution/scripts/inference_sr.sh` to your local corresponding paths, including `video_folder_path`, `txt_file_path`, `model_path`, and `save_dir`.

#### Step 4: 运行推理命令

```
bash video_super_resolution/scripts/inference_sr.sh
```