Commit c8c37dbd authored by 0x3f3f3f3fun's avatar 0x3f3f3f3fun
Browse files

upload models to BaiduNetdisk

parent c98fd062
......@@ -79,12 +79,12 @@ pip install -r requirements.txt
## <a name="pretrained_models"></a>:dna:Pretrained Models
| Model Name | Description |
| :--------- | :---------- |
| [general_swinir_v1.ckpt](https://huggingface.co/lxq007/DiffBIR/resolve/main/general_swinir_v1.ckpt) | Stage1 model (SwinIR) for general image restoration. |
| [general_full_v1.ckpt](https://huggingface.co/lxq007/DiffBIR/resolve/main/general_full_v1.ckpt) | Full model for general image restoration. "Full" means it contains both the stage1 and stage2 model. |
| [face_swinir_v1.ckpt](https://huggingface.co/lxq007/DiffBIR/resolve/main/face_swinir_v1.ckpt) | Stage1 model (SwinIR) for face restoration. |
| [face_full_v1.ckpt](https://huggingface.co/lxq007/DiffBIR/resolve/main/face_full_v1.ckpt) | Full model for face restoration. |
| Model Name | Description | HuggingFace | BaiduNetdisk |
| :--------- | :---------- | :---------- | :---------- |
| general_swinir_v1.ckpt | Stage1 model (SwinIR) for general image restoration. | [download](https://huggingface.co/lxq007/DiffBIR/resolve/main/general_swinir_v1.ckpt) | [download](https://pan.baidu.com/s/1uvSvJgcoL_Knj0h22-9TvA?pwd=v3v6) (pwd: v3v6) |
| general_full_v1.ckpt | Full model for general image restoration. "Full" means it contains both the stage1 and stage2 model. | [download](https://huggingface.co/lxq007/DiffBIR/resolve/main/general_full_v1.ckpt) | [download](https://pan.baidu.com/s/1gLvW1nvkJStdVAKROqaYaA?pwd=86zi) (pwd: 86zi) |
| face_swinir_v1.ckpt | Stage1 model (SwinIR) for face restoration. | [download](https://huggingface.co/lxq007/DiffBIR/resolve/main/face_swinir_v1.ckpt) | [download](https://pan.baidu.com/s/1cnBBC8437BJiM3q6suaK8g?pwd=xk5u) (pwd: xk5u) |
| face_full_v1.ckpt | Full model for face restoration. | [download](https://huggingface.co/lxq007/DiffBIR/resolve/main/face_full_v1.ckpt) | [download](https://pan.baidu.com/s/1pc04xvQybkynRfzK5Y8K0Q?pwd=ov8i) (pwd: ov8i) |
## <a name="quick_start"></a>:flight_departure:Quick Start
......
......@@ -38,7 +38,7 @@ def process(
control_imgs (List[np.ndarray]): A list of low-quality images (HWC, RGB, range in [0, 255])
sampler (str): Sampler name.
steps (int): Sampling steps.
strength (float): Control strength. Set to 1.0 during traning.
strength (float): Control strength. Set to 1.0 during training.
color_fix_type (str): Type of color correction for samples.
disable_preprocess_model (bool): If specified, preprocess model (SwinIR) will not be used.
......@@ -150,6 +150,7 @@ def main() -> None:
assert os.path.isdir(args.input)
print(f"sampling {args.steps} steps using {args.sampler} sampler")
with torch.autocast(device):
for file_path in list_image_files(args.input, follow_links=True):
lq = Image.open(file_path).convert("RGB")
if args.sr_scale != 1:
......@@ -207,6 +208,5 @@ def main() -> None:
Image.fromarray(pred).save(save_path)
print(f"save to {save_path}")
if __name__ == "__main__":
main()
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