akhaliq's picture
akhaliq HF staff
Update app.py
57b6fb2
raw
history blame contribute delete
No virus
742 Bytes
import gradio as gr
import cv2
import paddlehub as hub
from PIL import Image
import numpy as np
model = hub.Module(name='animegan_v2_paprika_98', use_gpu=False)
def inference(img):
result = model.style_transfer(images=[cv2.imread(img)])
return result[0][:,:,::-1]
title="animegan_v2_paprika_98"
description="AnimeGAN V2 image style conversion model, the model can convert the input image into the red pepper anime style, and the model weights are converted from the AnimeGAN V2 official open source project ."
examples=[['city.jpeg'],['catonnx.jpg'],['dog.jpg']]
gr.Interface(inference,gr.inputs.Image(type="filepath"),gr.outputs.Image(type="numpy"),title=title,description=description,examples=examples).launch(enable_queue=True)