class documentation
class HorizontalSymmetricKeypointsFlip(A.DualTransform):
Constructor: HorizontalSymmetricKeypointsFlip(keypoint_pairs, p)
Flip images and symmetric keypoints horizontally.
| Method | __init__ |
Flip an image and symmetric keypoints horizontally. |
| Method | apply |
Flip an image horizontally. |
| Method | apply |
Flip bounding boxes horizontally. |
| Method | apply |
Flip keypoints horizontally and swap symmetric pairs. |
| Method | apply |
Flip a segmentation mask horizontally. |
| Method | get |
Get parameters dependent on the targets. |
| Instance Variable | keypoint |
Pairs of keypoint indices swapped after flipping. |
| Instance Variable | n |
Number of unique keypoints described by keypoint_pairs. |
| Property | targets |
Undocumented |
Flip an image and symmetric keypoints horizontally.
Bounding boxes and segmentation masks are flipped as well.
| Parameters | |
keypointlist[ | Pairs of keypoint indices to swap after the flip. |
p:float | Probability of applying the augmentation. |
Flip an image horizontally.
| Parameters | |
img:np.ndarray | Image to flip. |
| **params | Additional transform parameters. |
| Returns | |
np.ndarray | Flipped image. |
Flip bounding boxes horizontally.
| Parameters | |
bboxes:np.ndarray | Bounding boxes to flip. |
| **params | Additional transform parameters. |
| Returns | |
np.ndarray | Flipped bounding boxes. |
@override
def apply_to_keypoints(self, keypoints: np.ndarray, orig_width: int, **params) -> np.ndarray:
¶
Flip keypoints horizontally and swap symmetric pairs.
| Parameters | |
keypoints:np.ndarray | Keypoints to flip. |
origint | Original image width. |
| **params | Additional transform parameters. |
| Returns | |
np.ndarray | Flipped keypoints. |
| Raises | |
ValueError | If the total number of keypoints is not a multiple of n_keypoints. |
Flip a segmentation mask horizontally.
| Parameters | |
img:np.ndarray | Segmentation mask to flip. |
| **params | Additional transform parameters. |
| Returns | |
np.ndarray | Flipped segmentation mask. |
@override
def get_params_dependent_on_data(self, params: dict[ str, Any], data: dict[ str, Any]) -> dict[ str, Any]:
¶
Get parameters dependent on the targets.
| Parameters | |
params:dict[ | Existing augmentation parameters. |
data:dict[ | Input data. |
| Returns | |
dict[ | Parameters derived from the input targets. |