gradio/demo/image_mod/run.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
561 B
Python
Raw Normal View History

2020-08-20 05:27:22 +08:00
import gradio as gr
import os
2020-08-20 05:27:22 +08:00
2020-08-20 05:27:22 +08:00
def image_mod(image):
2020-08-22 05:20:05 +08:00
return image.rotate(45)
2020-08-20 05:27:22 +08:00
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"),
os.path.join(os.path.dirname(__file__), "images/tower.jpg"),
],
)
2022-03-29 05:22:49 +08:00
if __name__ == "__main__":
2022-03-29 05:22:49 +08:00
demo.launch()