2020-08-20 05:27:22 +08:00
|
|
|
import gradio as gr
|
2022-07-01 13:27:35 +08:00
|
|
|
import os
|
2020-08-20 05:27:22 +08:00
|
|
|
|
2022-01-21 21:44:12 +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
|
|
|
|
2022-01-21 21:44:12 +08:00
|
|
|
|
2022-07-19 23:53:01 +08:00
|
|
|
demo = gr.Interface(image_mod, gr.Image(type="pil"), "image",
|
2022-07-01 13:27:35 +08:00
|
|
|
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")
|
|
|
|
])
|
2022-03-29 05:22:49 +08:00
|
|
|
|
2020-10-23 22:28:30 +08:00
|
|
|
if __name__ == "__main__":
|
2022-03-29 05:22:49 +08:00
|
|
|
demo.launch()
|