Real-CUGAN - Real Cascade U-Nets for Anime Image Super Resolution

Overview

Real Cascade U-Nets for Anime Image Super Resolution

中文 | English

🔥 Real-CUGAN 🔥 是一个使用百万级动漫数据进行训练的,结构与Waifu2x兼容的通用动漫图像超分辨率模型。它支持2x\3x\4x倍超分辨率,其中2倍模型支持4种降噪强度与保守修复,3倍/4倍模型支持2种降噪强度与保守修复。

Real-CUGAN 为windows用户打包了一个可执行环境,未来将支持GUI。

1. 效果对比

demo-video.mp4
  • 效果图对比(推荐点开大图在原图分辨率下对比)
    纹理挑战型(注意地板纹理涂抹)(图源:《侦探已死》第一集10分20秒) compare1 线条挑战型(注意线条中心与边缘的虚实)(《东之伊甸》第四集7分30秒) compare2 极致渣清型(注意画风保留、杂线、线条)(图源:Real-ESRGAN官方测试样例) compare3 景深虚化型(蜡烛为后景,刻意加入了虚化特效,应该尽量保留原始版本不经过处理)(图源:《~闘志の華~戦国乙女2ボナ楽曲PV》第16秒) compare4
  • 详细对比
Waifu2x(CUNet) Real-ESRGAN(Anime6B) Real-CUGAN
训练集 私有二次元训练集,量级与质量未知 私有二次元训练集,量级与质量未知 百万级高清二次元patch dataset
推理耗时(1080P) Baseline 2.2x 1x
效果(见对比图) 无法去模糊,artifact去除不干净 锐化强度最大,容易改变画风,线条可能错判,
虚化区域可能强行清晰化
更锐利的线条,更好的纹理保留,虚化区域保留
兼容性 大量windows-APP使用,VapourSynth支持,
Caffe支持,PyTorch支持,NCNN支持
PyTorch支持,VapourSynth支持,NCNN支持 同Waifu2x,结构相同,参数不同,与Waifu2x无缝兼容
强度调整 仅支持多种降噪强度 不支持 已完成4种降噪程度版本和保守版,未来将支持调节不同去模糊、
去JPEG伪影、锐化、降噪强度
尺度 仅支持1倍和2倍 仅支持4倍 已支持2倍、3倍、4倍,1倍训练中

2. Windows玩家

修改config.py配置参数,双击go.bat运行

  • 超分工具:

    百度网盘(提取码ds2a) 🔗 GithubRelease 🔗 | 和彩云(提取码tX4O,手机号验证码登录,不限速无需客户端) 🔗 GoogleDrive 🔗

  • 系统环境:

    • ✔️ 在win10-64bit系统下进行测试
    • ✔️ 小包需求系统cuda >= 10.0. 【大包需求系统cuda >= 11.1】
    • 注意30系列 nvidia GPU 只能用大包.
  • 使用config文件说明:

    a. 通用参数设置

    • mode: 在其中填写video或者image决定超视频还是超图像;

    • scale: 超分倍率;

    • model_path: 填写模型参数路径(目前3倍4倍超分只有3个模型,2倍有4个不同降噪强度模型和1个保守模型);

    • device: 显卡设备号。如果有多卡超图片,建议手工将输入任务平分到不同文件夹,填写不同的卡号;

    • 超图像,需要填写输入输出文件夹;超视频,需要指定输入输出视频的路径。

    • 如果使用windows路径,需要在双引号前加r

    b. 超视频设置

    • nt: 每张卡的线程数,如果显存够用,建议填写>=2

    • n_gpu: 显卡数;

    • encode_params: 编码参数 {crf,preset}

      crf: 通俗来讲,crf变低=高码率高质量
      preset: 越慢代表越低编码速度越高质量+更吃CPU,CPU不够应该调低级别,比如slow,medium,fast,faster

    • half: 半精度推理,不建议关闭

    • tile: 有6种模式,数字越大显存需求越低,相对地可能会小幅降低推理速度 {0, 1, 2, 3, 4, auto}

      0: 直接使用整张图像进行推理,大显存用户或者低分辨率需求可使用
      1: 对长边平分切成两块推理(95%,显存占用,下同)
      2: 宽高分别平分切成两块推理(81%)
      3: 宽高分别平分切成三块推理(61%)
      4: 宽高分别平分切成四块推理(54%)
      auto: 当输入图片文件夹图片分辨率不同时,填写auto自动调节不同图片tile模式,未来将支持该模式。

  • 模型分类说明:

    • 降噪版:如果原片噪声多,压得烂,推荐使用;目前2倍模型支持了3个降噪等级;
    • 无降噪版:如果原片噪声不多,压得还行,但是想提高分辨率/清晰度/做通用性的增强、修复处理,推荐使用;
    • 保守版:如果你担心丢失纹理,担心画风被改变,担心颜色被增强,总之就是各种担心AI会留下浓重的处理痕迹,推荐使用该版本。

3. Waifu2x-caffe玩家

我们目前为waifu2x-caffe玩家提供了两套参数:

🔥 Real-CUGAN2x标准版(denoise-level3) 🔥 Real-CUGAN2x无切割线版
百度网盘(提取码ds2a) 🔗 GithubRelease 🔗 和彩云(提取码tX4O,手机号验证码登录,不限速无需客户端) 🔗 GoogleDrive 🔗
用户可以用这套参数覆盖原有model-cunet模型参数(如有需要,记得对原有参数进行备份),用原有被覆盖的预设(按当前的文件名,是2x仅超分不降噪)进行超分。

由于waifu2x-caffe的切割机制,对于标准版,crop_size应该尽量调大,否则可能造成切割线。如果发现出现切割线, 请移步下载windows应用,它支持无切割线痕迹的crop(tile_mode),既能有效降低显存占用需求,crop也是无损的。或者使用我们额外提供的无切割线版,它会造成更多的纹理涂抹和虚化区域清晰化。

开发者可以很轻松地进行适配,推荐使用整张图像作为输入。如果顾及显存问题,建议基于PyTorch版本进行开发,使用tile_mode降低显存占用需求。

4. Python玩家

环境依赖
torch>=1.0.0
numpy
opencv-python
moviepy
upcunet_v3.py:模型+图像推理
inference_video.py:一个简单的使用Real-CUGAN推理视频的脚本

5. VapourSynth玩家

移步Readme

6. 🏰 Model Zoo

可在网盘路径下载完整包与更新参数包获取各模型参数。

1倍 2倍 3倍/4倍
降噪程度 仅支持无降噪,训练中 现支持无降噪/1x/2x/3x 现支持无降噪/3x,1x/2x训练中
保守模型 训练中 已支持
快速模型 调研中

7. TODO:

  • 快速模型,提高推理速度,降低显存占用需求
  • 可调整的增强锐度,降噪强度,去模糊强度
  • 一步超到任意指定分辨率
  • 优化纹理保留,削减模型处理痕迹
  • 简单的GUI

😝 欢迎各位大佬在issue 😇 进行留言,提出各种建议和需求 👍 !

8. 感谢

这里不公开训练代码,训练步骤参考了但不局限于 🌟 RealESRGAN 🌟 . 想自行训练的请移步该仓库。

模型结构魔改自Waifu2x官方 🌟 CUNet 🌟 .

Owner
tarsin
tarsin
Gluon CV Toolkit

Gluon CV Toolkit | Installation | Documentation | Tutorials | GluonCV provides implementations of the state-of-the-art (SOTA) deep learning models in

Distributed (Deep) Machine Learning Community 5.4k Jan 06, 2023
Unofficial pytorch implementation of 'Image Inpainting for Irregular Holes Using Partial Convolutions'

pytorch-inpainting-with-partial-conv Official implementation is released by the authors. Note that this is an ongoing re-implementation and I cannot f

Naoto Inoue 525 Jan 01, 2023
A PyTorch implementation of the Relational Graph Convolutional Network (RGCN).

Torch-RGCN Torch-RGCN is a PyTorch implementation of the RGCN, originally proposed by Schlichtkrull et al. in Modeling Relational Data with Graph Conv

Thiviyan Singam 66 Nov 30, 2022
This repo contains the implementation of the algorithm proposed in Off-Belief Learning, ICML 2021.

Off-Belief Learning Introduction This repo contains the implementation of the algorithm proposed in Off-Belief Learning, ICML 2021. Environment Setup

Facebook Research 32 Jan 05, 2023
Implementing a simplified copy of Shazam application from scratch using MinHashing and LSH.

Building Shazam from scratch In this repository we tried to implement a simplified copy of the Shazam application able to tell you the name of a song

Arturo Ghinassi 0 Nov 17, 2022
A collection of Jupyter notebooks to play with NVIDIA's StyleGAN3 and OpenAI's CLIP for a text-based guided image generation.

StyleGAN3 CLIP-based guidance StyleGAN3 + CLIP StyleGAN3 + inversion + CLIP This repo is a collection of Jupyter notebooks made to easily play with St

Eugenio Herrera 176 Dec 30, 2022
PyAF is an Open Source Python library for Automatic Time Series Forecasting built on top of popular pydata modules.

PyAF (Python Automatic Forecasting) PyAF is an Open Source Python library for Automatic Forecasting built on top of popular data science python module

CARME Antoine 405 Jan 02, 2023
Generic Event Boundary Detection: A Benchmark for Event Segmentation

Generic Event Boundary Detection: A Benchmark for Event Segmentation We release our data annotation & baseline codes for detecting generic event bound

47 Nov 22, 2022
A parallel framework for population-based multi-agent reinforcement learning.

MALib: A parallel framework for population-based multi-agent reinforcement learning MALib is a parallel framework of population-based learning nested

MARL @ SJTU 348 Jan 08, 2023
PyTorch Autoencoders - Implementing a Variational Autoencoder (VAE) Series in Pytorch.

PyTorch Autoencoders Implementing a Variational Autoencoder (VAE) Series in Pytorch. Inspired by this repository Model List check model paper conferen

Subin An 8 Nov 21, 2022
TGS Salt Identification Challenge

TGS Salt Identification Challenge This is an open solution to the TGS Salt Identification Challenge. Note Unfortunately, we can no longer provide supp

neptune.ai 123 Nov 04, 2022
Code for the SIGGRAPH 2021 paper "Consistent Depth of Moving Objects in Video".

Consistent Depth of Moving Objects in Video This repository contains training code for the SIGGRAPH 2021 paper "Consistent Depth of Moving Objects in

Google 203 Jan 05, 2023
Oriented Response Networks, in CVPR 2017

Oriented Response Networks [Home] [Project] [Paper] [Supp] [Poster] Torch Implementation The torch branch contains: the official torch implementation

ZhouYanzhao 217 Dec 12, 2022
Segmentation models with pretrained backbones. PyTorch.

Python library with Neural Networks for Image Segmentation based on PyTorch. The main features of this library are: High level API (just two lines to

Pavel Yakubovskiy 6.6k Jan 06, 2023
CN24 is a complete semantic segmentation framework using fully convolutional networks

Build status: master (production branch): develop (development branch): Welcome to the CN24 GitHub repository! CN24 is a complete semantic segmentatio

Computer Vision Group Jena 123 Jul 14, 2022
A Framework for Encrypted Machine Learning in TensorFlow

TF Encrypted is a framework for encrypted machine learning in TensorFlow. It looks and feels like TensorFlow, taking advantage of the ease-of-use of t

TF Encrypted 0 Jul 06, 2022
Code of 3D Shape Variational Autoencoder Latent Disentanglement via Mini-Batch Feature Swapping for Bodies and Faces

3D Shape Variational Autoencoder Latent Disentanglement via Mini-Batch Feature Swapping for Bodies and Faces Installation After cloning the repo open

37 Dec 03, 2022
A machine learning malware analysis framework for Android apps.

🕵️ A machine learning malware analysis framework for Android apps. ☢️ DroidDetective is a Python tool for analysing Android applications (APKs) for p

James Stevenson 77 Dec 27, 2022
KoRean based ELECTRA pre-trained models (KR-ELECTRA) for Tensorflow and PyTorch

KoRean based ELECTRA (KR-ELECTRA) This is a release of a Korean-specific ELECTRA model with comparable or better performances developed by the Computa

12 Jun 03, 2022
Code Release for the paper "TriBERT: Full-body Human-centric Audio-visual Representation Learning for Visual Sound Separation"

TriBERT This repository contains the code for the NeurIPS 2021 paper titled "TriBERT: Full-body Human-centric Audio-visual Representation Learning for

UBC Computer Vision Group 8 Aug 31, 2022