Git Product home page Git Product logo

deadsix27 / waifu2x-converter-cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tanakamura/waifu2x-converter-cpp

790.0 25.0 87.0 65.91 MB

Improved fork of Waifu2X C++ using OpenCL and OpenCV

License: MIT License

CMake 2.39% Python 1.45% Lua 2.66% Makefile 1.07% C 12.20% Shell 0.22% C++ 69.84% JavaScript 0.09% sed 0.02% HTML 5.19% Cuda 4.87%
waifu2x-converter-cpp waifu2x cpp opencl opencv amd intel nvidia cuda cv upscale upscaler waifu 2x w2x

waifu2x-converter-cpp's Introduction

Discord :: Downloads522 :: TotalDownloads

---------- Work stalled for now ----------

@YukihoAA has push rights in case anything important comes up, if he finds the time that is.


waifu2x (converter only version)

This is a reimplementation of waifu2x (original) converter function, in C++, using OpenCV. This is also a reimplementation of waifu2x python version by Hector Martin. You can use this as command-line tool of image noise reduction or/and scaling.

This software was originally made by @WL-Amigo and has been improved a lot over the years, see FORK_CHANGES.md for more info on that.

Obtain it here:

Supported platforms

  • Linux
  • LInux (ARM)
  • Windows 7+
  • MacOS?
    • This is not officially supported but see here for more information: #20

Build dependencies

How to build

See BUILDING.md for more information.

How to Train Own Model

waifu2x-conveter only supports vgg models. See nagadomi/waifu2x for more information.

Usage

Usage of this program can be seen by executing waifu2x-converter-cpp --help If you are on Windows and prefer GUIs, see here.

Notes:

I'd appreciate any help on this project, I do not want yet another fork... so if you have improvement ideas or find bugs, please make a pull request or open an issue :)!

A big thanks to these people helping me maintain this fork:

waifu2x-converter-cpp's People

Contributors

andreili avatar brunoais avatar deadsix27 avatar eclipseo avatar gloaming avatar holywu avatar iame6162013 avatar inflation avatar iwag avatar jbeich avatar koachan avatar matfrem avatar max20091 avatar nnn1590 avatar professorjamesmoriarty avatar smellman avatar tanakamura avatar tilcreator avatar toyg avatar traneptora avatar vitaliylag avatar wl-amigo avatar wykerd avatar xmaayy avatar yukihoaa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

waifu2x-converter-cpp's Issues

How do I use it?

I have windows 7, I just downloaded this but I do not know how to use it? Can anyone give me instructions.

VS2017 + CUDA 9.1 compilation bug that affects this project

When you use CUDA 9.1 and VS2017 together to compile, you need to have the 'VS++ 2017 version 15.4 v14.11 toolset' component from the Visual Studio Installer, and a line in a CUDA header file which doesn't allow you to use said version needs to be changed.

Open C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\crt\host_config.h
Find #if _MSC_VER < 1600 || _MSC_VER > 1911, should be line 133.
Change 1911 to 1912 (or any number higher than 1911 really, since it's just a check).

After that, it should compile fine.

Credit: @DeadSix27

v5.0 crashing

I just download v5.0 and, while v4.0 works fine for me:
image
v5.0:
image
As you can see, there is a bit of diversity.
PC:

  • Windows 10 64 bit
  • Ryzen R7 1700
  • 16GB RAM
  • HD 7770 (I know, it suck)

Program abnormal terminated

commit: f2cbb2e
CPU: i7 6700K
error message:
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc

Freshly pulled from git and running on my Arch machine, and the program exit immediately.
Last build (few months ago, though) the issue wasn't exit.

Level 1 and 2 denoise leave artifacts

I've recently noticed that Levels 1 and 2 for denoise leave artifacts behind in some cases, while Level 3 seems to clear them up just fine (though with the added detail loss). Here is a link to an example album of a portion of the original image and then the three denoise settings outputs.

I've tested this using your latest release on my main machine (R7 1700, RX 480 8GB, Adrenalin 17.12.2, Windows 8.1) and on my laptop (i7-7560U, Windows 10). I also gave caffe a shot on my main machine, and it has the same issues (though one combination of settings output similar to Level 3 above, but not quite as clean). An older version of converter-cpp (1130 from tanakamura) does not display these problems, nor does the online version.

Oh, and if it makes a difference, I am using a slightly modified version of max20091's CMD GUI. Nothing special, just added some options for my sake.

Upgrade to OpenCV3.3 and VS2017

After I merge @iame6162013's changes I will update the code to compile with VS2017.

There were 2 changes I had to make which I am unsure about whether they could cause issues later on:
1.


threadPool.cpp caused issues with:

#elif defined _MSC_VER
#define rmb() _ReadBarrier()
#define wmb() _WriteBarrier()

Read/Write barrier is deprecated in 2017VS

changing this to:

#elif defined _MSC_VER
#define rmb() _mm_mfence()
#define wmb() _mm_mfence()

Made it work again, however I have no idea if this is a bad thing.


Another issue was caused by __cpuid in w2xconv.cpp, adding the following lines to the includes solved this.

#if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))
# include <intrin.h>
#endif

I found that solution here: https://github.com/jedisct1/libsodium/issues/491

No CPU multithreading

tanakamura's version (I ran the prebuilt binary-form release in wine) can use all my CPU threads, while this fork seems to use only single CPU core.

Compilation fails with CUDA enabled

Hello,

I have an nVidia GPU, and I wanted to test CUDA. I had to make the changes described in #35 (every one of them) to make it work. My situation was the same, I followed the BUILD.md guide but installing CUDA instead of AMD SDK.

After that It seems to work with no issues. Performance seems good, but as my understanding of CUDA specifics is very limited, I am not sure what are the effects of this workarround. I would like to help with testing if needed.

Add video support

Expected behavior:
Accepts all kinds of image & video formats

Current behavior:
Changed the file extension of all inputted outputted files to png, we should not to do this.
This prevents all video files to be treated as such.

Add noise reduction level 0 support

Although it is named level 0, it does not mean that it does not perform noise reduction.
In fact, the noise reduction is performed slightly.

Move The LLVM Bin To Another Location

If one creates a package of waifu2x-converter-cpp, which installs the executable into /usr/bin and forces OpenCL, the program will SEGFAULT as it can't create the LLVM bin file, unless you run it as root. All subsequent runs will work.

A better location for the binary that won't cause SEGFAULTS is /home/(user)/,local/share .

MinGW Support

I need help getting gcc to compile with exp. filesystem.

Currently fails: error: cannot convert 'const string_type* {aka const std::__cxx11::basic_string<wchar_t>*}' to 'const string* {aka const std::__cxx11::basic_string<char>*}' in assignment s = &_M_pathname;

I think Alexpus got it working in his pkgbuild: https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-gcc/PKGBUILD

That's what I'll try next. But I have limited time and will currently.. so don't expect much to be done.

If that does not work I guess we'd have to go for boost.. no other idea.

Feel free to try yourself tho, I added my progress in making the cmake file mingw compat (not cleaned up yet.. lots of leftover stuff) to: https://github.com/DeadSix27/waifu2x-converter-cpp/tree/mingw_test

can you(any one) help me solve this question?

I tried to complict waifu2x-converter-cpp-master ,but has a peoblem.

2>w2xcr.obj : error LNK2019: unresolved external symbol __imp_w2xconv_convert_file referenced in function proc_thread
2>*****\Release\w2xcr.exe : fatal error LNK1120: 1 unresolved externals

I want to know the reason to cause this result.

[Request] Multithreaded imwrite

When processing a large number of images I notice that my GPU will max out to 100% while it's processing, then drop to 0% while the output file is being written to disk. Is there any way to get the next image to start processing while the last image is being writen? This would make a big difference when processing an image sequence thousands of frames long.

TODO List

  • Fix CL Bin path support (the bin files it creates can have illegal file names) Fixed: see f963753
  • Fix Unicode support (Hard to fix on windows.. need help for that. (See unicode-testing branch))
  • Fix test not using right model
  • Fix crash when no image extension is supplied (Add auto detection?, or error out?)

Ill update this as I progress.

koroshell

Is there any method for getting the updated binaries/level 3 noise reduction into koroshell?

How to use

Sorry for bothering, I just cant figure out how to use this, I have nvidia, so I know I have to do something extra, but besides that I don't how it should work or what to do to make it work, so a brief explanation will be greatly appreaciated, I will buy you a coffee

Console spam

The user may get many hundreds if not thousands if many files/large files are up sampled.
It doesn't clearly show how close the program is to finishing.

start process block (1,0) ...
Iteration #1(3->32)...(3.24631[ms], 139.539[GFLOPS], 11.3052[GB/s])
Iteration #2(32->32)...(12.3052[ms], 392.667[GFLOPS], 5.45371[GB/s])
Iteration #3(32->64)...(26.5419[ms], 364.091[GFLOPS], 3.79261[GB/s])
Iteration #4(64->64)...(47.5478[ms], 406.483[GFLOPS], 2.8228[GB/s])
Iteration #5(64->128)...(87.4873[ms], 441.832[GFLOPS], 2.30121[GB/s])
Iteration #6(128->128)...(168.021[ms], 460.117[GFLOPS], 1.59763[GB/s])
Iteration #7(128->3)...(9.63285[ms], 188.1[GFLOPS], 14.2599[GB/s])
total : 0.354961[sec], 428.362[GFLOPS]

Do you (any one) have a Developing documents about waifu2x ?

   I have some questions about  waifu2x  by read  the  code  .  
   For example , What is nInputPlanes and nOutputPlanes   in   the  class Model ? 
   So ,do you  have a  Developing documents  about it ?
   I need it to Konw the class's   function and members's  description. 

(Question) Compile as Library

Is it possible to compile this software as a library? If so, any suggestion on how to do it? I'm trying to create an Android version of waifu2x using OpenCL on smartphone. If using this software as library is possible it going to save a lot of work. Thanks in advance.

I just found a way to use Waifu2X and set custom paramethers through a GUI interface.

I used Waifu2X Koroshell (CPU Ver.) files to do this. You just need to drag your pic in the Waifu2X window and they'll convert using comand line.
I renamed "waifu2x-converter-cpp.exe" to "waifu2x-converter_x64.exe" to make koroshell exe recognize this file and upscale. Here's the link of the file.

https://drive.google.com/file/d/0B1VV-pX3WjWLTmRMV0hfLTg1Vzg/view?usp=sharing

Cant you guys fork this .exe(waifu2x-x64.exe) too? On windows 10 i'm having some issues, and or/also make the batch script CMD window minimized while doing the process, having a window popping-out everytime is too annoying.

Failure in getting Kaby Lake iGPU to work

On kaby lake systems, at least on mine there is a code part that caused crashes when running:

$ ./waifu2x-converter-cpp  --list-processor
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

Ubuntu compile fails: "This file [...] support for the ISO C++ 2011 standard."

First error (probably the most relevant) that appears (it is many KB long):

/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
 #error This file requires compiler and library support

cmake version 3.13.0
g++ version: 5.4.0
uname -a: Linux PC 4.15.0-39-generic #42~16.04.1-Ubuntu SMP Wed Oct 24 12:09:54 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

I'm trying to compile the current master version to use waifu2x for myself.
I already tried to check the generated make files and everything appears to be correct (although the generated content is huge).
Any idea what I may be doing wrong?
I'm following these instructions

Ignoring tags in file name while batch processing

It's a small request since it'd save a lot of time in batch processing many images. If there's a chance of disabling the tags that are added once the files are generated so that the file name remains same as the original.

Example:

File name is: 0004.png
Output is turning into: 0004_[NS-L3][x2.000000].png
While it should be: 0004.png

Thanks!

Error when building on OS X 10.12.6

Running OS X Sierra 10.12.6
All goes well until the "make" part, this just happens:
https://pastebin.com/m763EaME
Yes I do have the latest version of openCV installed
I have OpenCV 3.3.0 and Cmake 3.9 installed
The latest versions of both, what's wrong?

Edit 2:
I somehow managed to solve some of these problems and now I get this
https://pastebin.com/G0Nxrgbw
Though I think you should still look at the first log in case anyone else has the same problem and also because I may have done stuff wrongly

Odd issue with other models

I got v4 working instead of the current build, when I tried using nagadomi's "anime_art_style_rgb" model to upscale an image, mostly the green channel shows up with hints of red and blue.
Terminal shows no errors though
OSX 10.12.6
http://imgur.com/a/5q6oj

[Question] Using waifu2x_win_koroshell with the latest version of waifu2x-converter-cpp

So this maybe a dump question.

  1. So I was using waifu2x_win_koroshell download fron here like the instruction. That version is supposed to be very old if I am not mistaken? So I downloaded the latest release of you, and overwrite every files. Is it suppose to be the correct way to no this? I hope not.
    I don't know how to implement the latest release to that waifu2x_win_koroshell.
  2. Also, I am fine with using command line, but I don't know how to convert multiple images, maybe a folder of images with the command. Like what is the syntax for converting an entire folder?
  3. Finally, the last release was from Dec last year. Any release coming soon with OpenCV 3.3 (not sure if it's important anyway)?

Allow multiple devices to work on the same set of images

When I need to convert a large set of images and it's going to take multiple hours, it would be nice if I could use multiple devices to get the job done. I don't have a second GPU, though some people do and would probably appreciate it if they could use them in this manner. I do have a pretty good 8-core CPU though, and according to some tests I did it runs waifu2x-converter-cpp at about half the speed of my GPU. If I could use my CPU at the same time I could get the conversion done about 33% faster.

I guess you could split the image set into multiple parts, put them into different folders, and just spin up a new converter process for each of them but that's a pretty hacky way of doing it.

Not really an issue, but a question.

My R9 280 recently died and I can't use waifu2x anymore, I have an Nvidia Quadro FX 580 laying around here but when I try to upscale something using this video card waifu2x crashes.. My question is, is this GPU incompatible with Waifu2x libraries? (probably it is) if yes, can you make it compatible (or tell me a way to do this)? . Please.
I wasn't expecting this, (this video card is 1 year and 3 months old)

[Possible issue] Scaled image are slightly darker

Apparently, if I upscale and image to x2 it's size, it becomes darker. I don't know why
This album is a good compassion
https://imgur.com/a/WoAAL
The source image and the one used with "lltcggie/waifu2x-caffe" are similar, albeit the size.
The source image and the one used with waifu2x-converter-cpp are slightly different in color, as the later is darker.
All images are in .png, so you can easily download and check it.
Place them side by side, use Windows image viewers and push left-right continuously, you can see the difference.
I don't know why, but apparently the CUDA version gives better results, yet I cannot use it :| Please look into it for AMD GPU users.

Success in scale size 2 but crash when scale size 5 or 10

Hello,

I have tried two different image file, both have this issue.

Version:v4.0 release of waifu2x-converter-cpp compiled with OpenCV (Windows 64 AMD)

Argument:
waifu2x-converter-cpp -i "..\1.jpg" -m noise_scale -j 8 --scale_ratio 5 --noise_level 2

File Info:
3200x2000 pixel

Tried to build with an NVIDIA GPU but it crashes when trying to use the CUDA processor

Using cuda_9.0.176_win10
Using cmake-3.10.0-rc1-win64-x64
Using OpenCV 3.3.0

Didn't install the AMD APP SDK.

Trying to build it originally fails because CUDA 9 does not support sm_20 architecture so I've commented out L226-L230, L238-L242, and removed modelHandler_CUDA.ptx20.h at L249 in CMakeLists.txt.

I also had to comment out L18-L20 and replace L139-L142 with const char *prog = prog30; in modelHandler_CUDA.cpp.

Now when I try to run it using CUDA, this happens:

PS C:\Users\Christianity\Pictures> 2x --list-processor
   0: GeForce GTX 1080 Ti                          (CUDA      ): num_core=28
   1: GeForce GTX 1080 Ti                          (OpenCL    ): num_core=28
   2: AMD Ryzen 7 1700 Eight-Core Processor          (FMA       ): num_core=16
PS C:\Users\Christianity\Pictures> 2x .\Thanks.png -m scale --processor 0
CUDA: GeForce GTX 1080 Ti
start scaling
#1 2x scaling...

and then the windows error reporting dialog appears.

OpenCL works fine though.

Binary doesn't build

Main issue: after build completes, i can't find any binary file to execute!
also after running sudo make install; i still can't find any binary to execute
all opencl and opencv dependencies installed, (i also run boinc)

I am using Linux Mint 19

utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ uname -a
Linux utku 4.15.0-29-generic #31-Ubuntu SMP Tue Jul 17 15:39:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

GPU is RX 540 and it has a peak of 1.2 teraflops, runbench shows it has peak of 200~ gflops
(just tested again with SHOC, RX 540 give 1042 gflops which as i expected, and apu gives 200 gflops)

clinfo:

utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 Mesa 18.0.5
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 2
  Device Name                                     AMD CARRIZO (DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 18.0.5
  Driver Version                                  18.0.5
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               6
  Max clock frequency                             757MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              1863519436 (1.736GiB)
  Error Correction support                        No
  Max memory allocation                           465879859 (444.3MiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     16
  Max constant buffer size                        465879859 (444.3MiB)
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Extensions                               cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64 cl_khr_fp16

  Device Name                                     Radeon 500 Series (POLARIS12 / DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 Mesa 18.0.5
  Driver Version                                  18.0.5
  Device OpenCL C Version                         OpenCL C 1.1 
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Device Available                                Yes
  Compiler Available                              Yes
  Max compute units                               8
  Max clock frequency                             1046MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes                 
    char                                                16 / 16      
    short                                                8 / 8       
    int                                                  4 / 4       
    long                                                 2 / 2       
    half                                                 8 / 8        (cl_khr_fp16)
    float                                                4 / 4       
    double                                               2 / 2        (cl_khr_fp64)
  Half-precision Floating-point support           (cl_khr_fp16)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (cl_khr_fp64)
    Denormals                                     Yes
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 Yes
    Round to infinity                             Yes
    IEEE754-2008 fused multiply-add               Yes
    Support is emulated in software               No
  Address bits                                    64, Little-Endian
  Global memory size                              3218305024 (2.997GiB)
  Error Correction support                        No
  Max memory allocation                           1927633305 (1.795GiB)
  Unified memory for Host and Device              No
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       32768 bits (4096 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max number of constant args                     16
  Max constant buffer size                        1927633305 (1.795GiB)
  Max size of kernel argument                     1024
  Queue properties                                
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities                          
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Extensions                               cl_khr_byte_addressable_store cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_fp64 cl_khr_fp16

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_DEFAULT)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD CARRIZO (DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (2)
    Platform Name                                 Clover
    Device Name                                   AMD CARRIZO (DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
    Device Name                                   Radeon 500 Series (POLARIS12 / DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (2)
    Platform Name                                 Clover
    Device Name                                   AMD CARRIZO (DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
    Device Name                                   Radeon 500 Series (POLARIS12 / DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.11
  ICD loader Profile                              OpenCL 2.1

Output:

utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ cmake ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is Clang 6.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- We are on: Linux (Linux)
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1") 
CMake Warning at CMakeLists.txt:36 (find_package):
  By not providing "FindOpenCV.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCV", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCV" with any
  of the following names:

    OpenCVConfig.cmake
    opencv-config.cmake

  Add the installation prefix of "OpenCV" to CMAKE_PREFIX_PATH or set
  "OpenCV_DIR" to a directory containing one of the above files.  If "OpenCV"
  provides a separate development package or SDK, be sure it has been
  installed.


CUDA_TOOLKIT_ROOT_DIR not found or specified
-- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) 
-- CUDA not found. disabled.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/utku/Programlar/waifu2x-converter-cpp-5.2/out
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ make
Scanning dependencies of target conv
[  5%] Building C object CMakeFiles/conv.dir/conv.c.o
[ 10%] Linking C executable conv
[ 10%] Built target conv
Scanning dependencies of target gensrcs
[ 15%] Generating modelHandler_OpenCL.cl.h
[ 15%] Built target gensrcs
Scanning dependencies of target w2xc
[ 21%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler.cpp.o
[ 26%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler_avx.cpp.o
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
[ 31%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler_fma.cpp.o
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
[ 36%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler_sse.cpp.o
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
[ 42%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler_OpenCL.cpp.o
[ 47%] Building CXX object CMakeFiles/w2xc.dir/src/convertRoutine.cpp.o
[ 52%] Building CXX object CMakeFiles/w2xc.dir/src/threadPool.cpp.o
[ 57%] Building CXX object CMakeFiles/w2xc.dir/src/modelHandler_CUDA.cpp.o
[ 63%] Building CXX object CMakeFiles/w2xc.dir/src/w2xconv.cpp.o
/home/utku/Programlar/waifu2x-converter-cpp-5.2/src/w2xconv.cpp:411:10: warning: 
      enumeration value 'W2XCONV_ERROR_OPENCL' not handled in switch [-Wswitch]
        switch (conv->last_error.code) {
                ^
/home/utku/Programlar/waifu2x-converter-cpp-5.2/src/w2xconv.cpp:441:10: warning: 
      enumeration value 'W2XCONV_ERROR_OPENCL' not handled in switch [-Wswitch]
        switch (e->code) {
                ^
2 warnings generated.
[ 68%] Building CXX object CMakeFiles/w2xc.dir/src/common.cpp.o
[ 73%] Building CXX object CMakeFiles/w2xc.dir/src/cvwrap.cpp.o
[ 78%] Building CXX object CMakeFiles/w2xc.dir/src/Env.cpp.o
[ 84%] Building CXX object CMakeFiles/w2xc.dir/src/Buffer.cpp.o
[ 89%] Linking CXX shared library libw2xc.so
[ 89%] Built target w2xc
Scanning dependencies of target runbench
[ 94%] Building C object CMakeFiles/runbench.dir/w32-apps/runbench.c.o
[100%] Linking C executable runbench
[100%] Built target runbench
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ ./runbench
Writing OpenCL-Binary to: /home/utku/Programlar/waifu2x-converter-cpp-5.2/out/Radeon_500_Series_(POLARIS12___DRM_3.23.0___4.15.0-29-generic__LLVM_6.0.0).bin
Radeon 500 Series (POLARIS12 / DRM 3.23.0 / 4.15.0-29-generic, LLVM 6.0.0)
start process block (0,0) ...
Iteration #1(1->32)...(18.4992[ms], 8.61471[GFLOPS], 1.9742[GB/s])
Iteration #2(32->32)...(53.7721[ms], 94.8389[GFLOPS], 1.31721[GB/s])
Iteration #3(32->64)...(39.7677[ms], 256.474[GFLOPS], 2.67161[GB/s])
Iteration #4(64->64)...(83.3661[ms], 244.689[GFLOPS], 1.69923[GB/s])
Iteration #5(64->128)...(142.544[ms], 286.21[GFLOPS], 1.49068[GB/s])
Iteration #6(128->128)...(319.534[ms], 255.356[GFLOPS], 0.886654[GB/s])
Iteration #7(128->1)...(7.79648[ms], 81.7627[GFLOPS], 18.3114[GB/s])
total : 0.665865[sec], 238.618[GFLOPS]
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ ls
CMakeCache.txt       CTestTestfile.cmake       modelHandler_sse.bc
CMakeFiles           libw2xc.so                modelHandler_sse.ii
cmake_install.cmake  Makefile                  modelHandler_sse.s
conv                 modelHandler_OpenCL.cl.h  runbench
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ sudo make install
[sudo] password for utku: 
[ 10%] Built target conv
[ 15%] Built target gensrcs
[ 89%] Built target w2xc
[100%] Built target runbench
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/include/w2xconv.h
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ w2xc
w2xc: komut bulunamadı
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ gensrcs
gensrcs: komut bulunamadı
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ waifu2x-converter-cpp
waifu2x-converter-cpp: komut bulunamadı
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ waifu2x-converter-cpp
waifu2x-converter-cpp: komut bulunamadı
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ ls
CMakeCache.txt       CTestTestfile.cmake   modelHandler_OpenCL.cl.h  runbench
CMakeFiles           install_manifest.txt  modelHandler_sse.bc
cmake_install.cmake  libw2xc.so            modelHandler_sse.ii
conv                 Makefile              modelHandler_sse.s
utku@utku:~/Programlar/waifu2x-converter-cpp-5.2/out$ 

Performace issue

hi, I have tested your latest windows binary and latest wl-amigo's windows binary using one picture.
Your version's performace was around 148GFLOPS (on my rx 470) and wl-amigo's version was around 232GFLOPS.
How so your build is slower by a lot even when you are using latest opencv library?

Add image detection without extension?

The program crashes when no image extension is given.
Maybe we can add code to auto-detect the image type?
Or error out if that is too much work and or is too unreliable.

Also in todo list: #1

Program fails when loading libImath-2_2.so.23

I'm trying to get this running under linux. Compilation and everything works. But when I try to run the program it fails with the message waifu2x-converter-cpp: error while loading shared libraries: libImath-2_2.so.23: cannot open shared object file: No such file or directory.

Since I have /usr/lib/libImath.so on my system I wanted to link against that, but I have no idea where this library is even used. Full text search shows nothing, and this library is neither mentioned in BUILDING.md nor do any AUR packages link against it.

Could you maybe give me a heads up into the right direction? (If I manage to fix this, I will document the solution and maybe submit a PR if needed)

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.