Spaces:
Sleeping
Sleeping
Update segment_key.py
Browse files- segment_key.py +11 -9
segment_key.py
CHANGED
@@ -325,23 +325,25 @@ def rotate_image(image):
|
|
325 |
|
326 |
|
327 |
def show_kps(contour):
|
328 |
-
|
329 |
list1 = range(0, 300)
|
330 |
list2 = list(zip(get_features_right(contour), list1))
|
331 |
-
|
|
|
332 |
|
333 |
list2 = list(zip(get_features_left(contour), list1))
|
334 |
-
|
|
|
335 |
|
336 |
list2 = list(zip(list1, get_features_up(contour)))
|
337 |
-
|
|
|
338 |
|
339 |
-
list2 = list(zip(list1, get_features_down(contour)))
|
340 |
-
features += list2
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
cv2.drawContours(black_image, [
|
|
|
345 |
return black_image
|
346 |
|
347 |
|
|
|
325 |
|
326 |
|
327 |
def show_kps(contour):
|
328 |
+
black_image = np.zeros((300, 300), dtype=np.uint8)
|
329 |
list1 = range(0, 300)
|
330 |
list2 = list(zip(get_features_right(contour), list1))
|
331 |
+
list2 = np.array(list2)
|
332 |
+
cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
|
333 |
|
334 |
list2 = list(zip(get_features_left(contour), list1))
|
335 |
+
list2 = np.array(list2)
|
336 |
+
cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
|
337 |
|
338 |
list2 = list(zip(list1, get_features_up(contour)))
|
339 |
+
list2 = np.array(list2)
|
340 |
+
cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
|
341 |
|
|
|
|
|
342 |
|
343 |
+
list2 = list(zip(list1, get_features_down(contour)))
|
344 |
+
list2 = np.array(list2)
|
345 |
+
cv2.drawContours(black_image, [list2], -1, (255, 255, 255), 2)
|
346 |
+
|
347 |
return black_image
|
348 |
|
349 |
|