Spaces:
Runtime error
Runtime error
John Smith
commited on
Commit
·
9c47ef4
1
Parent(s):
2cfa253
Update app.py
Browse files
app.py
CHANGED
@@ -1,25 +1,22 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
|
4 |
-
def
|
5 |
-
return
|
6 |
|
7 |
|
8 |
demo = gr.Interface(
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
15 |
],
|
16 |
-
"text",
|
17 |
-
#examples=[
|
18 |
-
# [2, "cat", ["Japan", "Pakistan"], "park", ["ate", "swam"], True],
|
19 |
-
# [4, "dog", ["Japan"], "zoo", ["ate", "swam"], False],
|
20 |
-
# [10, "bird", ["USA", "Pakistan"], "road", ["ran"], False],
|
21 |
-
# [8, "cat", ["Pakistan"], "zoo", ["ate"], True],
|
22 |
-
#]
|
23 |
)
|
24 |
|
25 |
if __name__ == "__main__":
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
|
4 |
|
5 |
+
def image_mod(image):
|
6 |
+
return image.rotate(45)
|
7 |
|
8 |
|
9 |
demo = gr.Interface(
|
10 |
+
image_mod,
|
11 |
+
gr.Image(type="pil"),
|
12 |
+
"image",
|
13 |
+
flagging_options=["blurry", "incorrect", "other"],
|
14 |
+
examples=[
|
15 |
+
os.path.join(os.path.dirname(__file__), "images/cheetah1.jpg"),
|
16 |
+
os.path.join(os.path.dirname(__file__), "images/lion.jpg"),
|
17 |
+
os.path.join(os.path.dirname(__file__), "images/logo.png"),
|
18 |
+
os.path.join(os.path.dirname(__file__), "images/tower.jpg"),
|
19 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
)
|
21 |
|
22 |
if __name__ == "__main__":
|