def execute(self, frame: FrameType, frame_poses: bytes) -> FrameType: for all_pose in readers.poses(frame_poses, self.protobufs): pose = all_pose.pose_keypoints() for i in range(18): if pose[i, 2] < 0.35: continue x = int(pose[i, 0] * frame.shape[1]) y = int(pose[i, 1] * frame.shape[0]) cv2.circle(frame, (x, y), 8, (255, 0, 0), 3) return frame
def execute(self, *inputs: Tuple[bytes]) -> bytes: pose_list = [] for c in inputs: pose_list += readers.poses(c, self.protobufs) nmsed_poses = poses.nms(pose_list, self.height * 0.2) return writers.poses(nmsed_poses, self.protobufs)
def pose_draw(self, frame: FrameType, frame_poses: bytes) -> FrameType: for pose in readers.poses(frame_poses, self.protobufs): pose.draw(frame) return frame
def pose_draw(config, frame: FrameType, poses: bytes) -> FrameType: for pose in readers.poses(poses, config.protobufs): pose.draw(frame) return frame