Spaces:
Runtime error
Runtime error
| 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() | |