Giter Club home page Giter Club logo

gfpgan-1024's Introduction

Hi there 👋

I am Leslie from China, nice to meet you all!

  • 😄 Interst: computer vision especially Image generation

  • 📫 How to reach me: send email to [email protected]

Leslie's GitHub stats

Top Langs

gfpgan-1024's People

Contributors

lesliezhoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gfpgan-1024's Issues

I can't download the file d.pth

your instructions say:

...
7. get discriminator here which is transformed from original stylegan2
...

I can't download the file: d.pth (404 error)
fix the link

about the training details

Thank you for your work; I've found the results to be significantly better than those from GFPGAN 1.4. I am attempting to reproduce your results but have noticed some discrepancies.

In config.py, should self.crop_components = False actually be set to self.crop_components = True?
Regarding the instruction "train until you think it is okay," how can I be certain that it is indeed okay?

Support batch_size ?

Thank you for your great work. The current image input does not support batch_size (infer), can you support it?


感谢您杰出的工作,当前图片输入不支持 batch_size (推理),你能支持它吗?

How to download pth file

Hi please help me get link download list pth file:
self.scratch_d_path = 'pretrained_models/d.pth'
self.scratch_left_eye_path = 'pretrained_models/GFPGANv1_net_d_left_eye.pth'
self.scratch_right_eye_path = 'pretrained_models/GFPGANv1_net_d_right_eye.pth'
self.scratch_mouth_path = 'pretrained_models/GFPGANv1_net_d_mouth.pth'
thank you

Loss exploded on stage 2

Hi, I have been trying to train ffhqr at 1024 x 1024 resolution. Here are the changes in my config file. I am using ffhq as low-quality images.

class Params:
    def __init__(self):
       
        self.name = 'GFPGAN'
        self.mode = 'encoder'
        self.pretrain_path = 'GFPGAN-1024/checkpoint/GFPGAN/decoder/001-00027000.pth'
        self.scratch_gan_path = 'pretrained_models/GFPGANv1.4.pth'
        self.scratch_d_path = 'pretrained_models/GFPGANv1_net_d.pth'
        self.scratch_left_eye_path = 'pretrained_models/GFPGANv1_net_d_left_eye.pth'
        self.scratch_right_eye_path = 'pretrained_models/GFPGANv1_net_d_right_eye.pth'
        self.scratch_mouth_path = 'pretrained_models/GFPGANv1_net_d_mouth.pth'
        self.id_model = 'pretrained_models/arcface_resnet18.pth'
        self.img_root = "output/train/ffhqr" 
        self.train_hq_root = "output/train/ffhqr" 
        self.train_lq_root = 'output/train/ffhq'
        self.train_lmk_base = '' # lmk info
        self.val_lmk_base = ''
        self.val_lq_root = 'output/val/ffhq'
        self.val_hq_root = 'output/val/ffhqr'
        self.g_lr = 1e-3

I have commented out lines 210 to 228 in dataloader/GFPLoader.py since I provide low-quality images, I did not need to produce them.

# ------------------------ generate lq image ------------------------ #
        # blur
        '''
        if not self.eval:
            kernel = degradations.random_mixed_kernels(
                self.kernel_list,
                self.kernel_prob,
                self.blur_kernel_size,
                self.blur_sigma,
                self.blur_sigma, [-math.pi, math.pi],
                noise_range=None)
            
            img_lq = cv2.filter2D(img_lq, -1, kernel)
            # downsample
            scale = np.random.uniform(self.downsample_range[0], self.downsample_range[1])
            img_lq = cv2.resize(img_lq, (int(w // scale), int(h // scale)), interpolation=cv2.INTER_LINEAR)
            # # noise
            if self.noise_range is not None:
                img_lq = degradations.random_add_gaussian_noise(img_lq, self.noise_range)
            # jpeg compression
            if self.jpeg_range is not None:
                img_lq = degradations.random_add_jpg_compression(img_lq, self.jpeg_range)

        '''
        # resize to original size
        img_lq = cv2.resize(img_lq, (512, 512), interpolation=cv2.INTER_LINEAR)
        img_hq = cv2.resize(img_hq, (1024, 1024))

Why img_lq is resized to 512x512 because I want to train on ffhq @ 1024x1024 to produce ffhqr 1024x1024?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.