Anushree1 commited on
Commit
0601827
·
verified ·
1 Parent(s): 626547a

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import tensorflow as tf
3
+ import numpy as np
4
+ import cv2
5
+ from model import load_model, generate_anime_image
6
+
7
+ def process_image(image):
8
+ image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
9
+ anime_image = generate_anime_image(image)
10
+ return cv2.cvtColor(anime_image, cv2.COLOR_BGR2RGB)
11
+
12
+ model = load_model("AnimeGANv2_Hayao")
13
+
14
+ demo = gr.Interface(
15
+ fn=process_image,
16
+ inputs=gr.Image(type="numpy"),
17
+ outputs=gr.Image(type="numpy"),
18
+ title="AnimeGANv2 - Ghibli Style Converter",
19
+ description="Upload an image and convert it into a Studio Ghibli-style anime picture using AnimeGANv2.",
20
+ )
21
+
22
+ demo.launch()