File size: 557 Bytes
5f84b05
3e04c68
5f84b05
 
 
 
67f9374
68891a4
67f9374
 
68891a4
5f84b05
68891a4
 
 
 
 
 
d485f5c
68891a4
 
5f84b05
 
3e04c68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import gradio as gr
from gradio.media import get_image, MEDIA_PATHS

def image_mod(image):
    return image.rotate(45)

# get_image() returns file paths to sample media included with Gradio
new_samples = [
    [get_image("logo.png")],
    [get_image("tower.jpg")],
]

with gr.Blocks() as demo:
    interface = gr.Interface(
        image_mod,
        gr.Image(type="pil"),
        "image",
        flagging_options=["blurry", "incorrect", "other"],
        api_name="predict",
    )


if __name__ == "__main__":
    demo.launch(allowed_paths=[MEDIA_PATHS])