File size: 635 Bytes
0601827
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
import tensorflow as tf
import numpy as np
import cv2
from model import load_model, generate_anime_image

def process_image(image):
    image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
    anime_image = generate_anime_image(image)
    return cv2.cvtColor(anime_image, cv2.COLOR_BGR2RGB)

model = load_model("AnimeGANv2_Hayao")

demo = gr.Interface(
    fn=process_image,
    inputs=gr.Image(type="numpy"),
    outputs=gr.Image(type="numpy"),
    title="AnimeGANv2 - Ghibli Style Converter",
    description="Upload an image and convert it into a Studio Ghibli-style anime picture using AnimeGANv2.",
)

demo.launch()