Henry Scheible
commited on
Commit
•
1fd9ca6
1
Parent(s):
29c7e10
add nms
Browse files
app.py
CHANGED
@@ -172,7 +172,17 @@ def count_barnacles(image_raw, split_num, progress=gr.Progress()):
|
|
172 |
|
173 |
|
174 |
# return annotated, mask_counter, centers
|
175 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
|
177 |
demo = gr.Interface(count_barnacles,
|
178 |
inputs=[
|
|
|
172 |
|
173 |
|
174 |
# return annotated, mask_counter, centers
|
175 |
+
|
176 |
+
good_centers = []
|
177 |
+
for point in centers:
|
178 |
+
is_good = True
|
179 |
+
for prev_point in good_centers:
|
180 |
+
if (point[0] - prev_point[0]) ** 2 + (point[1] + prev_point[1]) ** 2 < 20:
|
181 |
+
is_good = False
|
182 |
+
if is_good:
|
183 |
+
good_centers.append(point)
|
184 |
+
|
185 |
+
return fig, mask_counter, good_centers
|
186 |
|
187 |
demo = gr.Interface(count_barnacles,
|
188 |
inputs=[
|