MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / draw_kp2ds

Function draw_kp2ds

tools/preprocess/human_visualization.py:895–986  ·  view source on GitHub ↗
(img, kp2ds, threshold=0, color=(255, 0, 0), skeleton=None, reverse=False)

Source from the content-addressed store, hash-verified

893
894
895def draw_kp2ds(img, kp2ds, threshold=0, color=(255, 0, 0), skeleton=None, reverse=False):
896 img = load_image(img, reverse)
897
898 if skeleton is not None:
899 if skeleton == "coco17":
900 skeleton_list = [
901 [6, 8],
902 [8, 10],
903 [5, 7],
904 [7, 9],
905 [11, 13],
906 [13, 15],
907 [12, 14],
908 [14, 16],
909 [5, 6],
910 [6, 12],
911 [12, 11],
912 [11, 5],
913 ]
914 color_list = [
915 (255, 0, 0),
916 (0, 255, 0),
917 (0, 0, 255),
918 (255, 255, 0),
919 (255, 0, 255),
920 (0, 255, 255),
921 ]
922 elif skeleton == "cocowholebody":
923 skeleton_list = [
924 [6, 8],
925 [8, 10],
926 [5, 7],
927 [7, 9],
928 [11, 13],
929 [13, 15],
930 [12, 14],
931 [14, 16],
932 [5, 6],
933 [6, 12],
934 [12, 11],
935 [11, 5],
936 [15, 17],
937 [15, 18],
938 [15, 19],
939 [16, 20],
940 [16, 21],
941 [16, 22],
942 [91, 92, 93, 94, 95],
943 [91, 96, 97, 98, 99],
944 [91, 100, 101, 102, 103],
945 [91, 104, 105, 106, 107],
946 [91, 108, 109, 110, 111],
947 [112, 113, 114, 115, 116],
948 [112, 117, 118, 119, 120],
949 [112, 121, 122, 123, 124],
950 [112, 125, 126, 127, 128],
951 [112, 129, 130, 131, 132],
952 ]

Callers

nothing calls this directly

Calls 1

load_imageFunction · 0.70

Tested by

no test coverage detected