Update app.py
Browse files
app.py
CHANGED
|
@@ -32,7 +32,7 @@ def dilate_mask(mask, kernel_size=5, iterations=5):
|
|
| 32 |
return Image.fromarray(mask)
|
| 33 |
|
| 34 |
def remove_obj(image, seed):
|
| 35 |
-
alpha_channel =
|
| 36 |
mask = np.where(alpha_channel == 0, 0, 255).astype(np.uint8)
|
| 37 |
uploaded_mask = Image.fromarray(mask)
|
| 38 |
background = Image.fromarray(img["background"])
|
|
@@ -93,4 +93,4 @@ with gr.Blocks(theme="gradio/monochrome") as demo:
|
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
-
demo.launch()
|
|
|
|
| 32 |
return Image.fromarray(mask)
|
| 33 |
|
| 34 |
def remove_obj(image, seed):
|
| 35 |
+
alpha_channel = image["layers"][0][:, :, 3]
|
| 36 |
mask = np.where(alpha_channel == 0, 0, 255).astype(np.uint8)
|
| 37 |
uploaded_mask = Image.fromarray(mask)
|
| 38 |
background = Image.fromarray(img["background"])
|
|
|
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
+
demo.launch(share=True)
|