Giter Club home page Giter Club logo

real-esrgan-ncnn-vulkan's Introduction

Real-ESRGAN ncnn Vulkan

CI License: MIT Open issue Closed issue

This project is the ncnn implementation of Real-ESRGAN. Real-ESRGAN ncnn Vulkan heavily borrows from realsr-ncnn-vulkan. Many thanks to nihui, ncnn and realsr-ncnn-vulkan 😁

Real-ESRGAN aims at developing Practical Algorithms for General Image Restoration. We also optimize it for anime images.

Contents


If Real-ESRGAN is helpful in your photos/projects, please help to ⭐ this repo or recommend it to your friends. Thanks😊
Other recommended projects:
▶️ Real-ESRGAN: A practical algorithm for general image restoration
▶️ GFPGAN: A practical algorithm for real-world face restoration
▶️ BasicSR: An open-source image and video restoration toolbox
▶️ facexlib: A collection that provides useful face-relation functions.
▶️ HandyView: A PyQt5-based image viewer that is handy for view and comparison.

📖 Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data

[Paper]   [Project Page]   [Demo]
Xintao Wang, Liangbin Xie, Chao Dong, Ying Shan
Tencent ARC Lab; Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences

⏳ TODO List

  • Support further cheap arbitrary resize (e.g., bicubic, bilinear) for the model outputs
  • Bug: Some PCs will output black images
  • Add the guidance for ncnn model conversion
  • Support face restoration - GFPGAN

💻 Usages

Example Command

realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -n realesr-animevideov3 -s 2

Full Usages

Usage: realesrgan-ncnn-vulkan.exe -i infile -o outfile [options]...

  -h                   show this help"
  -i input-path        input image path (jpg/png/webp) or directory"
  -o output-path       output image path (jpg/png/webp) or directory"
  -s scale             upscale ratio (can be 2, 3, 4. default=4)"
  -t tile-size         tile size (>=32/0=auto, default=0) can be 0,0,0 for multi-gpu"
  -m model-path        folder path to the pre-trained models. default=models"
  -n model-name        model name (default=realesr-animevideov3, can be realesr-animevideov3 | realesrgan-x4plus | realesrgan-x4plus-anime | realesrnet-x4plus)"
  -g gpu-id            gpu device to use (default=auto) can be 0,1,2 for multi-gpu"
  -j load:proc:save    thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu"
  -x                   enable tta mode"
  -f format            output image format (jpg/png/webp, default=ext/png)"
  -v                   verbose output"
  • input-path and output-path accept either file path or directory path
  • scale = scale level
  • tile-size = tile size, use smaller value to reduce GPU memory usage, default selects automatically
  • load:proc:save = thread count for the three stages (image decoding + model upscaling + image encoding), using larger values may increase GPU usage and consume more GPU memory. You can tune this configuration with "4:4:4" for many small-size images, and "2:2:2" for large-size images. The default setting usually works fine for most situations. If you find that your GPU is hungry, try increasing thread count to achieve faster processing.
  • format = the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded

If you encounter crash or error, try to upgrade your GPU driver

🌏 Other Open-Source Code Used

📜 BibTeX

@InProceedings{wang2021realesrgan,
    author    = {Xintao Wang and Liangbin Xie and Chao Dong and Ying Shan},
    title     = {Real-ESRGAN: Training Real-World Blind Super-Resolution with Pure Synthetic Data},
    booktitle = {International Conference on Computer Vision Workshops (ICCVW)},
    date      = {2021}
}

📧 Contact

If you have any question, please email [email protected] or [email protected].

real-esrgan-ncnn-vulkan's People

Contributors

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

real-esrgan-ncnn-vulkan's Issues

Your Results in New Super-Resolution Benchmarks

Hello,

MSU Graphics & Media Lab Video Group has recently launched two new Super-Resolution Benchmarks.

Your method achieved 1st place in Video Upscalers Benchmark: Quality Enhancement in 'Animation 2x' category and 3rd place in Super-Resolution for Video Compression Benchmark in 'x265 compression' category. We congratulate you on your result and look forward to your future work!

We would be grateful for your feedback on our work.

错误 不知道为啥

Z:\99 HS_04 PCITURE_06 2d\总2\0001.jpg -> C:\Users\AKiRa_PC\AppData\Local\Temp\aWfXIfI8fXOha5Zu.jpg.png done
Traceback (most recent call last):
File "shutil.py", line 815, in move
FileNotFoundError: [WinError 2] 系统找不到指定的文件。: 'C:\Users\AKiRa_PC\AppData\Local\Temp\aWfXIfI8fXOha5Zu.jpg' -> 'Z:\99 HS_04 PCITURE_06 2d\总2-x2\0001.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "task.py", line 243, in taskRunner
File "task.py", line 103, in run
File "shutil.py", line 835, in move
File "shutil.py", line 434, in copy2
File "shutil.py", line 254, in copyfile
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\AKiRa_PC\AppData\Local\Temp\aWfXIfI8fXOha5Zu.jpg'

in directory mode, option to skip if destination already exist

if you stop the upscaler while processing a directory and you have to restart it, it will start from the beginning and overwrite existing files

overwriting in file mode is fine but should be an option for direcotry mode ...
so I propose a flag to disable overwrite and skip if exist

Any way to make this work on Mojave?

If trying to run this on Mojave (10.14.6), the GPU does render the image, but when it gets to where it needs to save it, it throws an error because it can't find the library for c++.1 which is not present on Mojave.

I haven't found a way to install the other c++.1, though the guys who make Homebrew are trying to find a way to do it for older macOS.

Edit: Apparently this does exist on Mojave, but maybe it's not the location that's expected.
I found it in /usr/lib/libc++.1.dylib. Is there a way to point the app to this location or is this an older version that won't work?

You can see below how it errors out right before finishing:

[0 AMD Radeon Pro Vega 64]  queueC=0[1]  queueG=0[1]  queueT=0[1]
[0 AMD Radeon Pro Vega 64]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 AMD Radeon Pro Vega 64]  fp16-p/s/a=1/1/1  int8-p/s/a=1/1/1
[0 AMD Radeon Pro Vega 64]  subgroup=64  basic=1  vote=1  ballot=1  shuffle=1
0.00%
2.78%
5.56%
8.33%
11.11%
13.89%
16.67%
19.44%
22.22%
25.00%
27.78%
30.56%
33.33%
36.11%
38.89%
41.67%
44.44%
47.22%
50.00%
52.78%
55.56%
58.33%
61.11%
63.89%
66.67%
69.44%
72.22%
75.00%
77.78%
80.56%
83.33%
86.11%
88.89%
91.67%
94.44%
97.22%
dyld: lazy symbol binding failed: Symbol not found: __ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE
  Referenced from: /Volumes/Projects_Active/realesrgan-ncnn-vulkan-20210901-macos/./realesrgan-ncnn-vulkan (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libc++.1.dylib

dyld: Symbol not found: __ZNSt3__14__fs10filesystem10__absoluteERKNS1_4pathEPNS_10error_codeE
  Referenced from: /Volumes/Projects_Active/realesrgan-ncnn-vulkan-20210901-macos/./realesrgan-ncnn-vulkan (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libc++.1.dylib

Abort trap: 6

This is a stable production machine and I can't install 10.15 on this machine because I need to run 32-bit software and plugins that do not exist in 64-bit for 10.15 or Big Sur. Also can't run it on my laptop with Big Sur because it only has Intel Iris graphics.

Please let me know if there is a way around this or if you can make a new build that will support 10.14.

Thanks

Add CPU support

Plesase add CPU support or at least when no GPU devices are available

I know it will be quite slow, but not every device has a gpu or not powerfull/compatible ones

Issue with audio sync

I am trying to enhance anime video but the audio does not match the original video. Original video is 1:40 and out video is 1:39, tried -r 24. Same problem. has anyone else noticed this? The audio doesn't sync with the original video. Frames are the same in the tmp_frames folder and out_frames folder. Same happens if I do jpg and at x2 scale. So I think its something with the ffmpeg.

Link to the out video. If you go to description and find the original video. You can then see the audio not sync right. https://www.youtube.com/watch?v=qF2pXR6daUU

Using this commands as in readme, does anyone else run into this problem?
Commands for enhancing anime videos:

  1. Use ffmpeg to extract frames from a video (Remember to create the folder tmp_frames ahead)
    ffmpeg -i onepiece_demo.mp4 -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 tmp_frames/frame%08d.png

  2. Inference with Real-ESRGAN executable file (Remember to create the folder out_frames ahead)
    ./realesrgan-ncnn-vulkan.exe -i tmp_frames -o out_frames -n realesr-animevideov3 -s 4 -f png

  3. Merge the enhanced frames back into a video
    ffmpeg -i out_frames/frame%08d.png -i onepiece_demo.mp4 -map 0:v:0 -map 1:a:0 -c:a copy -c:v libx264 -r 23.98 -pix_fmt yuv420p output_w_audio.mp4

Can not convert RealESRGAN output to OpenCV image in C++

I want to use RealESGRAN class at my project so i wrote this code for learning to use RealESGRAN class:

#include <cstddef>
#include <cstdio>
#include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>
#include "realesrgan.h"

int main() {
    int gpuid = 1, tilesize;
    uint32_t heap_budget = ncnn::get_gpu_device(gpuid)->get_heap_budget();

    if (heap_budget > 1900)
        tilesize = 200;
    else if (heap_budget > 550)
        tilesize = 100;
    else if (heap_budget > 190)
        tilesize = 64;
    else
        tilesize = 32;


    RealESRGAN upscaler = RealESRGAN(gpuid, true);

    cv::Mat img = cv::imread("corlu.jpg");
    int w = img.cols;
    int h = img.rows;

    int scale = 4;

    ncnn::Mat in = ncnn::Mat::from_pixels((unsigned char *)img.data, ncnn::Mat::PIXEL_BGR, w, h);
    cv::Mat output_img = cv::Mat::zeros(h * scale, w * scale, CV_8UC3);
    ncnn::Mat out = ncnn::Mat::from_pixels((unsigned char *)output_img.data, ncnn::Mat::PIXEL_BGR, w * scale, h * scale);
    //ncnn::Mat out = ncnn::Mat(w * scale, h * scale, (size_t)3, 3);
;

    upscaler.load("models/realesrgan-x4plus.param", "models/realesrgan-x4plus.bin");

    upscaler.scale = scale;
    upscaler.tilesize = tilesize;
    upscaler.prepadding = 10;

    upscaler.process(in, out);

    out.to_pixels(output_img.data, ncnn::Mat::PIXEL_BGR);
    cv::imwrite("output.jpg", output_img);
}

If i use code without changes i get black image with some blue things and if i use out = ncnn::Mat(w * scale, h * scale, (size_t)3, 3); as out i get segmentation fault at out.to_pixels(output_img.data, ncnn::Mat::PIXEL_BGR); part of my code.

Use GPU on M2 Mac?

I've successfully gotten this implemented and running on my M2 Mac, but is it possible to get it to use the GPU instead of the CPU? I was guessing 'no' because it's not Metal, but thought I'd ask.

Request: offer sample apps for Android and IOS

As the title says. It seems this repository should make it possible, because of this:

https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-android
https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-ios-on-macos-with-xcode

If you create a sample project (here or somewhere else and link to it), it could be easier for everyone to use it.
Please, if you do it, show also how to update it in case there are new versions of the libraries.

I would really appreciate it.

CMake errors with GLSLANG

I think GLSLANG made something changes in their cmake files.
I get next errors from your Cmakelists.txt with CMAKE

Found glslangValidator: Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/Vulkan_SDK/Bin/glslangValidator.exe
Using glslang install located at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake
CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/OSDependentTargets.cmake:2 (message):
  Using `OSDependentTargets.cmake` is deprecated: use `find_package(glslang)`
  to find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:110 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/OGLCompilerTargets.cmake:2 (message):
  Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)`
  to find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:111 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/HLSLTargets.cmake:2 (message):
  Using `HLSLTargets.cmake` is deprecated: use `find_package(glslang)` to
  find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:114 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/glslangTargets.cmake:2 (message):
  Using `glslangTargets.cmake` is deprecated: use `find_package(glslang)` to
  find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:116 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/SPIRVTargets.cmake:2 (message):
  Using `SPIRVTargets.cmake` is deprecated: use `find_package(glslang)` to
  find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:117 (include)


CMake Error at CMakeLists.txt:245 (message):
  The submodules were not downloaded! Please update submodules with "git
  submodule update --init --recursive" and try again.


Configuring incomplete, errors occurred!

Segfault realesrnet-x4plus

%  ./realesrgan-ncnn-vulkan -i FdLbqKcWIAAaCeY.jpeg  -o FdLbqKcWIAAaCeY.png -n realesrnet-x4plus
zsh: segmentation fault  ./realesrgan-ncnn-vulkan -i FdLbqKcWIAAaCeY.jpeg -o FdLbqKcWIAAaCeY.png -n 

models: consider adding into README how to get them.

Hey,

Please consider adding to README a section how to get the pre-trained model files. Currently you'd need to extract them from the following links

It took me a moment to figure out how to get a hold of them and I suspect many others would face similar challenge.

Fonts (up)scaling

I wonder if this is meant to work well also with fonts rendered in the bitmaps to upscale. Any insight?

Thanks!

Param failed?

_wfopen C:\Users\micro\Downloads\models/RealESRGANv2-animevideo-xsx4.pth.param failed is the error I keep getting...

Convert result image to OpenCV `cv::Mat` ERROR

I have test ncnn::Mat.to_pixels() with inimage, but outimage report error when converting:

// (main.cpp 376 line)
ncnn::Mat out = v.outimage;
cv::Mat res(out.h, out.w, CV_8UC3);
out.to_pixels(res.data, ncnn::Mat::PIXEL_BGR2RGB); // ERROR here
cv::imshow("res", res);
cv::waitKey();
cv::destroyAllWindows();

With OpenCV 4.6.0 Windows 10x, always get this:

Exception has occurred: W32/0xC0000005
Unhandled exception thrown: read access violation.
ptr1 was 0x1ACAC042000.

/src/ncnn/src/mat_pixel.cpp 734 line, is the problem with out.data or other ?

problem running on aws

I downloaded the ubuntu zip on a g3s.xlarge and the result is a black image. Is the zip missing files?


./realesrgan-ncnn-vulkan-v0.2.0-ubuntu/realesrgan-ncnn-vulkan -i input.jpg -o out/output.jpg -n realesrgan-x4plus -s 4 

[0 Tesla M60]  queueC=0[16]  queueG=0[16]  queueT=1[2]
[0 Tesla M60]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[0 Tesla M60]  fp16-p/s/a=1/1/0  int8-p/s/a=1/1/1
[0 Tesla M60]  subgroup=32  basic=1  vote=1  ballot=1  shuffle=1
[1 llvmpipe (LLVM 12.0.0, 256 bits)]  queueC=0[1]  queueG=0[1]  queueT=0[1]
[1 llvmpipe (LLVM 12.0.0, 256 bits)]  bugsbn1=0  bugbilz=0  bugcopc=0  bugihfa=0
[1 llvmpipe (LLVM 12.0.0, 256 bits)]  fp16-p/s/a=1/1/0  int8-p/s/a=1/1/0
[1 llvmpipe (LLVM 12.0.0, 256 bits)]  subgroup=8  basic=1  vote=1  ballot=1  shuffle=0
fopen /home/ubuntu/realesrgan-ncnn-vulkan-v0.2.0-ubuntu/models/realesrgan-x4plus.param failed
fopen /home/ubuntu/realesrgan-ncnn-vulkan-v0.2.0-ubuntu/models/realesrgan-x4plus.bin failed
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
0.00%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
4.17%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
8.33%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
12.50%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
16.67%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
20.83%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
25.00%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
29.17%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
33.33%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
37.50%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
41.67%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
45.83%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
50.00%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
54.17%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
58.33%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
62.50%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
66.67%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
70.83%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
75.00%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
79.17%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
83.33%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
87.50%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
91.67%
find_blob_index_by_name data failed
Try
find_blob_index_by_name output failed
Try
95.83%

Image tiles strangely merge

Hello,

Using v0.2.0 build on Ubuntu with realesrgan-x4plus weights and see the following result

download

Why the tiles are merging the wrong way?

libvulkan.so.1 is missing - no guide where to begin

hi,
i have tried binaries for the 3 os's
i cant find any guide anywhere to say what to install, what file/folder should be next to binary.
i am not the only one having this problem.

all im asking is small wiki'ish guide.

i have even found forks of this project that have same issue no guide
binary flags is not a guide.

this command in all 3 os's does noting but error (minus .exe for the linux/mac)
realesrgan-ncnn-vulkan.exe -i input.jpg -o output.png -n realesrgan-x4plus-anime
all machines have GPU non-intel

please some one at least put link for files and folder structure screen shots is enogh.
and installed libraries to make this thing work

**note (i have looked in to this and all forks of this project issue pages still nothing, please dont link me to other issues)

thanks

need a detailed instruction to install

I'm getting this error:

./realesrgan-ncnn-vulkan: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./realesrgan-ncnn-vulkan)

How do I switch from integrated gpu to nvedia gpu

[0 Intel(R) UHD Graphics 630] queueC=0[1] queueG=0[1] queueT=0[1]
[0 Intel(R) UHD Graphics 630] bugsbn1=0 bugbilz=3 bugcopc=0 bugihfa=0
[0 Intel(R) UHD Graphics 630] fp16-p/s/a=1/1/1 int8-p/s/a=1/1/1
[0 Intel(R) UHD Graphics 630] subgroup=32 basic=1 vote=1 ballot=1 shuffle=1

When upscaling images it only uses integrated gpu I want to use my gtx 1650 how do I switch this?

Scale value other than "4" results in garbled output image

Hello,

When I use anything else than the value 4 for my scale parameter I get the image cut up into 4 sections and bundled together randomly.

Here's an example:

000007-00 hyperrealistic full length portrait of gorgeous goddess  standing in field full of flowers  detaile

Do you happen to know what is the issue here?

Only with 4 do I get a proper resampled image.

Thank you!

vulkan update rtx 4090 please

vulkan update rtx 4090 please

I tried 6 cards of 4090 to test, but the speed is same as 4090 (1 card only).

realesrgan-ncnn-vulkan.exe -i import\Dekiru_Neko_wa_Kyou_mo_Yuuutsu_01 -o export\Dekiru_Neko_wa_Kyou_mo_Yuuutsu_01_out -n realesr-animevideov3-x4 -s 4 -f jpg -g 0,1 -j 4:4:4,1:4:4:4

and

rtx 4090 render load:proc:save recommend

realesrgan-ncnn-vulkan.exe -i import\test -o import\test_out -s 2 -n realesr-animevideov3-x2 -g 0,1 -j 0:10000,10000,10000,1:10000,10000,10000

not work

sample

https://i.imgur.com/aTVajaZ.png

'zsh: segmentation fault'

When attempting to upscale an image, about a quarter of the upscale was completed before the shell crashed, giving the above error. The image in question was a 335MB PNG image with a resolution of 15040x11160.

Upon further inspection, this segmentation fault seems to arise from memory mismanagement (i.e. accessing memory not allowed or that does not exist). The machine being used is M1 Pro with 32GB of ram, so memory should not be the limiting factor.

So there seems to be an upper limit on how big of an image can be upscaled. Let me know if you need anymore information.

请教,为什么输入的和输出的数据v.inimage和v.outimage的数据会那么大?该如何回归正常像素值?

下面是打印出来的v.inimage和v.outimage的像素值:41343064788866957312.000000 -8386355200.000000 -2001713900853686009329614848.000000 -38099216506938727525138466653339648.000000 -30.109255 -118033518575462882738176.000000 -606970993658067317785357474265563136.000000 -8486886400.000000 -32339329997486033345993244672.000000 -38752061517816422808430368400605184.000000 -8546615014981632.000000 -30985301364664669569024.000000 3058.994873 -0.000000 -0.000005 -0.087722 7002216060450387748137750999924211712.000000 -0.000000 -0.000000 7487453784590433368137046329131008.000000 -0.000000 -0.000068 -0.000000 -0.000000 -357637554176.000000 -0.000000 -0.000000 -1456557654016.000000 528635890991663767805167951337750528.000000 -0.000000 -78595.562500 7199316878425050539098112.000000 17325744562323450309885055467520.000000 -1219.988159 -0.000000 -0.000001 -426987369187508224.000000 -0.000000 -0.000000 -0.000000 -8015410688.000000 -527323279983230110530334097408.000000 -0.000000 59776405637955584.000000 67684990612918765617152.000000 4000184631558144.000000 0.000000 0.000000 0.002642 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 11.258844 210.293961 4570214195974826679733321728.000000 14310755.000000 63587144307185689250758656.000000 17289611703451113226240.000000 6131476480

Images come out wrong when using -s 2

While using the default scale of 4x, the output images come out correctly, but while using 2x something weird is happening.
Have a look:

Input
Tom

Output 2x
outputtom2x

Output 4x
outputtom2x

Please support scale other than 4 if possible, thanks

Since now the realesrgan-x4plus only support scale 4 output as its name showed, I try to download 2x model RealESRGAN_x2plus but fail to use it. Please support the feature such as --outscale that allows any scales if possible, thanks.

scale factor causes drop in sections

When I use the scale factor of 2, resulting image drops different sections.
./realesrgan-ncnn-vulkan -i inputs -o results -n realesrgan-x4plus -s 2 -f jpg

When I use the scale factor of 4, the result is correct with no pieces being dropped.
./realesrgan-ncnn-vulkan -i inputs -o results -n realesrgan-x4plus -s 4 -f jpg

webp input / output fails when using directories

I'm attempting to upscale some 480p content to 4k, and while it works fine if I use the same input and output formats, but when I attempt to change the format with -f it fails. given files in indir in png format:

# realesrgan-ncnn-vulkan -i indir/ -o outdir/ -s 4
[works fine]
# realesrgan-ncnn-vulkan -i indir/ -o outdir/ -s 4 -f webp
invalid outputpath extension type

this happens even if I choose the same format as the input format. looking at the code, main.cpp line 607 is the only instance of that error, and it's in an if block that reads as if (!path_is_directory(outputpath)), which means this shouldn't even be executing. I don't know why it's not reading this path as a directory, but it is, and then it seems to get confused and errors out.

note that if I do individual image files, webp seems to work fine, so I'm guessing this is a logic error in how whole directories are handled.

I'm on arch, and I've opened a bug there about this as well, in case this is an arch bug: https://aur.archlinux.org/packages/realesrgan-ncnn-vulkan#comment-874527

Please add armhf support (Raspberry Pi 4)

Hi,

it's not possible to run it on Raspberry Pi 4 at this moment:

pi@RPi4:/tmp/realesrgan-ncnn-vulkan-v0.2.0-ubuntu ./realesrgan-ncnn-vulkan
-bash: ./realesrgan-ncnn-vulkan: cannot execute binary file: Exec format error

Please add armhf support.

Thank you!
Feriman

High CPU usage and Low GPU

cpu

I'm running this code
python inference_realesrgan.py -n RealESRGAN_x4plus_anime_6B -i inputs --output "results/output_test" --fp32 --outscale 2

My input images is 576x1024

And my Graphic Card is RTX 3060 12GB

Is that normal?

How to use without files on disk?

Hi, Is it possible to pass a picture to a program without a file on disk (for example, using base64 string as an argument / stdin / etc) and get the output in the stdout (same as base64 / something else)?

错误

当我运行时什么都没有显示
截屏2022-03-17 19 23 00

Segfault on MacOS since upgrading to Ventura

I recently upgraded to MacOS Ventura and the binary no longer works.

I tried building it against latest Vulkan SDK and XCode 14.2, but it still segfaults.

Here's the segfault and crash data: https://github.com/slava-vishnyakov/Real-ESRGAN-ncnn-vulkan/actions/runs/5387126680/jobs/9778021348#step:6:23

Here are the changes necessary to build against latest VulkanSDK
https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan/compare/master...slava-vishnyakov:Real-ESRGAN-ncnn-vulkan:master?expand=1#diff-3ab46ee209a127470fce3c2cf106b1a1dbadbb929a4b5b13656a4bc4ce19c0b8R67-R99

Thank you for your work on this!

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.