Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,11 +45,9 @@ def find_tip(points, convex_hull):
|
|
45 |
def infer(image_in):
|
46 |
img = cv2.imread(image_in)
|
47 |
|
48 |
-
contours, hierarchy = cv2.findContours(preprocess(img), cv2.
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
for cnt in internal_contours:
|
53 |
peri = cv2.arcLength(cnt, True)
|
54 |
approx = cv2.approxPolyDP(cnt, 0.025 * peri, True)
|
55 |
hull = cv2.convexHull(approx, returnPoints=False)
|
|
|
45 |
def infer(image_in):
|
46 |
img = cv2.imread(image_in)
|
47 |
|
48 |
+
contours, hierarchy = cv2.findContours(preprocess(img), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
49 |
+
|
50 |
+
for cnt in contours:
|
|
|
|
|
51 |
peri = cv2.arcLength(cnt, True)
|
52 |
approx = cv2.approxPolyDP(cnt, 0.025 * peri, True)
|
53 |
hull = cv2.convexHull(approx, returnPoints=False)
|