2、DeOldify模型
老照片修复中黑白上色是必不可少的,其中DeOldify是图像上色领域比较有名的开源算法,模型利用resnet作为encoder构建一个unet结构的网络,并提出了多个不同的训练版本,在效果、效率、鲁棒性等等方面有良好的综合表现。

项目git地址:https://github.com/jantic/DeOldify
官方示例:


可以使用官方项目地址的算法实现,目前因为阿里达摩院已开源该模型,直接使用damo/cv_unet_image-colorization模型即可实现。
模型使用方法:
import cv2
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks
colorizer = pipeline(Tasks.image_colorization, model='damo/cv_unet_image-colorization')
result = colorizer('https://modelscope.oss-cn-beijing.aliyuncs.com/test/images/marilyn_monroe_4.jpg')
cv2.imwrite('result.png', result['output_img'])实测效果:



三、使用AI模型进行老照片修复的实现方案
未完待续
- 本文固定链接: http://ttfde.top/index.php/post/430.html
- 转载请注明: admin 于 TTF的家园 发表
《本文》有 0 条评论