Spaces:
Runtime error
Runtime error
Download app.py from Anushree1/ImageConvertor: direct link, hf CLI and curl.
- Browser
- Download file 635 Bytes
-
https://huggingface.co/spaces/Anushree1/ImageConvertor/resolve/main/app.py
- Command line
-
hf download hf://spaces/Anushree1/ImageConvertor/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Anushree1/ImageConvertor/resolve/main/app.py
635 Bytes
| 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() | |