Update app.py
Browse files
app.py
CHANGED
@@ -35,12 +35,11 @@ def process_image(image, prompt):
|
|
35 |
mask_image = Image.open("mask.png").convert("RGB")
|
36 |
|
37 |
# Convert image to BGR format
|
38 |
-
image = cv2.cvtColor(np.array(image), cv2.COLOR_RGB2BGR)
|
39 |
imageio.imwrite("./data/data.png", image)
|
40 |
# Convert mask to grayscale format
|
41 |
mask_image = mask_image.resize((image.shape[1], image.shape[0]))
|
42 |
mask_image = cv2.cvtColor(np.array(mask_image), cv2.COLOR_RGB2GRAY)
|
43 |
-
mask_image = cv2.threshold(mask_image,
|
44 |
|
45 |
|
46 |
|
|
|
35 |
mask_image = Image.open("mask.png").convert("RGB")
|
36 |
|
37 |
# Convert image to BGR format
|
|
|
38 |
imageio.imwrite("./data/data.png", image)
|
39 |
# Convert mask to grayscale format
|
40 |
mask_image = mask_image.resize((image.shape[1], image.shape[0]))
|
41 |
mask_image = cv2.cvtColor(np.array(mask_image), cv2.COLOR_RGB2GRAY)
|
42 |
+
mask_image = cv2.threshold(mask_image, 100, 255, cv2.THRESH_BINARY)[1]
|
43 |
|
44 |
|
45 |
|