Spaces:
Sleeping
Sleeping
Hamam
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ def load_model(model, model_path, device):
|
|
| 15 |
return model
|
| 16 |
|
| 17 |
# Load the model onto the specified device
|
| 18 |
-
u2net = load_model(model=u2net, model_path="
|
| 19 |
|
| 20 |
# Mean and std for normalization
|
| 21 |
mean = torch.tensor([0.485, 0.456, 0.406])
|
|
@@ -103,8 +103,7 @@ iface = gr.Interface(
|
|
| 103 |
fn=segment_image,
|
| 104 |
inputs=gr.Image(type="numpy"),
|
| 105 |
outputs=gr.Image(type="pil",format="png"),
|
| 106 |
-
title="
|
| 107 |
-
description="Upload an image to segment it using the U2NET model. The background of the segmented output will be transparent."
|
| 108 |
)
|
| 109 |
|
| 110 |
# Launch the interface
|
|
|
|
| 15 |
return model
|
| 16 |
|
| 17 |
# Load the model onto the specified device
|
| 18 |
+
u2net = load_model(model=u2net, model_path="u2net.pth", device="cpu")
|
| 19 |
|
| 20 |
# Mean and std for normalization
|
| 21 |
mean = torch.tensor([0.485, 0.456, 0.406])
|
|
|
|
| 103 |
fn=segment_image,
|
| 104 |
inputs=gr.Image(type="numpy"),
|
| 105 |
outputs=gr.Image(type="pil",format="png"),
|
| 106 |
+
title="Remove Background From Image"
|
|
|
|
| 107 |
)
|
| 108 |
|
| 109 |
# Launch the interface
|