NCJ commited on
Commit
a1e44df
1 Parent(s): 55c9d69
Files changed (1) hide show
  1. 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
- print(type(img))
 
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