6.3 KiB
6.3 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 -e .In [ ]:
import fastai
from fasterai.visualize import *
from pathlib import Path
torch.backends.cudnn.benchmark=TrueIn [ ]:
!mkdir 'models'
!wget https://www.dropbox.com/s/336vn9y4qwyg9yz/ColorizeVideo_gen.pth?dl=0 -O ./models/ColorizeVideo_gen.pthIn [ ]:
colorizer = get_video_colorizer()In [ ]:
source_url = '' #@param {type:"string"}
render_factor = 21 #@param {type: "slider", min: 7, max: 46}
if source_url is not None and source_url !='':
video_path = colorizer.colorize_from_url(source_url, 'video.mp4', render_factor)
show_video_in_notebook(video_path)
else:
print('Provide a video url and try again.')