Skip to content

Instantly share code, notes, and snippets.

@ucalyptus2
Last active August 8, 2020 19:40
Show Gist options
  • Save ucalyptus2/3d6fccc0abcc7e63703b4088efebdd5a to your computer and use it in GitHub Desktop.
Save ucalyptus2/3d6fccc0abcc7e63703b4088efebdd5a to your computer and use it in GitHub Desktop.
import fastai
from deoldify.visualize import *
import warnings
warnings.filterwarnings("ignore", category=UserWarning, message=".*?Your .*? set is empty.*?")
colorizer = get_image_colorizer(artistic=True)
source_url = 'https://i.guim.co.uk/img/media/3b24aa6da654484f8bdd4503b13b221d9f33b5d4/0_189_1892_1134/master/1892.jpg?width=1140&quality=85&auto=format&fit=max&s=58c31007e91ac090f34bd5f59b827895' #@param {type:"string"}
render_factor = 35 #@param {type: "slider", min: 7, max: 40}
watermarked = False #@param {type:"boolean"}
if source_url is not None and source_url !='':
image_path = colorizer.plot_transformed_image_from_url(url=source_url, render_factor=render_factor, compare=True, watermarked=watermarked)
else:
print('Provide an image url and try again.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment