brade31919 / SRGAN-tensorflow

Tensorflow implementation of the SRGAN algorithm for single image super-resolution
MIT License
848 stars 282 forks source link

Some png image didn't work well #17

Open Jean332 opened 6 years ago

Jean332 commented 6 years ago

First of all,thanks for your model! And there is a question:when I use my own png image,I found it didn't work as well as the default image,I thought maybe it related with the png's format,I found there are png-8(index),png-24(rgb),I converted to both of them,but still the same,do you know how to convert a picture with other format into a useable png image?

brade31919 commented 6 years ago

Hi @Jean332 , I did not try my model on many different formats. I simply convert my training data to PNG by using imagemagick on Ubuntu 16.04 XD There are many different factors that affect the final output of the model. For example, if the pictures introduce large domain shifts, (e.g. images with the contents that are quite different from the training data) then the model's performance may become disappointing. Moreover, the format does somehow affect the performance because the training data are all high-quality landscape images, and images with artifacts such as jpg compression, etc may result in bad outputs. You can try different training datasets to improve the performance on certain subsets of images. For example, it is reasonable that the model does not perform well on CG images. Then collecting a larger datasets containing CG images and the original RAISE dataset may help.

ares89 commented 6 years ago

@Jean332 @brade31919 in the model.py https://github.com/brade31919/SRGAN-tensorflow/blob/2e3766a273caae19ecce99afa01a77b5402b6faf/lib/model.py#L199

modify im = sic.imread(name).astype(np.float32) to im = sic.imread(name,mode="RGB").astype(np.float32) to fix the problem.

that is because some png file has an alpha channel.