nagadomi / waifu2x

Image Super-Resolution for Anime-Style Art
http://waifu2x.udp.jp/
MIT License
27.45k stars 2.71k forks source link

[Question] Is it possible to freely scale? example: 2.5x, 3.0x, 4.1x etc. #118

Open magiruuvelvet opened 8 years ago

magiruuvelvet commented 8 years ago

Hi nagadomi

I've a question about scaling. But before I begin: I finally resolved the CUDA issues on my machine and I can finally use your version and it's so much faster :) | this was my issue i opened long time ago #77 I used this alternative before, you suggested long time ago -> tanakamura's waifu2x c++/opencv In this version you could specify any scaling factor you wanted, as long as it was above 1.0, like 1.1, 1.3, 2.0, 2.42, 4.32 and so on... The scaling works normally, without any quality regressions or anything. In your version I noticed that this is not possible and I just get a file not found exception, because it wants to open a model named after the scaling factor :(

The question I have now: Does your version explicitly needs a model for every scaling factor or is there a workaround.

If I need extra models, how exactly I can train one? What pictures are the best to use for model training? I really miss some factors I use on a regular basis, which are: 2.5, 3.0, 4.0, 1.5, 1.7

Regards

nagadomi commented 8 years ago

In fact, waifu2x supports only 2x scaling. optional scaling factor in the other software is implemented by the following steps.

  1. Repeatedly applying 2x model until sufficient size is reached
  2. Downscaling the image to fit a specified size with a generic image resizer (e.g bilinear, bicubic)

Currently, waifu2x.lua does not support this feature.

magiruuvelvet commented 8 years ago

I see. In this case the best solution for me would be to write a wrapper script around waifu2x with the help of imagemagick or something to implement optimal scaling factors. I will look into this in my free time, i really miss the possibility to freely scale. Anyways, thanks for the info :)