FaceRestoreHelper #43

Closed
opened 2026-01-29 21:39:12 +00:00 by claunia · 2 comments
Owner

Originally created by @Roenbaeck on GitHub (Aug 6, 2021).

I get the following error with the latest version:

Traceback (most recent call last):
  File "inference_gfpgan_full.py", line 132, in <module>
    face_helper = FaceRestoreHelper(
TypeError: __init__() got an unexpected keyword argument 'device'

Removing the device parameter in the call to FaceRestoreHelper solved my problem. The call in inference_gfpgan_full.py then becomes:

    # initialize face helper
    face_helper = FaceRestoreHelper(
        args.upscale_factor,
        face_size=512,
        crop_ratio=(1, 1),
        det_model='retinaface_resnet50',
        save_ext='png')
Originally created by @Roenbaeck on GitHub (Aug 6, 2021). I get the following error with the latest version: ``` Traceback (most recent call last): File "inference_gfpgan_full.py", line 132, in <module> face_helper = FaceRestoreHelper( TypeError: __init__() got an unexpected keyword argument 'device' ``` Removing the `device` parameter in the call to `FaceRestoreHelper` solved my problem. The call in inference_gfpgan_full.py then becomes: ``` # initialize face helper face_helper = FaceRestoreHelper( args.upscale_factor, face_size=512, crop_ratio=(1, 1), det_model='retinaface_resnet50', save_ext='png') ```
Author
Owner

@woctezuma commented on GitHub (Aug 6, 2021):

The bug was introduced in this commit: 7f67e12999

However, this argument should be supported: e371b8c3ad/facexlib/utils/face_restoration_helper.py (L46-L57)
thanks to this more recent commit: e371b8c3ad

So, I guess it is a simple mismatch of versions.

@woctezuma commented on GitHub (Aug 6, 2021): The bug was introduced in this commit: https://github.com/TencentARC/GFPGAN/commit/7f67e12999de9282bc14de4d3afeee138106b6f5 However, this argument should be supported: https://github.com/xinntao/facexlib/blob/e371b8c3ad56bbd7b6ca12a5c0f471192ad31cc2/facexlib/utils/face_restoration_helper.py#L46-L57 thanks to this more recent commit: https://github.com/xinntao/facexlib/commit/e371b8c3ad56bbd7b6ca12a5c0f471192ad31cc2 So, I guess it is a simple mismatch of versions.
Author
Owner

@xinntao commented on GitHub (Aug 6, 2021):

you need to update the facexlib version to 0.2.0.1

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Lars Rönnbäck @.>
Sent: Saturday, August 7, 2021 2:10:44 AM
To: TencentARC/GFPGAN @.
>
Cc: Subscribed @.***>
Subject: [TencentARC/GFPGAN] FaceRestoreHelper (#35)

I get the following error with the latest version:

Traceback (most recent call last):
File "inference_gfpgan_full.py", line 132, in
face_helper = FaceRestoreHelper(
TypeError: init() got an unexpected keyword argument 'device'

Removing the device parameter in the call to FaceRestoreHelper solved my problem. The call in inference_gfpgan_full.py then becomes:

# initialize face helper
face_helper = FaceRestoreHelper(
    args.upscale_factor,
    face_size=512,
    crop_ratio=(1, 1),
    det_model='retinaface_resnet50',
    save_ext='png')


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHubhttps://github.com/TencentARC/GFPGAN/issues/35, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEFDHVYJQRPFW4MGWVTG2PDT3QQSJANCNFSM5BWLYIPQ.

@xinntao commented on GitHub (Aug 6, 2021): you need to update the facexlib version to 0.2.0.1 Get Outlook for Android<https://aka.ms/AAb9ysg> ________________________________ From: Lars Rönnbäck ***@***.***> Sent: Saturday, August 7, 2021 2:10:44 AM To: TencentARC/GFPGAN ***@***.***> Cc: Subscribed ***@***.***> Subject: [TencentARC/GFPGAN] FaceRestoreHelper (#35) I get the following error with the latest version: Traceback (most recent call last): File "inference_gfpgan_full.py", line 132, in <module> face_helper = FaceRestoreHelper( TypeError: __init__() got an unexpected keyword argument 'device' Removing the device parameter in the call to FaceRestoreHelper solved my problem. The call in inference_gfpgan_full.py then becomes: # initialize face helper face_helper = FaceRestoreHelper( args.upscale_factor, face_size=512, crop_ratio=(1, 1), det_model='retinaface_resnet50', save_ext='png') — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub<https://github.com/TencentARC/GFPGAN/issues/35>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEFDHVYJQRPFW4MGWVTG2PDT3QQSJANCNFSM5BWLYIPQ>.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#43