emilios commited on
Commit
fae1918
·
verified ·
1 Parent(s): 6b5d307

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -2
app.py CHANGED
@@ -4,7 +4,7 @@ import numpy as np
4
 
5
 
6
 
7
- def inference(img,v1='121',v2='3'):
8
  #out = cv2.erode(img,(15,15))
9
  #out = cv2.dilate(out,(55,55))
10
  # https://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.remove_small_objects
@@ -34,12 +34,32 @@ def inference(img,v1='121',v2='3'):
34
 
35
  return out
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  # For information on Interfaces, head to https://gradio.app/docs/
38
  # For user guides, head to https://gradio.app/guides/
39
  # For Spaces usage, head to https://huggingface.co/docs/hub/spaces
40
  iface = gradio.Interface(
41
  fn=inference,
42
- inputs=['image','v1','v2'],
43
  outputs='image',
44
  title='Noise Removal',
45
  description='Remove Noise with OpenCV and Adaptial Gaussian!',
 
4
 
5
 
6
 
7
+ def inference(img,v1,v2):
8
  #out = cv2.erode(img,(15,15))
9
  #out = cv2.dilate(out,(55,55))
10
  # https://scikit-image.org/docs/dev/api/skimage.morphology.html#skimage.morphology.remove_small_objects
 
34
 
35
  return out
36
 
37
+ num_inference_steps_slider_component_v1 = gr.Slider(
38
+ label="Number of inference steps",
39
+ info="The number of denoising steps. More denoising steps "
40
+ "usually lead to a higher quality image at the",
41
+ minimum=1,
42
+ maximum=500,
43
+ step=1,
44
+ value=121,
45
+ )
46
+
47
+ num_inference_steps_slider_component_v2 = gr.Slider(
48
+ label="Number of inference steps",
49
+ info="The number of denoising steps. More denoising steps "
50
+ "usually lead to a higher quality image at the",
51
+ minimum=1,
52
+ maximum=100,
53
+ step=1,
54
+ value=3,
55
+ )
56
+
57
  # For information on Interfaces, head to https://gradio.app/docs/
58
  # For user guides, head to https://gradio.app/guides/
59
  # For Spaces usage, head to https://huggingface.co/docs/hub/spaces
60
  iface = gradio.Interface(
61
  fn=inference,
62
+ inputs=['image',num_inference_steps_slider_component_v1,num_inference_steps_slider_component_v2],
63
  outputs='image',
64
  title='Noise Removal',
65
  description='Remove Noise with OpenCV and Adaptial Gaussian!',