maze commited on
Commit
756e2bd
β€’
1 Parent(s): 63fb4a0

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -0
app.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ def main(image, backbone, style):
4
+ isize = image.size
5
+ s = f"The output image ({str(image.size)}) is processed by {backbone} based on input image ({str(isize)}) . <br> Please <b>rate</b> the generated image through the <b>Flag</b> button below!"
6
+ return image, s
7
+
8
+
9
+ gr.Interface(
10
+ title = "Stylize",
11
+ description = "Image generated based on Fast Style Transfer",
12
+ fn = main,
13
+ inputs = [
14
+ gr.inputs.Image(),
15
+ gr.inputs.Radio(["VGG19", "Robust ResNet50", "Standard ResNet50"], label="Backbone"),
16
+ gr.inputs.Dropdown(["The Scream", "Rain Princess"], type="value", default="Rain Princess", label="style")
17
+ ],
18
+ outputs = [gr.outputs.Image(label="Stylized"), gr.outputs.HTML(label="Comment")],
19
+ # examples = [
20
+ # []
21
+ # ],
22
+ # live = True, # the interface will recalculate as soon as the user input changes.
23
+ flagging_options = ["Excellect", "Moderate", "Bad"],
24
+ flagging_dir = "flagged",
25
+ allow_screenshot = False,
26
+ ).launch()
27
+ # iface.launch(enable_queue=True, cache_examples=True, debug=True)