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
Code for "ShineOn: Illuminating Design Choices for Practical Video-based Virtual Clothing Try-on", accepted at WACV 2021 Generation of Human Behavior Workshop.

ShineOn: Illuminating Design Choices for Practical Video-based Virtual Clothing Try-on [ Paper ] [ Project Page ] This repository contains the code fo

Andrew Jong 97 Dec 13, 2022
Convolutional neural network that analyzes self-generated images in a variety of languages to find etymological similarities

This project is a convolutional neural network (CNN) that analyzes self-generated images in a variety of languages to find etymological similarities. Specifically, the goal is to prove that computer

1 Feb 03, 2022
Implement the Pareto Optimizer and pcgrad to make a self-adaptive loss for multi-task

multi-task_losses_optimizer Implement the Pareto Optimizer and pcgrad to make a self-adaptive loss for multi-task 已经实验过了,不会有cuda out of memory情况 ##Par

14 Dec 25, 2022
Frigate - NVR With Realtime Object Detection for IP Cameras

A complete and local NVR designed for HomeAssistant with AI object detection. Uses OpenCV and Tensorflow to perform realtime object detection locally for IP cameras.

Blake Blackshear 6.4k Dec 31, 2022
PyTorch implementation for View-Guided Point Cloud Completion

PyTorch implementation for View-Guided Point Cloud Completion

22 Jan 04, 2023
Source code of the paper "Deep Learning of Latent Variable Models for Industrial Process Monitoring".

Source code of the paper "Deep Learning of Latent Variable Models for Industrial Process Monitoring".

Xiangyin Kong 7 Nov 08, 2022
Aspect-Sentiment-Multiple-Opinion Triplet Extraction (NLPCC 2021)

The code and data for the paper "Aspect-Sentiment-Multiple-Opinion Triplet Extraction" Requirements Python 3.6.8 torch==1.2.0 pytorch-transformers==1.

慢半拍 5 Jul 02, 2022
A MatConvNet-based implementation of the Fully-Convolutional Networks for image segmentation

MatConvNet implementation of the FCN models for semantic segmentation This package contains an implementation of the FCN models (training and evaluati

VLFeat.org 175 Feb 18, 2022
A pytorch reprelication of the model-based reinforcement learning algorithm MBPO

Overview This is a re-implementation of the model-based RL algorithm MBPO in pytorch as described in the following paper: When to Trust Your Model: Mo

Xingyu Lin 93 Jan 05, 2023
Py-FEAT: Python Facial Expression Analysis Toolbox

Py-FEAT is a suite for facial expressions (FEX) research written in Python. This package includes tools to detect faces, extract emotional facial expressions (e.g., happiness, sadness, anger), facial

Computational Social Affective Neuroscience Laboratory 147 Jan 06, 2023
Create Data & AI apps in 20 lines of code with Shimoku

Install with: pip install shimoku-api-python Start with: from os import getenv import shimoku_api_python.client as Shimoku

Shimoku 5 Nov 07, 2022
PyTorch-Multi-Style-Transfer - Neural Style and MSG-Net

PyTorch-Style-Transfer This repo provides PyTorch Implementation of MSG-Net (ours) and Neural Style (Gatys et al. CVPR 2016), which has been included

Hang Zhang 906 Jan 04, 2023
A code implementation of AC-GC: Activation Compression with Guaranteed Convergence, in NeurIPS 2021.

Code For AC-GC: Lossy Activation Compression with Guaranteed Convergence This code is intended to be used as a supplemental material for submission to

Dave Evans 2 Nov 01, 2022
Official Implementation for Fast Training of Neural Lumigraph Representations using Meta Learning.

Fast Training of Neural Lumigraph Representations using Meta Learning Project Page | Paper | Data Alexander W. Bergman, Petr Kellnhofer, Gordon Wetzst

Alex 39 Oct 08, 2022
A Transformer-Based Siamese Network for Change Detection

ChangeFormer: A Transformer-Based Siamese Network for Change Detection (Under review at IGARSS-2022) Wele Gedara Chaminda Bandara, Vishal M. Patel Her

Wele Gedara Chaminda Bandara 214 Dec 29, 2022
MassiveSumm: a very large-scale, very multilingual, news summarisation dataset

MassiveSumm: a very large-scale, very multilingual, news summarisation dataset This repository contains links to data and code to fetch and reproduce

Daniel Varab 19 Dec 16, 2022
This project is used for the paper Differentiable Programming of Isometric Tensor Network

This project is used for the paper "Differentiable Programming of Isometric Tensor Network". (arXiv:2110.03898)

Chenhua Geng 15 Dec 13, 2022
Vision-and-Language Navigation in Continuous Environments using Habitat

Vision-and-Language Navigation in Continuous Environments (VLN-CE) Project Website — VLN-CE Challenge — RxR-Habitat Challenge Official implementations

Jacob Krantz 132 Jan 02, 2023
Implementation of Rotary Embeddings, from the Roformer paper, in Pytorch

Rotary Embeddings - Pytorch A standalone library for adding rotary embeddings to transformers in Pytorch, following its success as relative positional

Phil Wang 110 Dec 30, 2022
Self-Supervised CNN-GCN Autoencoder

GCNDepth Self-Supervised CNN-GCN Autoencoder GCNDepth: Self-supervised monocular depth estimation based on graph convolutional network To be published

53 Dec 14, 2022