Spaces:
Runtime error
Runtime error
Upload 3 files
Browse files- .gitattributes +2 -0
- app.py +17 -4
- images-to-blur/dogs.jpg +3 -0
- images-to-blur/hat_sunglasses.jpg +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
images-to-blur/dogs.jpg filter=lfs diff=lfs merge=lfs -text
|
37 |
+
images-to-blur/hat_sunglasses.jpg filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
from image_blurring import BlurImage
|
3 |
|
@@ -7,10 +8,22 @@ if __name__ == "__main__":
|
|
7 |
blur_image = BlurImage(device=None)
|
8 |
gr_interface = gr.Interface(
|
9 |
fn=lambda image, prompt, intensity, save=False: blur_image.blur(image, prompt.split("\n"), intensity, save=save),
|
10 |
-
inputs=[gr.Image(type="pil"),
|
11 |
-
gr.Textbox(lines=3, placeholder="jacket\ndog head\netc..."),
|
12 |
gr.Slider(minimum=0, maximum=400, step=10, value=50, label="Blur intensity")],
|
13 |
-
outputs=gr.Image(type="pil"),
|
14 |
-
title="Blur Objects by Prompts"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
)
|
16 |
gr_interface.launch()
|
|
|
1 |
+
import os
|
2 |
import gradio as gr
|
3 |
from image_blurring import BlurImage
|
4 |
|
|
|
8 |
blur_image = BlurImage(device=None)
|
9 |
gr_interface = gr.Interface(
|
10 |
fn=lambda image, prompt, intensity, save=False: blur_image.blur(image, prompt.split("\n"), intensity, save=save),
|
11 |
+
inputs=[gr.Image(type="pil", label="Image"),
|
12 |
+
gr.Textbox(lines=3, placeholder="jacket\ndog head\netc...", label="Prompt"),
|
13 |
gr.Slider(minimum=0, maximum=400, step=10, value=50, label="Blur intensity")],
|
14 |
+
outputs=gr.Image(type="pil", label="Output"),
|
15 |
+
title="Blur Objects by Prompts",
|
16 |
+
examples=[
|
17 |
+
[os.path.join(os.path.dirname(__file__),
|
18 |
+
"images-to-blur",
|
19 |
+
"dogs.jpg"),
|
20 |
+
"jacket",
|
21 |
+
50],
|
22 |
+
[os.path.join(os.path.dirname(__file__),
|
23 |
+
"images-to-blur",
|
24 |
+
"hat_sunglasses.jpg"),
|
25 |
+
"hat\nsunglasses",
|
26 |
+
150]
|
27 |
+
]
|
28 |
)
|
29 |
gr_interface.launch()
|
images-to-blur/dogs.jpg
ADDED
Git LFS Details
|
images-to-blur/hat_sunglasses.jpg
ADDED
Git LFS Details
|