INNER CODE UNIT · Python

sketch2anime

Mukosame/Anime2Sketch · gradiodemo.py:19

def sketch2anime(img, load_size=512):
    img, aus_resize = read_img_path(img.name, load_size)
    aus_tensor = model(img)
    aus_img = tensor_to_img(aus_tensor)
    image_pil = Image.fromarray(aus_img)
    image_pil = image_pil.resize(aus_resize, Image.BICUBIC)
    return image_pil

  
title = "Anime2Sketch"
description = "demo for Anime2Sketch. To use it, simply upload your image, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2104.05703'>Adversarial Open Domain Adaption for Sketch-to-Photo Synthesis</a> | <a href='https://github.com/Mukosame/Anime2Sketch'>Github Repo</a></p>"

gr.Interface(
    sketch2anime, 
    [gr.inputs.Image(type="file", label="Input")], 
    gr.outputs.Image(type="pil", label="Output"),
    title=title,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…