TencentARC / GFPGAN

GFPGAN aims at developing Practical Algorithms for Real-world Face Restoration.
Other
35.9k stars 5.95k forks source link

Allow to define model_rootpath for FaceRestoreHelper #399

Open henryruhs opened 1 year ago

henryruhs commented 1 year ago

Hey, it would be great if all weights could be stored in one directory or set to None:

gfpgan.GFPGANer(
    model_path='weights/GFPGANv1.3.pth',
    model_rootpath='weights'
)

Related code that enforces gfpgan/weights:

self.face_helper = FaceRestoreHelper(
    upscale,
    face_size=512,
    crop_ratio=(1, 1),
    det_model='retinaface_resnet50',
    save_ext='png',
    use_parse=True,
    device=self.device,
    model_rootpath='gfpgan/weights'
)

General speaking, think about giving more control over the FaceRestoreHelper instance.

hungtooc commented 1 year ago

need to fix this bug soon

henryruhs commented 1 year ago

@hungtooc Check https://github.com/harisreedhar/Face-Upscalers-ONNX ... models can be downloaded under releases