{"id":13445228,"url":"https://github.com/nihui/realsr-ncnn-vulkan","last_synced_at":"2025-05-16T16:07:57.199Z","repository":{"id":40359077,"uuid":"266992649","full_name":"nihui/realsr-ncnn-vulkan","owner":"nihui","description":"RealSR super resolution implemented with ncnn library","archived":false,"fork":false,"pushed_at":"2023-03-12T03:03:53.000Z","size":63374,"stargazers_count":1139,"open_issues_count":40,"forks_count":113,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-12T14:58:10.670Z","etag":null,"topics":["amd","gpu","intel","ncnn","nvidia","realsr","vulkan"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nihui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"patreon":"nihui"}},"created_at":"2020-05-26T08:53:37.000Z","updated_at":"2025-04-09T08:35:55.000Z","dependencies_parsed_at":"2024-01-16T02:56:02.878Z","dependency_job_id":null,"html_url":"https://github.com/nihui/realsr-ncnn-vulkan","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealsr-ncnn-vulkan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealsr-ncnn-vulkan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealsr-ncnn-vulkan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nihui%2Frealsr-ncnn-vulkan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nihui","download_url":"https://codeload.github.com/nihui/realsr-ncnn-vulkan/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254564127,"owners_count":22092122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","gpu","intel","ncnn","nvidia","realsr","vulkan"],"created_at":"2024-07-31T05:00:27.113Z","updated_at":"2025-05-16T16:07:57.146Z","avatar_url":"https://github.com/nihui.png","language":"C","funding_links":["https://patreon.com/nihui"],"categories":["C","Application projects"],"sub_categories":["Super Resolution"],"readme":"# RealSR ncnn Vulkan\n\n![CI](https://github.com/nihui/realsr-ncnn-vulkan/workflows/CI/badge.svg)\n![download](https://img.shields.io/github/downloads/nihui/realsr-ncnn-vulkan/total.svg)\n\nncnn implementation of Real-World Super-Resolution via Kernel Estimation and Noise Injection super resolution.\n\nrealsr-ncnn-vulkan uses [ncnn project](https://github.com/Tencent/ncnn) as the universal neural network inference framework.\n\n## [Download](https://github.com/nihui/realsr-ncnn-vulkan/releases)\n\nDownload Windows/Linux/MacOS Executable for Intel/AMD/Nvidia GPU\n\n**https://github.com/nihui/realsr-ncnn-vulkan/releases**\n\nThis package includes all the binaries and models required. It is portable, so no CUDA or Caffe runtime environment is needed :)\n\n## About RealSR\n\nReal-World Super-Resolution via Kernel Estimation and Noise Injection (CVPRW 2020)\n\nhttps://github.com/jixiaozhong/RealSR\n\nXiaozhong Ji, Yun Cao, Ying Tai, Chengjie Wang, Jilin Li, and Feiyue Huang\n\n*Tencent YouTu Lab*\n\nOur solution is the **winner of CVPR NTIRE 2020 Challenge on Real-World Super-Resolution** in both tracks.\n\nhttps://arxiv.org/abs/2005.01996\n\n## Usages\n\n### Example Command\n\n```shell\nrealsr-ncnn-vulkan.exe -i input.jpg -o output.png -s 4\n```\n\n### Full Usages\n\n```console\nUsage: realsr-ncnn-vulkan -i infile -o outfile [options]...\n\n  -h                   show this help\n  -v                   verbose output\n  -i input-path        input image path (jpg/png/webp) or directory\n  -o output-path       output image path (jpg/png/webp) or directory\n  -s scale             upscale ratio (4, default=4)\n  -t tile-size         tile size (\u003e=32/0=auto, default=0) can be 0,0,0 for multi-gpu\n  -m model-path        realsr model path (default=models-DF2K_JPEG)\n  -g gpu-id            gpu device to use (-1=cpu, default=0) can be 0,1,2 for multi-gpu\n  -j load:proc:save    thread count for load/proc/save (default=1:2:2) can be 1:2,2,2:2 for multi-gpu\n  -x                   enable tta mode\n  -f format            output image format (jpg/png/webp, default=ext/png)\n```\n\n- `input-path` and `output-path` accept either file path or directory path\n- `scale` = scale level, 4 = upscale 4x\n- `tile-size` = tile size, use smaller value to reduce GPU memory usage, default selects automatically\n- `load:proc:save` = thread count for the three stages (image decoding + realsr 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.\n- `format` = the format of the image to be output, png is better supported, however webp generally yields smaller file sizes, both are losslessly encoded\n\nIf you encounter crash or error, try to upgrade your GPU driver\n\n- Intel: https://downloadcenter.intel.com/product/80939/Graphics-Drivers\n- AMD: https://www.amd.com/en/support\n- NVIDIA: https://www.nvidia.com/Download/index.aspx\n\n## Build from Source\n\n1. Download and setup the Vulkan SDK from https://vulkan.lunarg.com/\n  - For Linux distributions, you can either get the essential build requirements from package manager\n```shell\ndnf install vulkan-headers vulkan-loader-devel\n```\n```shell\napt-get install libvulkan-dev\n```\n```shell\npacman -S vulkan-headers vulkan-icd-loader\n```\n\n2. Clone this project with all submodules\n\n```shell\ngit clone https://github.com/nihui/realsr-ncnn-vulkan.git\ncd realsr-ncnn-vulkan\ngit submodule update --init --recursive\n```\n\n3. Build with CMake\n  - You can pass -DUSE_STATIC_MOLTENVK=ON option to avoid linking the vulkan loader library on MacOS\n\n```shell\nmkdir build\ncd build\ncmake ../src\ncmake --build . -j 4\n```\n\n## Sample Images\n\n### Original Image\n\n![origin](images/0.png)\n\n### Upscale 4x with ImageMagick Lanczo4 Filter\n\n```shell\nconvert origin.jpg -resize 400% output.png\n```\n\n![browser](images/im.png)\n\n### Upscale 4x with srmd scale=4 noise=-1\n\n```shell\nsrmd-ncnn-vulkan.exe -i origin.jpg -o 4x.png -s 4 -n -1\n```\n\n![waifu2x](images/srmd.png)\n\n### Upscale 4x with realsr model=DF2K scale=4 tta=1\n\n```shell\nrealsr-ncnn-vulkan.exe -i origin.jpg -o output.png -s 4 -x -m models-DF2K\n```\n\n![realsr](images/2.png)\n\n## Original RealSR Project\n\n- https://github.com/jixiaozhong/RealSR\n\n## Other Open-Source Code Used\n\n- https://github.com/Tencent/ncnn for fast neural network inference on ALL PLATFORMS\n- https://github.com/webmproject/libwebp for encoding and decoding Webp images on ALL PLATFORMS\n- https://github.com/nothings/stb for decoding and encoding image on Linux / MacOS\n- https://github.com/tronkko/dirent for listing files in directory on Windows\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Frealsr-ncnn-vulkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnihui%2Frealsr-ncnn-vulkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnihui%2Frealsr-ncnn-vulkan/lists"}