6.9 KiB
6.9 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 DeOldifyIn [ ]:
cd DeOldifyIn [ ]:
!pip install PyDrive
!pip install ffmpeg-python
!pip install youtube-dl
!pip install tensorboardXIn [ ]:
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"}In [ ]:
render_factor = 35 #@param {type: "slider", min: 7, max: 46}In [ ]:
if source_url is not None and source_url !='':
colorizer.plot_transformed_image_from_url(url=source_url, render_factor=render_factor)
else:
print('Provide an image url and try again.')