Skip to content

Commit b59da01

Browse files
authored
Update image_background_subtractor.py
1 parent ce59afd commit b59da01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

image_background_subtractor/image_background_subtractor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
mp_drawing = mp.solutions.drawing_utils
77
mp_selfie_segmentation = mp.solutions.selfie_segmentation
88

9-
IMAGE_FILES = ['location_to_image/image.jpg'] #You can use multiple Images for removal at a go by just specifying the name of the images in the list.
10-
BG_COLOR = (255,255,255) # White Background
9+
IMAGE_FILES = ['location_to_image/image.jpg'] # You can use multiple Images for removal at a go by just specifying the name of the images in the list.
10+
BG_COLOR = (255,255,255) # White Background
1111
with mp_selfie_segmentation.SelfieSegmentation(model_selection=0) as selfie_segmentation:
1212
for idx, file in enumerate(IMAGE_FILES):
1313
image = cv2.imread(file, cv2.IMREAD_UNCHANGED)
@@ -18,7 +18,7 @@
1818
bg_image[:] = BG_COLOR
1919
output_image = np.where(condition,image,bg_image)
2020
cv2.imwrite('./white_bg' + str(idx) + '.png', output_image)
21-
#Converting the White Background to Transparent Background.
21+
# Converting the White Background to Transparent Background.
2222
img = Image.open("./white_bg"+str(idx)+".png")
2323
img = img.convert("RGBA")
2424
datas = img.getdata()

0 commit comments

Comments
 (0)