百年老照片修復(fù)算法,那些高顏值的父母!
點(diǎn)擊上方“Jack Cui”,選擇“加為星標(biāo)”
第一時(shí)間關(guān)注技術(shù)干貨!

1



2
黑白照片上色,是一個(gè)經(jīng)典上色老算法(2018年):
「DeOldify」


git clone https://github.com/microsoft/Bringing-Old-Photos-Back-to-Lifecd Face_Enhancement/models/networks/git clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorchcp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .cd ../../../cd Global/detection_modelsgit clone https://github.com/vacancy/Synchronized-BatchNorm-PyTorchcp -rf Synchronized-BatchNorm-PyTorch/sync_batchnorm .cd ../../
cd Face_Detection/wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2bzip2 -d shape_predictor_68_face_landmarks.dat.bz2cd ../
python run.py --input_folder [test_image_folder_path] \--output_folder [output_path] \--GPU 0
將你想修復(fù)的圖片放到 [test_image_folder_path] 目錄下(自己指定),生成的圖片會(huì)放到 [output_path] 目錄中。
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 devicefrom deoldify.device_id import DeviceId#choices: CPU, GPU0...GPU7device.set(device=DeviceId.GPU0)import torchif not torch.cuda.is_available():print('GPU not available.')import fastaifrom deoldify.visualize import *import warningswarnings.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

本文轉(zhuǎn)載自Jack Cui公眾號(hào),感興趣的小伙伴可以關(guān)注一下哦。

評(píng)論
圖片
表情
