Spaces:
Sleeping
Sleeping
Robert Boscacci commited on
Commit ·
1a26e22
1
Parent(s): 4c907c5
Fix examples
Browse files- .gitattributes +1 -0
- app.py +5 -7
- examples/wolf_1.png +3 -0
- examples/wolf_2.png +3 -0
.gitattributes
CHANGED
|
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 36 |
export.pkl filter=lfs diff=lfs merge=lfs -text
|
| 37 |
examples/forrest_1.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
examples/forrest_2.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 36 |
export.pkl filter=lfs diff=lfs merge=lfs -text
|
| 37 |
examples/forrest_1.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
examples/forrest_2.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
|
@@ -122,20 +122,18 @@ try:
|
|
| 122 |
outputs=output
|
| 123 |
)
|
| 124 |
|
| 125 |
-
# Use
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
str(Path("examples/forrest_2.png").resolve())
|
| 129 |
-
]
|
| 130 |
|
| 131 |
gr.Examples(
|
| 132 |
examples=example_paths,
|
| 133 |
inputs=input_image
|
| 134 |
)
|
| 135 |
|
| 136 |
-
allowed_paths =
|
| 137 |
|
| 138 |
-
# Launch the app, allow access to the examples directory for @Gradio
|
| 139 |
demo.launch(allowed_paths=allowed_paths) # ssr_mode=False
|
| 140 |
except Exception as e:
|
| 141 |
print(f"Error occurred: {e}")
|
|
|
|
| 122 |
outputs=output
|
| 123 |
)
|
| 124 |
|
| 125 |
+
# Use all images in the examples folder as examples
|
| 126 |
+
examples_dir = Path("examples").resolve()
|
| 127 |
+
example_paths = [str(p) for p in examples_dir.glob("*") if p.is_file()]
|
|
|
|
|
|
|
| 128 |
|
| 129 |
gr.Examples(
|
| 130 |
examples=example_paths,
|
| 131 |
inputs=input_image
|
| 132 |
)
|
| 133 |
|
| 134 |
+
allowed_paths = [str(examples_dir)]
|
| 135 |
|
| 136 |
+
# Launch the app, allow access to the entire examples directory for @Gradio
|
| 137 |
demo.launch(allowed_paths=allowed_paths) # ssr_mode=False
|
| 138 |
except Exception as e:
|
| 139 |
print(f"Error occurred: {e}")
|
examples/wolf_1.png
ADDED
|
Git LFS Details
|
examples/wolf_2.png
ADDED
|
Git LFS Details
|