Update app.py
Browse files
app.py
CHANGED
@@ -31,6 +31,12 @@ def process_image(image, prompt):
|
|
31 |
mask_min = mask.min()
|
32 |
mask_max = mask.max()
|
33 |
mask = (mask - mask_min) / (mask_max - mask_min)
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
return mask
|
35 |
|
36 |
|
@@ -40,11 +46,6 @@ def get_masks(prompts, img, threhsold):
|
|
40 |
for prompt in prompts:
|
41 |
mask = process_image(img, prompt)
|
42 |
mask = mask > threhsold
|
43 |
-
ax = plt.subplots()
|
44 |
-
ax.imshow(image)
|
45 |
-
ax.imshow(mask, alpha=0.5, cmap="jet")
|
46 |
-
ax.axis("off")
|
47 |
-
plt.tight_layout()
|
48 |
masks.append(mask)
|
49 |
return masks
|
50 |
|
|
|
31 |
mask_min = mask.min()
|
32 |
mask_max = mask.max()
|
33 |
mask = (mask - mask_min) / (mask_max - mask_min)
|
34 |
+
|
35 |
+
ax = plt.subplots()
|
36 |
+
ax.imshow(image)
|
37 |
+
ax.imshow(mask, alpha=0.5, cmap="jet")
|
38 |
+
ax.axis("off")
|
39 |
+
plt.tight_layout()
|
40 |
return mask
|
41 |
|
42 |
|
|
|
46 |
for prompt in prompts:
|
47 |
mask = process_image(img, prompt)
|
48 |
mask = mask > threhsold
|
|
|
|
|
|
|
|
|
|
|
49 |
masks.append(mask)
|
50 |
return masks
|
51 |
|