tensorlayer / SRGAN

Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network
https://github.com/tensorlayer/tensorlayerx
3.29k stars 810 forks source link

jpeg image quality enhancement #208

Open Erfun76 opened 4 years ago

Erfun76 commented 4 years ago

I'm going to enhance the quality of images compressed with JPEG format, what is the best way for loading my data? you take high-quality images and resize them to low quality with code:

def _map_fn_train(img):
    hr_patch = tf.image.random_crop(img, [384, 384, 3])
    hr_patch = hr_patch / (255. / 2.)
    hr_patch = hr_patch - 1.
    hr_patch = tf.image.random_flip_left_right(hr_patch)
    lr_patch = tf.image.resize(hr_patch, size=[96, 96])
    return lr_patch, hr_patch