Coder Social home page Coder Social logo

waifu2x-ocl's Introduction

waifu2x-ocl

Fast waifu2x converter with GPU optimization. Using OpenCL.

Platform

  • Linux with OpenCL
  • macOS with OpenCL
  • Windows with OpenCL

Download

  • You can download this program from here.

How to build on macOS

$ make

How to build on Linux

$ make

How to build on Windows

  1. Installing OpenCL
  1. Including OpenCL in the Project
  • In the ‘Additional Include Directories’ field in ‘VC++ Directories’ add the following information depending on your graphics card.
  • nVidia: - “$(CUDA_INC_PATH)”
  • AMD: - “$(AMDAPPSDKROOT)\include”
  • Intel: - “C:\Intel\OpenCL\sdk\include”
  1. Linking OpenCL
  • Choose ‘Linker-> General’.
  • In the ‘Additional Dependencies’ field enter the following, again this is based on your card vendor.
    • nVidia: - “$(CUDA_LIB_PATH)”
    • AMD: - “$(AMDAPPSDKROOT)\lib\x86” (for 64 bit users you may need to change the x86 to x86_64)
    • Intel: - “C:\Intel\OpenCL\sdk\lib\x86” (for 64 bit users you may need to change the x86 to x64)
  • Still in the ‘Linker’ submenu, select ‘Input’.
  • In the ‘Additional Dependencies’ field click on the arrow that appears at the end of the field and choose Edit…
  • In the dialog that appears enter “OpenCL.lib”

How to use

$ ./waifu2x_ocl -h
Usage: ./waifu2x_ocl [options] file

Options:
-h                 Print this message
-m <model name>    waifu2x model name [noise2_model.json...]
-s <scale>         Magnification [1.0, 1.6, 2.0...]
-o <output name>   output file name [*.png, *.jpg]

$ ./waifu2x_ocl -s 1.0 nyanko.jpg
$ ./waifu2x_ocl -m vgg_7/art_y/noise3_model.json nyanko.jpg
$ ./waifu2x_ocl 001_200x.jpg
001_200x.jpg 200x199 3
wsize:287136
AMD Radeon HD 7800 Series (TAHITI / DRM 3.23.0 / 4.16.11-berry, LLVM 6.0.0) (platform 0, device 0)
Maximum memory allocation size is 2254046412 bytes
200 199 -> 416 414 *2.000000
0 0
159 0
0 157
159 157

Demo

Original

Original

Normal Resize by Gimp

Normal

Waifu2x Resize

  • ./waifu2x_ocl -s 2.0 -m noise3_model.json waifu_s.jpg -o waifu_d.png Waifu2x

References

waifu2x-ocl's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

waifu2x-ocl's Issues

Outputs a black image

When running the program, the output is a black image with the exact color of (1, 1, 0).

segmentation fault (core dumped)

$ ./waifu2x_ocl -s 2.0 waifu_s.jpg
waifu_s.jpg 256x384 3
wsize:287136
[1]    17099 segmentation fault (core dumped)  ./waifu2x_ocl -s 2.0 waifu_s.jpg

System: Linux Mint 19.2 Tina x86_64
No GPU, using OpenCL
Built with make

Any tips how to fix it?

Assertion `!r` failed

I compiled and ran this:

./waifu2x-ocl/waifu2x_ocl -s 2.0 frames/frm0000017000.png -o frm17000.png

and all I can get is the following:

frm0000001722.png 1920x1072 3
waifu2x: waifu2x_ocl.c:462: int waifu2x_ocl(char *, char *, char *, float): Assertion `!r' failed.
Aborted (core dumped)

¯\_(ツ)_/¯

Not using iGPU on macOS 10.14 Mojave

The program uses CPU instead of integrated GPU on my mac.
Compiled master directly with make

Yakumo-Yukari:waifu2x-ocl gnattu$ ./waifu2x_ocl -s 2.0 /Users/gnattu/Pictures/66176711_p1_master1200.jpg 
/Users/gnattu/Pictures/66176711_p1_master1200.jpg 1200x675 3
wsize:287136
Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz (platform 0, device 0)
Maximum memory allocation size is 4294967296 bytes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.