MCPcopy Create free account
hub / github.com/Pixel-Talk/EHM-Tracker / plot_verts

Function plot_verts

src/modules/pixie/utils/util.py:695–716  ·  view source on GitHub ↗

Draw 68 key points Args: image: the input image kpt: (68, 3).

(image, kpts, color = 'r')

Source from the content-addressed store, hash-verified

693 return image
694
695def plot_verts(image, kpts, color = 'r'):
696 ''' Draw 68 key points
697 Args:
698 image: the input image
699 kpt: (68, 3).
700 '''
701 kpts = kpts.copy().astype(np.int32)
702 if color == 'r':
703 c = (255, 0, 0)
704 elif color == 'g':
705 c = (0, 255, 0)
706 elif color == 'b':
707 c = (0, 0, 255)
708 elif color == 'y':
709 c = (0, 255, 255)
710 image = image.copy()
711
712 for i in range(kpts.shape[0]):
713 st = kpts[i, :2]
714 image = cv2.circle(image,(st[0], st[1]), 1, c, 5)
715
716 return image
717
718def tensor_vis_landmarks(images, landmarks, gt_landmarks=None, color = 'g', isScale=True):
719 # visualize landmarks

Callers 1

tensor_vis_landmarksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected