diego2554 commited on
Commit
e3ddad3
1 Parent(s): 0b6f668

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import gradio as gr
2
  import os
3
  import cv2
4
- import bg # Importa el módulo "bg.py"
5
 
6
  def inference(file, mask, model, alpha_influence, segmentation_strength):
7
  im = cv2.imread(file, cv2.IMREAD_COLOR)
@@ -17,16 +16,16 @@ def inference(file, mask, model, alpha_influence, segmentation_strength):
17
  input = i.read()
18
  output = remove(
19
  input,
20
- session=bg.new_session(model), # Utiliza la función de "bg.py"
21
  only_mask=(True if mask == "Mask only" else False),
22
- alpha_influence=alpha_influence, # Control de influencia del canal alfa
23
- segmentation_strength=segmentation_strength # Control de fuerza de segmentación
24
  )
25
 
26
  o.write(output)
27
  return os.path.join("output.png")
28
 
29
- title = "RemBG"
30
  description = "Gradio demo for RemBG. To use it, simply upload your image and adjust the alpha influence and segmentation strength."
31
  article = "<p style='text-align: center;'><a href='https://github.com/danielgatis/rembg' target='_blank'>Github Repo</a></p>"
32
 
 
1
  import gradio as gr
2
  import os
3
  import cv2
 
4
 
5
  def inference(file, mask, model, alpha_influence, segmentation_strength):
6
  im = cv2.imread(file, cv2.IMREAD_COLOR)
 
16
  input = i.read()
17
  output = remove(
18
  input,
19
+ session=new_session(model),
20
  only_mask=(True if mask == "Mask only" else False),
21
+ alpha=alpha_influence, # Control de influencia del canal alfa
22
+ bg_color=(0, 0, 0, segmentation_strength) # Control de fuerza de segmentación
23
  )
24
 
25
  o.write(output)
26
  return os.path.join("output.png")
27
 
28
+ title = "RemBG_ Super"
29
  description = "Gradio demo for RemBG. To use it, simply upload your image and adjust the alpha influence and segmentation strength."
30
  article = "<p style='text-align: center;'><a href='https://github.com/danielgatis/rembg' target='_blank'>Github Repo</a></p>"
31