Draw 68 key points Args: image: the input image kpt: (68, 3).
(image, kpts, color = 'r')
| 693 | return image |
| 694 | |
| 695 | def 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 | |
| 718 | def tensor_vis_landmarks(images, landmarks, gt_landmarks=None, color = 'g', isScale=True): |
| 719 | # visualize landmarks |
no outgoing calls
no test coverage detected