Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - Even better image upscaling with Waifu2x

#1
Even better image upscaling with Waifu2x

You may have already seen the article here in the Magazine about upscaling bitmap images with better quality. That article covered a few utilities to achieve good results, but there’s always room for enhancement. Meet Waifu2x, a sophisticated tool that uses deep convolutional neural networks, or machine learning for short. Therefore it benefits from trained model data sets. Read on to see how well it performs to upscale your images, and how to get the same benefits even without an Nvidia card.

Here are some examples. First, a character that will be familiar to Fedora fans:

Making the Beefy Miracle hot dog four times larger keeps it nearly perfect!

Here’s another example:

Upscaling a drawing from an old book delivers really outstanding results.

Because Waifu2x performs the calculations using Nvidia CUDA computing platform, it requires an Nvidia graphics card. This article, however, covers a more portable version called Waifu2x-converter-cpp that runs everywhere.

Waifu2x-converter-cpp doesn’t require a dedicated Nvidia GPU. Instead, it leverages the OpenCV and OpenCL libraries. Although the overall performance is slower compared to the original code, it’s portable and more people are able to use it. And of course it runs on Fedora!

Follow the directions below to give it a spin.

Installing Waifu2x-converter-cpp in Fedora


To build the application from source, first install build dependencies:

sudo dnf install -y gcc-c++ cmake opencv-devel opencl-utils-devel

Then grab the source code, build it and install the files:

git clone https://github.com/DeadSix27/waifu2x-converter-cpp.git cd waifu2x-converter-cpp/build cmake -DLIB_SUFFIX=64 ../ make sudo make install

Tell the dynamic library linker to index the directory with locally installed libraries:

sudo ldconfig /usr/local/lib64

Now everything is ready for upscaling. The example command for processing an image is as follows:

waifu2x-converter-cpp --scale_ratio 2 -i /path/to/input_file -o /path/to/output_file

Don’t miss this very helpful command for extras, such as switching OpenCL on/off, playing with noise level, and so on:

waifu2x-converter-cpp --help

Using a graphical front-end for Waifu2x


Another step forward is to install Qtwaifu2x, a graphical tool that lets you escape Fedora terminal and process images with comfort and convenience.

Practically all you have to do is hit Browse and Start to launch the upscaling task.

Installing Qtwaifu2x in Fedora


First, install the main build dependency:

sudo dnf install -y qt5-qtbase-devel

Then get the code and build it:

git clone https://github.com/cmdrkotori/qtwaifu2x.git cd qtwaifu2x qmake-qt5 && make

To run the application from the current directory:

./qtwaifu2x

The main window has quite a few options, but it’s usually enough to provide the input file and hit the Start button.

Brew yourself a cup of tea and come back in a while to enjoy the perfectly upscaled image!

Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - Fedora job opening: Fedora Community Action and Impact Coordinator (FCAIC) xSicKxBot 0 1,675 07-11-2019, 10:39 AM
Last Post: xSicKxBot
  Fedora - Contribute at the Fedora Test Day for Fedora Modularity xSicKxBot 0 1,821 03-28-2019, 11:12 PM
Last Post: xSicKxBot
  Fedora - Design faster web pages, part 2: Image replacement xSicKxBot 0 1,799 10-18-2018, 10:14 AM
Last Post: xSicKxBot
  Fedora - Design faster web pages, part 1: Image compression xSicKxBot 0 1,709 10-11-2018, 06:12 AM
Last Post: xSicKxBot
  Fedora - Image creation applications for Fedora xSicKxBot 0 1,738 08-10-2018, 10:15 PM
Last Post: xSicKxBot

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016