add background to output
Browse files
app.py
CHANGED
@@ -35,10 +35,7 @@ def run_front_detection(input_img):
|
|
35 |
image_rgb = image_gray.convert('RGB')
|
36 |
np_array = np.asarray(image_rgb).copy()
|
37 |
|
38 |
-
|
39 |
-
# Example: multiply all pixel values by 2
|
40 |
-
|
41 |
-
np_array[front==1,0]= 255
|
42 |
|
43 |
# Convert NumPy array back to PIL image
|
44 |
pil_image_modified = Image.fromarray(np_array)
|
|
|
35 |
image_rgb = image_gray.convert('RGB')
|
36 |
np_array = np.asarray(image_rgb).copy()
|
37 |
|
38 |
+
np_array[np.array(front)==255,0] = 255
|
|
|
|
|
|
|
39 |
|
40 |
# Convert NumPy array back to PIL image
|
41 |
pil_image_modified = Image.fromarray(np_array)
|