Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from PIL import Image
|
|
10 |
from typing import Tuple
|
11 |
|
12 |
net=BriaRMBG()
|
13 |
-
model_path = "./
|
14 |
if torch.cuda.is_available():
|
15 |
net.load_state_dict(torch.load(model_path))
|
16 |
net=net.cuda()
|
@@ -69,7 +69,7 @@ def process(image):
|
|
69 |
im_array = (result*255).cpu().data.numpy().astype(np.uint8)
|
70 |
pil_im = Image.fromarray(np.squeeze(im_array))
|
71 |
# paste the mask on the original image
|
72 |
-
new_im = Image.new("RGBA", pil_im.size, (0,0,0))
|
73 |
new_im.paste(orig_image, mask=pil_im)
|
74 |
|
75 |
return [orig_image, new_im]
|
|
|
10 |
from typing import Tuple
|
11 |
|
12 |
net=BriaRMBG()
|
13 |
+
model_path = "./model1.pth"
|
14 |
if torch.cuda.is_available():
|
15 |
net.load_state_dict(torch.load(model_path))
|
16 |
net=net.cuda()
|
|
|
69 |
im_array = (result*255).cpu().data.numpy().astype(np.uint8)
|
70 |
pil_im = Image.fromarray(np.squeeze(im_array))
|
71 |
# paste the mask on the original image
|
72 |
+
new_im = Image.new("RGBA", pil_im.size, (0,0,0,0))
|
73 |
new_im.paste(orig_image, mask=pil_im)
|
74 |
|
75 |
return [orig_image, new_im]
|