The Pose class represents a detected human pose in an image. It encapsulates information about the pose's keypoints, confidence score, bounding box, and unique ID. Additionally, it provides methods for managing pose-related data, such as drawing the pose on an image, updating its ID, and applying smoothing to its keypoints.


Class Definition

class Pose:

The Pose class is designed to store and manage information about a single detected pose.


Class Attributes

These are shared across all instances of the Pose class:

  1. num_kpts:

    num_kpts = 18
    
  2. kpt_names:

    kpt_names = ['nose', 'neck', 'r_sho', 'r_elb', 'r_wri', 'l_sho', 'l_elb', 'l_wri',
                 'r_hip', 'r_knee', 'r_ank', 'l_hip', 'l_knee', 'l_ank',
                 'r_eye', 'l_eye', 'r_ear', 'l_ear']
    
  3. sigmas and vars:

    sigmas = np.array([...], dtype=np.float32) / 10.0
    vars = (sigmas * 2) ** 2
    
  4. last_id:

    last_id = -1
    
  5. color:

    color = [0, 224, 255]
    

Instance Attributes

These are specific to each pose instance:

  1. keypoints:
  2. confidence:
  3. bbox:
  4. id: