Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| def main(image, backbone, style): | |
| isize = image.size | |
| 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!" | |
| return image, s | |
| gr.Interface( | |
| title = "Stylize", | |
| description = "Image generated based on Fast Style Transfer", | |
| fn = main, | |
| inputs = [ | |
| gr.inputs.Image(), | |
| gr.inputs.Radio(["VGG19", "Robust ResNet50", "Standard ResNet50"], label="Backbone"), | |
| gr.inputs.Dropdown(["The Scream", "Rain Princess"], type="value", default="Rain Princess", label="style") | |
| ], | |
| outputs = [gr.outputs.Image(label="Stylized"), gr.outputs.HTML(label="Comment")], | |
| # examples = [ | |
| # [] | |
| # ], | |
| # live = True, # the interface will recalculate as soon as the user input changes. | |
| flagging_options = ["Excellect", "Moderate", "Bad"], | |
| flagging_dir = "flagged", | |
| allow_screenshot = False, | |
| ).launch() | |
| # iface.launch(enable_queue=True, cache_examples=True, debug=True) |