Spaces:
Runtime error
Runtime error
add chinese version
Browse files- README_chinese.md +123 -0
README_chinese.md
ADDED
@@ -0,0 +1,123 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[English](https://github.com/megvii-research/CoNR/blob/main/README.md) | [中文](https://github.com/megvii-research/CoNR/blob/main/README_chinese.md)
|
2 |
+
# CoNR: 用于二次元手绘设定稿动画化的神经渲染器
|
3 |
+
|
4 |
+
|
5 |
+
## [HomePage](https://conr.ml) | Colab [English](https://colab.research.google.com/github/megvii-research/CoNR/blob/main/conr.ipynb)/[中文](https://colab.research.google.com/github/megvii-research/CoNR/blob/main/conr_chinese.ipynb) | [arXiv](https://arxiv.org/abs/2207.05378)
|
6 |
+
|
7 |
+
![image](images/MAIN.png)
|
8 |
+
|
9 |
+
## Introduction
|
10 |
+
|
11 |
+
该项目为论文[Collaborative Neural Rendering using Anime Character Sheets](https://arxiv.org/abs/2207.05378)的官方复现,旨在从手绘人物设定稿生成生动的舞蹈动画。您可以在我们的[主页](https://conr.ml)中查看更多视频 demo。
|
12 |
+
|
13 |
+
贡献者: [@transpchan](https://github.com/transpchan/), [@P2Oileen](https://github.com/P2Oileen), [@hzwer](https://github.com/hzwer)
|
14 |
+
|
15 |
+
## 使用方法
|
16 |
+
|
17 |
+
#### 需求
|
18 |
+
|
19 |
+
* Nvidia GPU + CUDA + CUDNN
|
20 |
+
* Python 3.6
|
21 |
+
|
22 |
+
#### 安装
|
23 |
+
|
24 |
+
* 克隆该项目
|
25 |
+
|
26 |
+
```bash
|
27 |
+
git clone https://github.com/megvii-research/CoNR
|
28 |
+
```
|
29 |
+
|
30 |
+
* 安装依赖
|
31 |
+
|
32 |
+
请运行以下命令以安装CoNR所需的所有依赖。
|
33 |
+
|
34 |
+
```bash
|
35 |
+
cd CoNR
|
36 |
+
pip install -r requirements.txt
|
37 |
+
```
|
38 |
+
|
39 |
+
* 下载权重
|
40 |
+
运行以下代码,从 Google Drive 下载模型的权重。此外, 你也可以从 [百度云盘](https://pan.baidu.com/s/1U11iIk-DiJodgCveSzB6ig?pwd=RDxc) (password:RDxc)下载权重。
|
41 |
+
|
42 |
+
```
|
43 |
+
mkdir weights && cd weights
|
44 |
+
gdown https://drive.google.com/uc?id=1M1LEpx70tJ72AIV2TQKr6NE_7mJ7tLYx
|
45 |
+
gdown https://drive.google.com/uc?id=1YvZy3NHkJ6gC3pq_j8agcbEJymHCwJy0
|
46 |
+
gdown https://drive.google.com/uc?id=1AOWZxBvTo9nUf2_9Y7Xe27ZFQuPrnx9i
|
47 |
+
gdown https://drive.google.com/uc?id=19jM1-GcqgGoE1bjmQycQw_vqD9C5e-Jm
|
48 |
+
```
|
49 |
+
|
50 |
+
#### Prepare inputs
|
51 |
+
我们为两个不同的人物,准备了两个超密集姿势(Ultra-Dense Pose)序列,从以下代码中二选一运行,即可从 Google Drive 下载。您可以通过任意的3D模型和动作数据,生成更多的超密集姿势序列,参考我们的[论文](https://arxiv.org/abs/2207.05378)。暂不提供官方转换接口。
|
52 |
+
[百度云盘](https://pan.baidu.com/s/1hWvz4iQXnVTaTSb6vu1NBg?pwd=RDxc) (password:RDxc)
|
53 |
+
|
54 |
+
```
|
55 |
+
# 短发女孩的超密集姿势
|
56 |
+
gdown https://drive.google.com/uc?id=11HMSaEkN__QiAZSnCuaM6GI143xo62KO
|
57 |
+
unzip short_hair.zip
|
58 |
+
mv short_hair/ poses/
|
59 |
+
|
60 |
+
# 双马尾女孩的超密集姿势
|
61 |
+
gdown https://drive.google.com/uc?id=1WNnGVuU0ZLyEn04HzRKzITXqib1wwM4Q
|
62 |
+
unzip double_ponytail.zip
|
63 |
+
mv double_ponytail/ poses/
|
64 |
+
```
|
65 |
+
|
66 |
+
我们提供两个人物手绘设定表的样例,从以下代码中二选一运行,即可从 Google Drive下载。您也可以自行绘制。
|
67 |
+
[百度云盘](https://pan.baidu.com/s/1shpP90GOMeHke7MuT0-Txw?pwd=RDxc) (password:RDxc)
|
68 |
+
|
69 |
+
```
|
70 |
+
# 短发女孩的手绘设定表
|
71 |
+
gdown https://drive.google.com/uc?id=1r-3hUlENSWj81ve2IUPkRKNB81o9WrwT
|
72 |
+
unzip short_hair_images.zip
|
73 |
+
mv short_hair_images/ character_sheet/
|
74 |
+
|
75 |
+
# 双马尾女孩的手绘设定表
|
76 |
+
gdown https://drive.google.com/uc?id=1XMrJf9Lk_dWgXyTJhbEK2LZIXL9G3MWc
|
77 |
+
unzip double_ponytail_images.zip
|
78 |
+
mv double_ponytail_images/ character_sheet/
|
79 |
+
```
|
80 |
+
|
81 |
+
#### 运行!
|
82 |
+
我们提供两种方案:使用web图形界面,或使用命令行代码运行。
|
83 |
+
|
84 |
+
* 使用web图形界面 (通过 [Streamlit](https://streamlit.io/) 实现)
|
85 |
+
|
86 |
+
运行以下代码:
|
87 |
+
|
88 |
+
```
|
89 |
+
streamlit run streamlit.py --server_port=8501
|
90 |
+
```
|
91 |
+
|
92 |
+
然后打开浏览器并访问 `localhost:8501`, 根据页面内的指示生成视频。
|
93 |
+
|
94 |
+
* 使用命令行代码
|
95 |
+
|
96 |
+
请注意替换`{}`内容,并更换为您放置相应内容的文件夹位置。
|
97 |
+
|
98 |
+
```
|
99 |
+
mkdir {结果保存路径}
|
100 |
+
|
101 |
+
python -m torch.distributed.launch \
|
102 |
+
--nproc_per_node=1 train.py --mode=test \
|
103 |
+
--world_size=1 --dataloaders=2 \
|
104 |
+
--test_input_poses_images={姿势路径} \
|
105 |
+
--test_input_person_images={人物设定表路径} \
|
106 |
+
--test_output_dir={结果保存路径} \
|
107 |
+
--test_checkpoint_dir={权重路径}
|
108 |
+
|
109 |
+
ffmpeg -r 30 -y -i {结果保存路径}/%d.png -r 30 -c:v libx264 output.mp4 -r 30
|
110 |
+
```
|
111 |
+
|
112 |
+
视频结果将生成在 `CoNR/output.mp4`。
|
113 |
+
|
114 |
+
## 引用CoNR
|
115 |
+
```bibtex
|
116 |
+
@article{lin2022conr,
|
117 |
+
title={Collaborative Neural Rendering using Anime Character Sheets},
|
118 |
+
author={Lin, Zuzeng and Huang, Ailin and Huang, Zhewei and Hu, Chen and Zhou, Shuchang},
|
119 |
+
journal={arXiv preprint arXiv:2207.05378},
|
120 |
+
year={2022}
|
121 |
+
}
|
122 |
+
```
|
123 |
+
|