From 12cfcfc92e26df7d6f82ce4611780437a4d5d493 Mon Sep 17 00:00:00 2001 From: sczhou Date: Sun, 7 Aug 2022 17:24:08 +0800 Subject: [PATCH] update README.md. --- README.md | 6 ++---- inference_codeformer.py | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6c996ff8..b3d50d54 100644 --- a/README.md +++ b/README.md @@ -64,14 +64,12 @@ python basicsr/setup.py develop ### Quick Inference ##### Download Pre-trained Models: -Download the facelib pretrained models from [[Google Drive](https://drive.google.com/drive/folders/1b_3qwrzY_kTQh0-SnBoGBgOrJ_PLZSKm?usp=sharing) | [OneDrive](https://entuedu-my.sharepoint.com/:f:/g/personal/s200094_e_ntu_edu_sg/EvDxR7FcAbZMp_MA9ouq7aQB8XTppMb3-T0uGZ_2anI2mg?e=DXsJFo)] to the `weights/facelib` folder. -You can download by run the following command OR manually download the pretrained models. +Download the facelib pretrained models from [[Google Drive](https://drive.google.com/drive/folders/1b_3qwrzY_kTQh0-SnBoGBgOrJ_PLZSKm?usp=sharing) | [OneDrive](https://entuedu-my.sharepoint.com/:f:/g/personal/s200094_e_ntu_edu_sg/EvDxR7FcAbZMp_MA9ouq7aQB8XTppMb3-T0uGZ_2anI2mg?e=DXsJFo)] to the `weights/facelib` folder. You can manually download the pretrained models OR download by runing the following command. ``` python scripts/download_pretrained_models.py facelib ``` -Download the CodeFormer pretrained models from [[Google Drive](https://drive.google.com/drive/folders/1CNNByjHDFt0b95q54yMVp6Ifo5iuU6QS?usp=sharing) | [OneDrive](https://entuedu-my.sharepoint.com/:f:/g/personal/s200094_e_ntu_edu_sg/EoKFj4wo8cdIn2-TY2IV6CYBhZ0pIG4kUOeHdPR_A5nlbg?e=AO8UN9)] to the `weights/CodeFormer` folder. -You can download by run the following command OR manually download the pretrained models. +Download the CodeFormer pretrained models from [[Google Drive](https://drive.google.com/drive/folders/1CNNByjHDFt0b95q54yMVp6Ifo5iuU6QS?usp=sharing) | [OneDrive](https://entuedu-my.sharepoint.com/:f:/g/personal/s200094_e_ntu_edu_sg/EoKFj4wo8cdIn2-TY2IV6CYBhZ0pIG4kUOeHdPR_A5nlbg?e=AO8UN9)] to the `weights/CodeFormer` folder. You can manually download the pretrained models OR download by runing the following command. ``` python scripts/download_pretrained_models.py CodeFormer ``` diff --git a/inference_codeformer.py b/inference_codeformer.py index 94f48a56..65ae10e0 100644 --- a/inference_codeformer.py +++ b/inference_codeformer.py @@ -64,6 +64,7 @@ net.load_state_dict(checkpoint) net.eval() + # ------------------ set up FaceRestoreHelper ------------------- # large det_model: 'YOLOv5l', 'retinaface_resnet50' # small det_model: 'YOLOv5n', 'retinaface_mobile0.25' face_helper = FaceRestoreHelper( @@ -75,9 +76,7 @@ use_parse=True, device=device) - - # face_helper.init_dlib(args.detection_path, args.landmark5_path, args.landmark68_path) - + # -------------------- start to processing --------------------- # scan all the jpg and png images for img_path in sorted(glob.glob(os.path.join(args.test_path, '*.[jp][pn]g'))): # clean all the intermediate results to process the next image