File size: 742 Bytes
37c8c8d
 
 
 
 
 
a8e3ada
37c8c8d
 
 
 
 
 
 
a8e3ada
37c8c8d
 
57b6fb2
37c8c8d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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)