xinntao / Real-ESRGAN

Real-ESRGAN aims at developing Practical Algorithms for General Image/Video Restoration.
BSD 3-Clause "New" or "Revised" License
27.94k stars 3.51k forks source link

What is the correct file to use for fine-tuning? #283

Open leppie opened 2 years ago

leppie commented 2 years ago

The docs say download ESRGAN

https://github.com/xinntao/Real-ESRGAN/blob/9ff1944d06e9d7fe86c68bbf1a244cff403f064e/Training.md?plain=1#L179 https://github.com/xinntao/Real-ESRGAN/blob/9ff1944d06e9d7fe86c68bbf1a244cff403f064e/Training.md?plain=1#L236

But the file refers to ESRNet

https://github.com/xinntao/Real-ESRGAN/blob/9ff1944d06e9d7fe86c68bbf1a244cff403f064e/options/finetune_realesrgan_x4plus.yml#L102

Is fine-tuning also a 2 stage process like training?

Gardlin commented 2 years ago

Hi , I have met the same problem with you, have you solved it?

MattiaMartinelliGeo commented 2 years ago

I have the same issue, did you find a solution?

airogachev commented 2 years ago

Any solution so far?

baioccofederico commented 2 years ago

Same here

ZhengtianZhu commented 2 years ago

maybe we need to start from the train part as there is a part called Train Real-ESRNet the following website is written by Chinese, you can just translate it to read. https://github.com/xinntao/Real-ESRGAN/issues/37

cliffordkleinsr commented 2 years ago

You can use any model for finetuning, so long as it uses an RRDB architecture, for me I used RealESRGAX4.pth for finetuning

marcobarbierato commented 6 months ago

It's been a while and cliffordkleinsr has basically already answered but since I struggled with those comments too I'll chime in.

It's very likely that those finetuning yml files were copy pasted from the training files, so the comments are the same, but as you said if you follow the finetuning RealESRGAN guide in the docs, it tells you to download RealESRGAN_x4plus.pth (and the discriminator). You can put this file in the pretrain_network_g option in the yml, and it will load RealESRGAN so you won't have to train it from 'scratch'. There is no 2-stage process, you can fine tune right away.