gradio/demo/image_mod.py

23 lines
431 B
Python
Raw Normal View History

2020-08-22 05:20:05 +08:00
# Demo: (Image) -> (Image)
2020-08-20 05:27:22 +08:00
import gradio as gr
def image_mod(image):
2020-08-22 05:20:05 +08:00
return image.rotate(45)
2020-08-20 05:27:22 +08:00
io = gr.Interface(image_mod,
2020-08-20 05:27:22 +08:00
gr.inputs.Image(type="pil"),
2020-09-03 00:18:00 +08:00
"image",
2020-08-20 05:27:22 +08:00
examples=[
["images/cheetah1.jpg"],
["images/cheetah2.jpg"],
["images/lion.jpg"],
2020-08-20 21:06:06 +08:00
],
live=True,
)
2020-08-28 23:56:03 +08:00
io.test_launch()
io.launch()