hideosnes commited on
Commit
a368971
·
verified ·
1 Parent(s): ee83503

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -71,6 +71,17 @@ ip_model = IPAdapterXL(
71
  target_blocks=["up_blocks.0.attentions.1"],
72
  )
73
 
 
 
 
 
 
 
 
 
 
 
 
74
 
75
  def resize_img(
76
  input_image,
 
71
  target_blocks=["up_blocks.0.attentions.1"],
72
  )
73
 
74
+ def segment(input_image):
75
+ # Convert PIL image to NumPy array
76
+ image_np = np.array(input_image)
77
+
78
+ # Remove background
79
+ image_np = remove(image_np)
80
+
81
+ # Convert back to PIL image
82
+ input_image = Image.fromarray(image_np)
83
+
84
+ return input_image
85
 
86
  def resize_img(
87
  input_image,