Update app.py
Browse files
app.py
CHANGED
|
@@ -228,7 +228,7 @@ model_inpaint = None
|
|
| 228 |
def inpaint(image, invert):
|
| 229 |
# image = resize_image(img, res)
|
| 230 |
# color = HWC3(image["image"])
|
| 231 |
-
|
| 232 |
# if(invert):
|
| 233 |
# alpha = image["mask"][:, :, 0:1]
|
| 234 |
# alpha = image["layers"][0]
|
|
@@ -238,13 +238,13 @@ def inpaint(image, invert):
|
|
| 238 |
# result = np.concatenate([color, alpha], axis=2)
|
| 239 |
# result = alpha
|
| 240 |
# return [result]
|
| 241 |
-
return [
|
| 242 |
|
| 243 |
|
| 244 |
def predict(im):
|
| 245 |
# return im["composite"]
|
| 246 |
# return im["inputmask"] # bad
|
| 247 |
-
return im["layers"][0][:, :,
|
| 248 |
|
| 249 |
block = gr.Blocks().queue()
|
| 250 |
with block:
|
|
|
|
| 228 |
def inpaint(image, invert):
|
| 229 |
# image = resize_image(img, res)
|
| 230 |
# color = HWC3(image["image"])
|
| 231 |
+
color = HWC3(image["background"])
|
| 232 |
# if(invert):
|
| 233 |
# alpha = image["mask"][:, :, 0:1]
|
| 234 |
# alpha = image["layers"][0]
|
|
|
|
| 238 |
# result = np.concatenate([color, alpha], axis=2)
|
| 239 |
# result = alpha
|
| 240 |
# return [result]
|
| 241 |
+
return [color]
|
| 242 |
|
| 243 |
|
| 244 |
def predict(im):
|
| 245 |
# return im["composite"]
|
| 246 |
# return im["inputmask"] # bad
|
| 247 |
+
return im["layers"][0][:, :, :]
|
| 248 |
|
| 249 |
block = gr.Blocks().queue()
|
| 250 |
with block:
|