Spaces:
Running
on
Zero
Running
on
Zero
resize
Browse files- demo/rm_bg.py +3 -1
demo/rm_bg.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
import numpy as np
|
|
|
2 |
import rembg
|
3 |
|
4 |
|
5 |
def rm_bg(img, use_sam=False):
|
6 |
-
|
|
|
7 |
output = rembg.remove(img)
|
8 |
mask = np.array(output)[:, :, 3]
|
9 |
|
|
|
1 |
import numpy as np
|
2 |
+
from PIL import Image
|
3 |
import rembg
|
4 |
|
5 |
|
6 |
def rm_bg(img, use_sam=False):
|
7 |
+
img = Image.fromarray(img)
|
8 |
+
img.resize((512, 512))
|
9 |
output = rembg.remove(img)
|
10 |
mask = np.array(output)[:, :, 3]
|
11 |
|