Keras-SRGAN icon indicating copy to clipboard operation
Keras-SRGAN copied to clipboard

output is plain images

Open KoteshwarSurga opened this issue 5 years ago • 9 comments

Hi,

I am testing your code on some low resolution images(blur) but the output receiving is plain images.

can u please help me.

KoteshwarSurga avatar Jun 11 '19 10:06 KoteshwarSurga

Hi,

Are you using my trained model? Can you tell me what images you are using. And please send me detailed process how you are using my model.

deepak112 avatar Jun 12 '19 06:06 deepak112

Hi, Thanks for your reply

I am using your model which is in model folder and I run the test.py code using pretrained model. The input images are The output images are so I am getting the plain output.

On Wed, Jun 12, 2019 at 12:28 PM Deepak Birla [email protected] wrote:

Hi,

Are you using my trained model? Can you tell me what images you are using. And please send me detailed process how you are using my model.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/deepak112/Keras-SRGAN/issues/12?email_source=notifications&email_token=AKWA6GMTZAUGDENJPKVKXQDP2CNCZA5CNFSM4HW43TC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXPOFEA#issuecomment-501146256, or mute the thread https://github.com/notifications/unsubscribe-auth/AKWA6GKWL4WWPL7YA6QJHETP2CNCZANCNFSM4HW43TCQ .

KoteshwarSurga avatar Jun 12 '19 08:06 KoteshwarSurga

Hi I am using your pre-trained model. Even if I am changing the image size still it is taking (96,96,3) and giving an error on mismatch.

souradip-chakraborty avatar Jun 13 '19 19:06 souradip-chakraborty

Hi: Trained on 500 images on 320x320 with 4x downsample png files

Using the test.py with the low res input (80x80) I'm getting an entirely white image.

python test.py --input_low_res=../../CompareGANs/shipsnet/Raw/ship/ --output_dir=../../CompareGANs/shipsnet/SRs/agriculture/ships\ SR/ --model_dir='./model/argriculture/gen_model5000.h5' --number_of_images=1000 --test_type='test_lr_images

This is the "best" image I got back: high_res_result_image_269

When using the test.py with the high res input it works fine. python test.py -ihr=../../CompareGANs/skysat/cities/ --output_dir=../../CompareGANs/shipsnet/SRs/agriculture/ships\ SR/ --model_dir='./model/argriculture/gen_model5000.h5' --number_of_images=500 --test_type='test_model'

mrciolino avatar Aug 28 '19 21:08 mrciolino

I changed the lr_images (in Utils.py) scale form 4 to 1 since the input wants 80x80 for low res instead of downsampling my already low res 80x80 images to 20x20

def load_test_data(directory, ext, number_of_images = 100):

    files = load_data_from_dirs(load_path(directory), ext)

    if len(files) < number_of_images:
        print("Number of image files are less then you specified")
        print("Please reduce number of images to %d" % len(files))
        sys.exit()
    
    x_test_lr = lr_images(files, 1)
    x_test_lr = normalize(x_test_lr)

return x_test_lr

mrciolino avatar Aug 28 '19 21:08 mrciolino

FIxed: On line ~221 the LR images were being "denormalized" when they didn't need to be.

image_batch_lr = denormalize(x_test_lr)

to

image_batch_lr = x_test_lr

Output is now: high_res_result_image_2

mrciolino avatar Aug 29 '19 14:08 mrciolino

@KoteshwarSurga I know this is an old thread but did that fix ur problem?

mrciolino avatar Aug 29 '19 14:08 mrciolino

Please all, I need the code of implementation this part the part is

{The SRResNet networks were trained with a learning rate of 10−4 and 106 update iterations. We employed the trained MSE-based SRResNet network as initialization for the generator when training the actual GAN to avoid undesired local optima.{

BassantTolba1234 avatar Nov 28 '20 09:11 BassantTolba1234

Please all, I need the code of implementation this part the part is

{The SRResNet networks were trained with a learning rate of 10−4 and 106 update iterations. We employed the trained MSE-based SRResNet network as initialization for the generator when training the actual GAN to avoid undesired local optima.{

BassantTolba1234 avatar Nov 28 '20 09:11 BassantTolba1234