mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-21 02:19:59 +08:00
21 lines
433 B
Python
21 lines
433 B
Python
# Demo: (Image) -> (Image)
|
|
|
|
import gradio as gr
|
|
from time import time
|
|
from PIL import Image
|
|
|
|
|
|
def image_mod(image):
|
|
return image.rotate(45)
|
|
|
|
|
|
gr.Interface(image_mod,
|
|
gr.inputs.Image(type="pil"),
|
|
"image",
|
|
examples=[
|
|
["images/cheetah1.jpg"],
|
|
["images/cheetah2.jpg"],
|
|
["images/lion.jpg"],
|
|
],
|
|
).launch(share=True)
|