gradio/demo/image_mod/run.py
Freddy Boulton 4a1879edaf
Remove usage of deprecated gr.inputs and gr.outputs from website (#1796)
* remove deprecated api from docs

* Remove usage of 'state' shortcut

* Back out state changes

* Back out state changes in creating_a_chatbot

* Link chatbot guide to Variable docs
2022-07-19 11:53:01 -04:00

18 lines
476 B
Python

import gradio as gr
import os
def image_mod(image):
return image.rotate(45)
demo = gr.Interface(image_mod, gr.Image(type="pil"), "image",
flagging_options=["blurry", "incorrect", "other"], examples=[
os.path.join(os.path.dirname(__file__), "images/cheetah1.jpg"),
os.path.join(os.path.dirname(__file__), "images/lion.jpg"),
os.path.join(os.path.dirname(__file__), "images/logo.png")
])
if __name__ == "__main__":
demo.launch()