Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -136,7 +136,7 @@ def analyze(image):
|
|
| 136 |
elif length <= thresholds[2]: color = colors[2]
|
| 137 |
elif length <= thresholds[3]: color = colors[3]
|
| 138 |
else: color = colors[4]
|
| 139 |
-
cv2.drawContours(color_mask, [box], 0, color,
|
| 140 |
|
| 141 |
fig2 = plt.figure(figsize=(6, 6))
|
| 142 |
plt.imshow(cv2.cvtColor(color_mask, cv2.COLOR_BGR2RGB))
|
|
@@ -153,7 +153,7 @@ def analyze(image):
|
|
| 153 |
plt.imshow(label_img, cmap="gray")
|
| 154 |
if len(centroids) >= 3:
|
| 155 |
tri = Delaunay(centroids)
|
| 156 |
-
plt.triplot(centroids[:, 1], centroids[:, 0], tri.simplices.copy(), color="red")
|
| 157 |
for simplex in tri.simplices:
|
| 158 |
for i in range(3):
|
| 159 |
pt1 = centroids[simplex[i]]
|
|
|
|
| 136 |
elif length <= thresholds[2]: color = colors[2]
|
| 137 |
elif length <= thresholds[3]: color = colors[3]
|
| 138 |
else: color = colors[4]
|
| 139 |
+
cv2.drawContours(color_mask, [box], 0, color, 8)
|
| 140 |
|
| 141 |
fig2 = plt.figure(figsize=(6, 6))
|
| 142 |
plt.imshow(cv2.cvtColor(color_mask, cv2.COLOR_BGR2RGB))
|
|
|
|
| 153 |
plt.imshow(label_img, cmap="gray")
|
| 154 |
if len(centroids) >= 3:
|
| 155 |
tri = Delaunay(centroids)
|
| 156 |
+
plt.triplot(centroids[:, 1], centroids[:, 0], tri.simplices.copy(), color="red", linewidth=1)
|
| 157 |
for simplex in tri.simplices:
|
| 158 |
for i in range(3):
|
| 159 |
pt1 = centroids[simplex[i]]
|