LoginSignup
7
6

More than 1 year has passed since last update.

ビリビリ! アニメの超解像モデル

Last updated at Posted at 2022-02-04

アニメに最適化された超解像モデルを使う方法です

元画像
超解像

何気なくみているアニメも実はアーティファクトがあったりする

Real-CUGANでスッキリ

ノイズを取り除き、4倍にまで超解像できます。

方法

リポジトリをクローンして、事前トレーニング済みのweightをダウンロードします。

upcunet_v3.pyからモデルをインポートして実行します。

import cv2
upscaler2x = RealWaifuUpScaler(4, "/content/drive/MyDrive/updated_weights/up4x-latest-denoise3x.pth", half=True, device="cuda:0")
frame = cv2.imread("im.png")
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
result = upscaler2x(frame, tile_mode=tile_mode)[:, :, ::-1]
cv2.imwrite("result.png", result)

元画像
mononoke.jpeg
超解像
cfdba9d8-3348-43ca-9897-ad2218efe811

拡大して比べてみると、綺麗になっているのがわかります。
元画像
超解像

動画にも

リポジトリにはビデオに適用できるスクリプトもあります。

🐣


フリーランスエンジニアです。
お仕事のご相談こちらまで
rockyshikoku@gmail.com

Core MLやARKitを使ったアプリを作っています。
機械学習/AR関連の情報を発信しています。

Twitter
Medium

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6