imgutils.pose.format
OP18KeyPointSet
- class imgutils.pose.format.OP18KeyPointSet(all_: ndarray)[source]
Class representing a set of keypoints detected by the OpenPose 18 (OP18) model.
This class provides convenient properties to access keypoints for different body parts, including the body, left foot, right foot, face, left hand, and right hand.
- Parameters:
all (np.ndarray) – NumPy array containing the coordinates and confidence scores of all keypoints.
- __mul__(multiplier)[source]
Multiply the coordinates of all keypoints by a scalar multiplier.
- Parameters:
multiplier (Union[float, int]) – The scalar multiplier.
- Returns:
New OP18KeyPointSet with scaled coordinates.
- Return type:
- Raises:
TypeError – If the type of the multiplier is not float or int.
- __truediv__(divisor)[source]
Divide the coordinates of all keypoints by a scalar divisor.
- Parameters:
divisor (Union[float, int]) – The scalar divisor.
- Returns:
New OP18KeyPointSet with scaled coordinates.
- Return type:
- Raises:
TypeError – If the type of the divisor is not float or int.
- property body
Property representing the keypoints for the body.
- property face
Property representing the keypoints for the face.
- property left_foot
Property representing the keypoints for the left foot.
- property left_hand
Property representing the keypoints for the left hand.
- property right_foot
Property representing the keypoints for the right foot.
- property right_hand
Property representing the keypoints for the right hand.
OpenPose18
- enum imgutils.pose.format.OpenPose18(value)[source]
Enumeration class representing the OpenPose 18 keypoint indices.
The enumeration provides symbolic names for the keypoint indices, making it more readable and maintainable when accessing specific keypoints in the OP18 keypoint set.
The keypoint indices are categorized into different body parts such as nose, neck, shoulders, elbows, wrists, hips, knees, ankles, eyes, ears, feet, and hands.
- Member Type:
int
Valid values are as follows:
- NOSE = <OpenPose18.NOSE: 0>
- NECK = <OpenPose18.NECK: 1>
- RIGHT_SHOULDER = <OpenPose18.RIGHT_SHOULDER: 2>
- RIGHT_ELBOW = <OpenPose18.RIGHT_ELBOW: 3>
- RIGHT_WRIST = <OpenPose18.RIGHT_WRIST: 4>
- LEFT_SHOULDER = <OpenPose18.LEFT_SHOULDER: 5>
- LEFT_ELBOW = <OpenPose18.LEFT_ELBOW: 6>
- LEFT_WRIST = <OpenPose18.LEFT_WRIST: 7>
- RIGHT_HIP = <OpenPose18.RIGHT_HIP: 8>
- RIGHT_KNEE = <OpenPose18.RIGHT_KNEE: 9>
- RIGHT_ANKLE = <OpenPose18.RIGHT_ANKLE: 10>
- LEFT_HIP = <OpenPose18.LEFT_HIP: 11>
- LEFT_KNEE = <OpenPose18.LEFT_KNEE: 12>
- LEFT_ANKLE = <OpenPose18.LEFT_ANKLE: 13>
- RIGHT_EYE = <OpenPose18.RIGHT_EYE: 14>
- LEFT_EYE = <OpenPose18.LEFT_EYE: 15>
- RIGHT_EAR = <OpenPose18.RIGHT_EAR: 16>
- LEFT_EAR = <OpenPose18.LEFT_EAR: 17>
- LEFT_BIG_TOE = <OpenPose18.LEFT_BIG_TOE: 18>
- LEFT_SMALL_TOE = <OpenPose18.LEFT_SMALL_TOE: 19>
- LEFT_HEEL = <OpenPose18.LEFT_HEEL: 20>
- RIGHT_BIG_TOE = <OpenPose18.RIGHT_BIG_TOE: 21>
- RIGHT_SMALL_TOE = <OpenPose18.RIGHT_SMALL_TOE: 22>
- RIGHT_HEEL = <OpenPose18.RIGHT_HEEL: 23>
OP18_BODY_MAX
- imgutils.pose.format.OP18_BODY_MAX = 17
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_BODY_MIN
- imgutils.pose.format.OP18_BODY_MIN = 0
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_FACE_MAX
- imgutils.pose.format.OP18_FACE_MAX = 91
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_FACE_MIN
- imgutils.pose.format.OP18_FACE_MIN = 24
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_LEFT_FOOT_MAX
- imgutils.pose.format.OP18_LEFT_FOOT_MAX = 20
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_LEFT_FOOT_MIN
- imgutils.pose.format.OP18_LEFT_FOOT_MIN = 18
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_LEFT_HAND_MAX
- imgutils.pose.format.OP18_LEFT_HAND_MAX = 112
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_LEFT_HAND_MIN
- imgutils.pose.format.OP18_LEFT_HAND_MIN = 92
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_RIGHT_FOOT_MAX
- imgutils.pose.format.OP18_RIGHT_FOOT_MAX = 23
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_RIGHT_FOOT_MIN
- imgutils.pose.format.OP18_RIGHT_FOOT_MIN = 21
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_RIGHT_HAND_MAX
- imgutils.pose.format.OP18_RIGHT_HAND_MAX = 135
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
OP18_RIGHT_HAND_MIN
- imgutils.pose.format.OP18_RIGHT_HAND_MIN = 113
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4