Skip to content

Commit

Permalink
add device to GFPGANer for multiGPU support
Browse files Browse the repository at this point in the history
  • Loading branch information
xinntao committed May 4, 2022
1 parent 924ce47 commit bc3f0c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gfpgan/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ class GFPGANer():
bg_upsampler (nn.Module): The upsampler for the background. Default: None.
"""

def __init__(self, model_path, upscale=2, arch='clean', channel_multiplier=2, bg_upsampler=None):

This comment has been minimized.

Copy link
@hassanmalik007

This comment has been minimized.

Copy link
@AminurStudio2

AminurStudio2 Feb 2, 2024

Very nice

This comment has been minimized.

Copy link
@mogammedmizan

mogammedmizan Mar 14, 2024

Very nice

Vbg

Bnf

def __init__(self, model_path, upscale=2, arch='clean', channel_multiplier=2, bg_upsampler=None, device=None):

This comment has been minimized.

Copy link
@hassanmalik007
self.upscale = upscale
self.bg_upsampler = bg_upsampler

# initialize model
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

This comment has been minimized.

Copy link
@hassanmalik007
self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') if device is None else device

This comment has been minimized.

Copy link
@hassanmalik007
# initialize the GFP-GAN
if arch == 'clean':
self.gfpgan = GFPGANv1Clean(
Expand Down

2 comments on commit bc3f0c4

@hassanmalik007
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img20221219_12323995

@hassanmalik007
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

img20221219_12323995

Please sign in to comment.