sczhou commited on
Commit
12cfcfc
·
1 Parent(s): d690322

update README.md.

Browse files
Files changed (2) hide show
  1. README.md +2 -4
  2. inference_codeformer.py +2 -3
README.md CHANGED
@@ -64,14 +64,12 @@ python basicsr/setup.py develop
64
  ### Quick Inference
65
 
66
  ##### Download Pre-trained Models:
67
- 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.
68
- You can download by run the following command OR manually download the pretrained models.
69
  ```
70
  python scripts/download_pretrained_models.py facelib
71
  ```
72
 
73
- 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.
74
- You can download by run the following command OR manually download the pretrained models.
75
  ```
76
  python scripts/download_pretrained_models.py CodeFormer
77
  ```
 
64
  ### Quick Inference
65
 
66
  ##### Download Pre-trained Models:
67
+ 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.
 
68
  ```
69
  python scripts/download_pretrained_models.py facelib
70
  ```
71
 
72
+ 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.
 
73
  ```
74
  python scripts/download_pretrained_models.py CodeFormer
75
  ```
inference_codeformer.py CHANGED
@@ -64,6 +64,7 @@ if __name__ == '__main__':
64
  net.load_state_dict(checkpoint)
65
  net.eval()
66
 
 
67
  # large det_model: 'YOLOv5l', 'retinaface_resnet50'
68
  # small det_model: 'YOLOv5n', 'retinaface_mobile0.25'
69
  face_helper = FaceRestoreHelper(
@@ -75,9 +76,7 @@ if __name__ == '__main__':
75
  use_parse=True,
76
  device=device)
77
 
78
-
79
- # face_helper.init_dlib(args.detection_path, args.landmark5_path, args.landmark68_path)
80
-
81
  # scan all the jpg and png images
82
  for img_path in sorted(glob.glob(os.path.join(args.test_path, '*.[jp][pn]g'))):
83
  # clean all the intermediate results to process the next image
 
64
  net.load_state_dict(checkpoint)
65
  net.eval()
66
 
67
+ # ------------------ set up FaceRestoreHelper -------------------
68
  # large det_model: 'YOLOv5l', 'retinaface_resnet50'
69
  # small det_model: 'YOLOv5n', 'retinaface_mobile0.25'
70
  face_helper = FaceRestoreHelper(
 
76
  use_parse=True,
77
  device=device)
78
 
79
+ # -------------------- start to processing ---------------------
 
 
80
  # scan all the jpg and png images
81
  for img_path in sorted(glob.glob(os.path.join(args.test_path, '*.[jp][pn]g'))):
82
  # clean all the intermediate results to process the next image