twhui / srgan-pytorch Goto Github PK
View Code? Open in Web Editor NEWAn Unofficial PyTorch Implementation for Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
An Unofficial PyTorch Implementation for Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
Hello twhui,
I would like to perform a test phase on the SGRAN.
I downloaded the SGRAN pretrained model at your link : https://drive.google.com/file/d/1vAtPLGbdyt--SZQxUl0YKPRQgu6-kR6v/view, and set il all up on my local env.
While reading the README, i was sure that the bench support testing for SGRAN
but when I inspect the sources, my understanding is that "test mode" is only available
for SRResNet.
In model.py below, It is clear that sr_gan is only loaded for "training mode" , isn't it :
def create_model(opt):
if opt.model == 'sr_resnet':
from .sr_resnet_model import SRResNetModel
model = SRResNetModel()
elif opt.model == 'sr_resnet_test':
from .sr_resnet_test_model import SRResNetTestModel
model = SRResNetTestModel()
elif opt.model == 'sr_gan':
from .sr_gan_model import SRGANModel
model = SRGANModel()
else:
raise NotImplementedError('Model [%s] not recognized.' % opt.model)
model.initialize(opt)
print('Model [%s] is created.' % model.name())
return model
In addition, when I execute the cmd below, I got a crash that tells me again that test mode is not supported got SRGAN :
CUDA_VISIBLE_DEVICES=0 python ./test.py --option ./options/test/SRGAN_x4.json
Traceback (most recent call last):
File "./test.py", line 45, in <module>
model = create_model(opt)
File "/home/dgerin/SRGAN-PyTorch/models/models.py", line 17, in create_model
model.initialize(opt)
File "/home/dgerin/SRGAN-PyTorch/models/sr_gan_model.py", line 20, in initialize
assert opt.is_train
Could you give more information about that ?
Thanks,
Dimitri
Hello twhui,
I would like to train my SRGAN using your code. And the pretrained model you provided have a great performance during testing, so can you tell me the batchsize , epochs, traing time and machine configuration of your pretrained model, thank you very much.
Hi,
I guess there may be some problem with the comment in this line.
If the input range is [-1, 1], the mean will be:
# [2*0.485-1, 2*0.456-1, 2*0.406-1]
rather than:
# [0.485-1, 0.456-1, 0.406-1]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.