Pose Estimation and Human Segmentation
- class dronevis.models.PoseSegEstimation(is_seg=False, is_seg_pose=False)
Pose estimation class for loading and predicting with mediapipe
BlazePosemodel.The model inherits from base
CVModeland implements its abstract methods:load_model,transform_img,predict,detect_webcam.- __init__(is_seg=False, is_seg_pose=False)
- load_model()
Load model from weights associated with mediapipe
- transform_img(image)
Transform image from
BGRtoRGB- Parameters:
image (np.array) – input image
- Returns:
transformed image
- Return type:
np.array
- predict(image, is_seg=False, is_seg_pose=False, all_formats=False)
Predict keypoints for pose and draw them on input image. Input image is assumed to be BGR.
- Parameters:
- Returns:
output image with keypoints drawn, segmented image segmented image with pose points
- Return type:
Tuple[np.array, …]
- detect_webcam(video_index=0, window_name='Pose')
Start webcam pose estimation from video_index (to quit running this function press ‘q’)
The stream is retrieved and decoded using opencv library.