code: def draw_skeleton(
      buffer, image_w, image_h, boneIndex, points2d, color, size=4
  ):
      try:
          # draw_line_on_buffer(buffer, image_w, image_h, (points2d[boneIndex["crl_root"]], points2d[boneIndex["crl_hips__C"]]), color, size)
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hips__C"]],
                  points2d[boneIndex["crl_spine__C"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hips__C"]],
                  points2d[boneIndex["crl_thigh__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hips__C"]],
                  points2d[boneIndex["crl_thigh__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_spine__C"]],
                  points2d[boneIndex["crl_spine01__C"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_spine01__C"]],
                  points2d[boneIndex["crl_shoulder__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_spine01__C"]],
                  points2d[boneIndex["crl_neck__C"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_spine01__C"]],
                  points2d[boneIndex["crl_shoulder__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_shoulder__L"]],
                  points2d[boneIndex["crl_arm__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_arm__L"]],
                  points2d[boneIndex["crl_foreArm__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_foreArm__L"]],
                  points2d[boneIndex["crl_hand__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__L"]],
                  points2d[boneIndex["crl_handThumb__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__L"]],
                  points2d[boneIndex["crl_handIndex__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__L"]],
                  points2d[boneIndex["crl_handMiddle__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__L"]],
                  points2d[boneIndex["crl_handRing__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__L"]],
                  points2d[boneIndex["crl_handPinky__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handThumb__L"]],
                  points2d[boneIndex["crl_handThumb01__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handThumb01__L"]],
                  points2d[boneIndex["crl_handThumb02__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handThumb02__L"]],
                  points2d[boneIndex["crl_handThumbEnd__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handIndex__L"]],
                  points2d[boneIndex["crl_handIndex01__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handIndex01__L"]],
                  points2d[boneIndex["crl_handIndex02__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handIndex02__L"]],
                  points2d[boneIndex["crl_handIndexEnd__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handMiddle__L"]],
                  points2d[boneIndex["crl_handMiddle01__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handMiddle01__L"]],
                  points2d[boneIndex["crl_handMiddle02__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handMiddle02__L"]],
                  points2d[boneIndex["crl_handMiddleEnd__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handRing__L"]],
                  points2d[boneIndex["crl_handRing01__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handRing01__L"]],
                  points2d[boneIndex["crl_handRing02__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handRing02__L"]],
                  points2d[boneIndex["crl_handRingEnd__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handPinky__L"]],
                  points2d[boneIndex["crl_handPinky01__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handPinky01__L"]],
                  points2d[boneIndex["crl_handPinky02__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handPinky02__L"]],
                  points2d[boneIndex["crl_handPinkyEnd__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_neck__C"]],
                  points2d[boneIndex["crl_Head__C"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_Head__C"]],
                  points2d[boneIndex["crl_eye__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_Head__C"]],
                  points2d[boneIndex["crl_eye__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_shoulder__R"]],
                  points2d[boneIndex["crl_arm__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_arm__R"]],
                  points2d[boneIndex["crl_foreArm__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_foreArm__R"]],
                  points2d[boneIndex["crl_hand__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__R"]],
                  points2d[boneIndex["crl_handThumb__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__R"]],
                  points2d[boneIndex["crl_handIndex__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__R"]],
                  points2d[boneIndex["crl_handMiddle__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__R"]],
                  points2d[boneIndex["crl_handRing__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_hand__R"]],
                  points2d[boneIndex["crl_handPinky__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handThumb__R"]],
                  points2d[boneIndex["crl_handThumb01__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handThumb01__R"]],
                  points2d[boneIndex["crl_handThumb02__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handThumb02__R"]],
                  points2d[boneIndex["crl_handThumbEnd__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handIndex__R"]],
                  points2d[boneIndex["crl_handIndex01__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handIndex01__R"]],
                  points2d[boneIndex["crl_handIndex02__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handIndex02__R"]],
                  points2d[boneIndex["crl_handIndexEnd__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handMiddle__R"]],
                  points2d[boneIndex["crl_handMiddle01__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handMiddle01__R"]],
                  points2d[boneIndex["crl_handMiddle02__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handMiddle02__R"]],
                  points2d[boneIndex["crl_handMiddleEnd__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handRing__R"]],
                  points2d[boneIndex["crl_handRing01__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handRing01__R"]],
                  points2d[boneIndex["crl_handRing02__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handRing02__R"]],
                  points2d[boneIndex["crl_handRingEnd__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handPinky__R"]],
                  points2d[boneIndex["crl_handPinky01__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handPinky01__R"]],
                  points2d[boneIndex["crl_handPinky02__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_handPinky02__R"]],
                  points2d[boneIndex["crl_handPinkyEnd__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_thigh__R"]],
                  points2d[boneIndex["crl_leg__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_leg__R"]],
                  points2d[boneIndex["crl_foot__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_foot__R"]],
                  points2d[boneIndex["crl_toe__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_toe__R"]],
                  points2d[boneIndex["crl_toeEnd__R"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_thigh__L"]],
                  points2d[boneIndex["crl_leg__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_leg__L"]],
                  points2d[boneIndex["crl_foot__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_foot__L"]],
                  points2d[boneIndex["crl_toe__L"]],
              ),
              color,
              size,
          )
          draw_line_on_buffer(
              buffer,
              image_w,
              image_h,
              (
                  points2d[boneIndex["crl_toe__L"]],
                  points2d[boneIndex["crl_toeEnd__L"]],
              ),
              color,
              size,
          )
      except:
          pass
  
imports: import glob
  import os
  import sys
  import math
  import argparse
  import copy
  import time
  from multiprocessing import Pool
  from PIL import Image
  import carla
  import random
label_desc: Use image node_id 8 for calling a global function with example usage: draw_skeleton(buffer, image_w, image_h, boneIndex, points2d, color, size) without return types