百年老照片修复算法,那些高颜值的父母!
点击上方“Jack Cui”,选择“加为星标”
第一时间关注技术干货!
1
你们家里,有没有高颜值的长辈老照片?
亦或是黑白、亦或是模糊,甚至是褶皱破损。
老照片承载着生命中的每一份意义,那是一代代人的回忆。
今天,Jack Cui 教大家两个算法,帮你搞定不清晰的、褶皱的老照片,黑白照片变彩照。
模糊照片,一键高清:
褶皱照片,一键复原:
黑白照片,一键上色:
在这个人工智能的时代,算法都能帮你搞定!
2
黑白照片上色,是一个经典上色老算法(2018年):
「DeOldify」
git clone https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life
cd Face_Enhancement/models/networks/
git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
cd ../../../
cd Global/detection_models
git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorch
cp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .
cd ../../
cd Face_Detection/
wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2
bzip2 -d shape_predictor_68_face_landmarks.dat.bz2
cd ../
python run.py --input_folder [test_image_folder_path] \
--output_folder [output_path] \
--GPU 0
python run.py --input_folder [test_image_folder_path] \
--output_folder [output_path] \
--GPU 0 \
--with_scratch
2、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)
3
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。