diego2554 commited on
Commit
0438e47
1 Parent(s): 4cf1654

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -17,15 +17,12 @@ def inference(file, mask, model, alpha, segmentation_strength):
17
  with open(input_path, 'rb') as i:
18
  with open(output_path, 'wb') as o:
19
  input = i.read()
20
- # Aumentar la influencia de Alpha y Segmentation Strength
21
- alpha_multiplier = 2.0 # Puedes ajustar estos valores según tus necesidades
22
- segmentation_strength_multiplier = 2.0
23
  output = remove(
24
  input,
25
  session=new_session(model),
26
  only_mask=(True if mask == "Mask only" else False),
27
- alpha=alpha * alpha_multiplier, # Aumentar la influencia de Alpha
28
- segmentation_strength=segmentation_strength * segmentation_strength_multiplier # Aumentar la influencia de Segmentation Strength
29
  )
30
  o.write(output)
31
  return os.path.join("output.png")
@@ -75,3 +72,4 @@ gr.Interface(
75
  examples=[["lion.png", "Default", "u2net", 0.5, 0.5], ["girl.jpg", "Default", "u2net", 0.5, 0.5], ["anime-girl.jpg", "Default", "isnet-anime", 0.5, 0.5]],
76
  enable_queue=True
77
  ).launch()
 
 
17
  with open(input_path, 'rb') as i:
18
  with open(output_path, 'wb') as o:
19
  input = i.read()
 
 
 
20
  output = remove(
21
  input,
22
  session=new_session(model),
23
  only_mask=(True if mask == "Mask only" else False),
24
+ alpha=alpha,
25
+ segmentation_strength=segmentation_strength
26
  )
27
  o.write(output)
28
  return os.path.join("output.png")
 
72
  examples=[["lion.png", "Default", "u2net", 0.5, 0.5], ["girl.jpg", "Default", "u2net", 0.5, 0.5], ["anime-girl.jpg", "Default", "isnet-anime", 0.5, 0.5]],
73
  enable_queue=True
74
  ).launch()
75
+