Spaces:
Runtime error
Runtime error
added slider inputs for parameters
Browse files
app.py
CHANGED
|
@@ -32,10 +32,10 @@ def get_image_data():
|
|
| 32 |
return puppy_image, model_and_data
|
| 33 |
|
| 34 |
|
| 35 |
-
def segmentation_generation(image_name):
|
| 36 |
-
cred_width =
|
| 37 |
-
n_top_segs =
|
| 38 |
-
n_gif_images =
|
| 39 |
puppy_image, model_and_data = get_image_data()
|
| 40 |
|
| 41 |
# Unpack datax
|
|
@@ -82,5 +82,12 @@ if __name__ == "__main__":
|
|
| 82 |
inp = gr.inputs.Image(label="Input Image", type="pil")
|
| 83 |
out = gr.outputs.Video(label="Output Image")
|
| 84 |
|
| 85 |
-
iface = gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
iface.launch()
|
|
|
|
| 32 |
return puppy_image, model_and_data
|
| 33 |
|
| 34 |
|
| 35 |
+
def segmentation_generation(image_name, c_width, n_top, n_gif_imgs):
|
| 36 |
+
cred_width = c_width
|
| 37 |
+
n_top_segs = n_top
|
| 38 |
+
n_gif_images = n_gif_imgs
|
| 39 |
puppy_image, model_and_data = get_image_data()
|
| 40 |
|
| 41 |
# Unpack datax
|
|
|
|
| 82 |
inp = gr.inputs.Image(label="Input Image", type="pil")
|
| 83 |
out = gr.outputs.Video(label="Output Image")
|
| 84 |
|
| 85 |
+
iface = gr.Interface(
|
| 86 |
+
segmentation_generation,
|
| 87 |
+
[
|
| 88 |
+
inp,
|
| 89 |
+
gr.inputs.Slider(minimum=0.001, maximum=0.8, step=0.001, default=0.1, label="cred_width", optional=False),
|
| 90 |
+
gr.inputs.Slider(minimum=1, maximum=10, step=1, default=5, label="n_top_segs", optional=False),
|
| 91 |
+
gr.inputs.Slider(minimum=10, maximum=50, step=1, default=20, label="n_gif_images", optional=False),
|
| 92 |
+
], outputs=out, examples=[["./imagenet_diego.png"]])
|
| 93 |
iface.launch()
|