5.8 KiB
5.8 KiB
In [ ]:
from os import path
import torchIn [ ]:
!git clone -b FastAIv1 --single-branch https://github.com/jantic/DeOldify.git DeOldify
#!git clone https://github.com/jantic/DeOldify.git DeOldify In [ ]:
cd DeOldifyIn [ ]:
!pip install -e .In [ ]:
import fastai
from fasterai.visualize import *
from pathlib import Path
torch.backends.cudnn.benchmark=TrueIn [ ]:
!mkdir 'models'
!wget wget https://www.dropbox.com/s/zkehq1uwahhbc2o/ColorizeArtistic_gen.pth?dl=0 -O ./models/ColorizeArtistic_gen.pthIn [ ]:
colorizer = get_image_colorizer(artistic=True)In [ ]:
source_url = '' #@param {type:"string"}
render_factor = 35 #@param {type: "slider", min: 7, max: 46}
if source_url is not None and source_url !='':
image_path = colorizer.plot_transformed_image_from_url(url=source_url, render_factor=render_factor)
show_image_in_notebook(image_path)
else:
print('Provide an image url and try again.')