Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -134,6 +134,16 @@ def inference(image: Image):
|
|
134 |
im_rgba = im_rgb.copy()
|
135 |
im_rgba.putalpha(pil_mask)
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
return [im_rgba, pil_mask]
|
138 |
|
139 |
|
|
|
134 |
im_rgba = im_rgb.copy()
|
135 |
im_rgba.putalpha(pil_mask)
|
136 |
|
137 |
+
# Apply Background
|
138 |
+
bg_color = 0x00C49A
|
139 |
+
w = img_rgba.size[0]
|
140 |
+
h = img_rgba.size[1]
|
141 |
+
|
142 |
+
bg = Image.new("RGB", (w,h), bg_color)
|
143 |
+
im_colored = Image.new("RGBA", (w,h))
|
144 |
+
im_colored.paste(bg)
|
145 |
+
im_colored.paste(im_rgba)
|
146 |
+
|
147 |
return [im_rgba, pil_mask]
|
148 |
|
149 |
|