kritsg commited on
Commit
6b38cd2
·
1 Parent(s): a9b677d

changed default parameter values, removed mp4 vid

Browse files
Files changed (2) hide show
  1. app.py +3 -5
  2. diego_mp4.mp4 +0 -0
app.py CHANGED
@@ -34,7 +34,7 @@ def segmentation_generation(image_name, c_width, n_top, n_gif_imgs):
34
  print("Inputs Received:", image_name, c_width, n_top, n_gif_imgs)
35
 
36
  image, model_and_data = get_image_data(image_name)
37
- # print("model_and_data", model_and_data)
38
  # Unpack datax
39
  xtest = model_and_data["xtest"]
40
  ytest = model_and_data["ytest"]
@@ -79,8 +79,6 @@ def segmentation_generation(image_name, c_width, n_top, n_gif_imgs):
79
  return create_gif(rout['blr'], image_name, segments, instance, prediction[0], n_gif_imgs, n_top)
80
 
81
  if __name__ == "__main__":
82
- # gradio's image inputs look like this: <PIL.Image.Image image mode=RGB size=305x266 at 0x7F3D01C91FA0>
83
- # need to learn how to handle image inputs, or deal with file inputs or just file path strings
84
  inp = gr.inputs.Image(label="Input Image (Or select an example)", type="pil")
85
  out = [gr.outputs.HTML(label="Output GIF"), gr.outputs.Textbox(label="Prediction")]
86
 
@@ -88,9 +86,9 @@ if __name__ == "__main__":
88
  segmentation_generation,
89
  [
90
  inp,
91
- gr.inputs.Slider(minimum=0.01, maximum=0.8, step=0.01, default=0.1, label="cred_width", optional=False),
92
  gr.inputs.Slider(minimum=1, maximum=10, step=1, default=5, label="n_top_segs", optional=False),
93
- gr.inputs.Slider(minimum=10, maximum=50, step=1, default=20, label="n_gif_images", optional=False),
94
  ],
95
  outputs=out,
96
  examples=[["./imagenet_diego.png", 0.01, 7, 50],
 
34
  print("Inputs Received:", image_name, c_width, n_top, n_gif_imgs)
35
 
36
  image, model_and_data = get_image_data(image_name)
37
+
38
  # Unpack datax
39
  xtest = model_and_data["xtest"]
40
  ytest = model_and_data["ytest"]
 
79
  return create_gif(rout['blr'], image_name, segments, instance, prediction[0], n_gif_imgs, n_top)
80
 
81
  if __name__ == "__main__":
 
 
82
  inp = gr.inputs.Image(label="Input Image (Or select an example)", type="pil")
83
  out = [gr.outputs.HTML(label="Output GIF"), gr.outputs.Textbox(label="Prediction")]
84
 
 
86
  segmentation_generation,
87
  [
88
  inp,
89
+ gr.inputs.Slider(minimum=0.01, maximum=0.8, step=0.01, default=0.01, 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=100, step=1, default=30, label="n_gif_images", optional=False),
92
  ],
93
  outputs=out,
94
  examples=[["./imagenet_diego.png", 0.01, 7, 50],
diego_mp4.mp4 DELETED
Binary file (34.9 kB)