图像上色 (Image-Colorization) 项目

你要的图像上色项目有啦!!

(1)ChromaGAN
colab打开可以直接运行
github:https://github.com/pvitoria/ChromaGAN
colab:https://colab.research.google.com/github/pvitoria/ChromaGAN/blob/master/DemoChromaGAN.ipynb
在这里插入图片描述

(2)Fully-Automatic-Video-Colorization-with-Self-Regularization-and-Diversity
https://github.com/ChenyangLEI/Fully-Automatic-Video-Colorization-with-Self-Regularization-and-Diversity
在这里插入图片描述

(3)Colorization
具有自动着色功能,可通过SIGGRAPH 2017年学习的Deep Priors进行实时用户指导的图像着色!
https://github.com/richzhang/colorization
在这里插入图片描述

(4)DeOldify
曾经上过热搜的修复百年前老北京的影像,就是用的这个算法。
一切都是现成的,用起来很简单。
在这里插入图片描述

DeOldify 就是一种对抗生成网络的应用。

其原理是使用 NoGAN 技术,它结合了 GAN 训练的优点,比如出色的上色效果,同时也消除了一些副作用,比如画面着色不稳定、闪烁的现象。

算法出了很久,算法原理教程应该很多,这里就不再累述,我们直接看怎么用吧。

https://github.com/jantic/DeOldify

需要配置的上文一样,安装一些库,然后下载模型权重文件。

项目工程页里详细说明了下载哪些文件,需要安装什么。

配置好后,在工程目录编写如下代码:

#NOTE:  This must be the first call in order to work properly!
from deoldify import device
from deoldify.device_id import DeviceId
#choices:  CPU, GPU0...GPU7
device.set(device=DeviceId.GPU0)
 
import torch
 
if not torch.cuda.is_available():
    print('GPU not available.')
    
import fastai
from deoldify.visualize import *
import warnings
warnings.filterwarnings("ignore", category=UserWarning, message=".*?Your .*? set is empty.*?")
 
colorizer = get_image_colorizer(artistic=True)
 
colorizer.plot_transformed_image("test_images/1.png", render_factor=10, compare=True)

test_images/1.png 为要上色的图片,运行程序,就可以实现为黑白照片上色。

推荐使用第四种,如果您觉得有用,记得一键三连!

  • 4
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值