Commit 235956da authored by mashun1's avatar mashun1
Browse files

Update README.md

parent 9097fc58
......@@ -84,6 +84,27 @@
注意:原始数据为`1024x1024`需要处理为`512x512`,可运行`data_process.py`对数据进行处理。
## 训练
### 阶段一 - 训练VQGAN
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4321 basicsr/train.py -opt options/VQGAN_512_ds32_nearest_stage1.yml --launcher pytorch
获取训练数据的码本序列,可以加速后续训练
python scripts/generate_latent_gt.py
### 阶段二 - 训练Transformer (w = 0)
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4322 basicsr/train.py -opt options/CodeFormer_stage2.yml --launcher pytorch
### 阶段三 - 训练可控特征Transformer (w = 1)
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4323 basicsr/train.py -opt options/CodeFormer_stage3.yml --launcher pytorch
注意:`vqgan``net_g_xxx.pth``net_d`为第一阶段生成。
## 推理
### 模型下载
......@@ -150,28 +171,6 @@ Github:https://github.com/sczhou/CodeFormer/releases/tag/v0.1.0
# (check out the examples in inputs/masked_faces)
python inference_inpainting.py --input_path [image folder]|[image path]
## 训练
### 阶段一 - 训练VQGAN
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4321 basicsr/train.py -opt options/VQGAN_512_ds32_nearest_stage1.yml --launcher pytorch
获取训练数据的码本序列,可以加速后续训练
python scripts/generate_latent_gt.py
### 阶段二 - 训练Transformer (w = 0)
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4322 basicsr/train.py -opt options/CodeFormer_stage2.yml --launcher pytorch
### 阶段三 - 训练可控特征Transformer (w = 1)
python -m torch.distributed.launch --nproc_per_node=8 --master_port=4323 basicsr/train.py -opt options/CodeFormer_stage3.yml --launcher pytorch
注意:`vqgan``net_g_xxx.pth``net_d`为第一阶段生成。
## result
![Alt text](readme_images/image-3.png)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment