Skip to content

Composition API (core.composition)

BboxParams

Parameters of bounding boxes

Parameters:

Name Type Description Default
format str

format of bounding boxes. Should be 'coco', 'pascal_voc', 'albumentations' or 'yolo'.

The coco format [x_min, y_min, width, height], e.g. [97, 12, 150, 200]. The pascal_voc format [x_min, y_min, x_max, y_max], e.g. [97, 12, 247, 212]. The albumentations format is like pascal_voc, but normalized, in other words: [x_min, y_min, x_max, y_max], e.g. [0.2, 0.3, 0.4, 0.5]. Theyoloformat[x, y, width, height], e.g. [0.1, 0.2, 0.3, 0.4];x,y- normalized bbox center;width,height` - normalized bbox width and height.

required
label_fields list

list of fields that are joined with boxes, e.g labels. Should be same type as boxes.

required
min_area float

minimum area of a bounding box. All bounding boxes whose visible area in pixels is less than this value will be removed. Default: 0.0.

required
min_visibility float

minimum fraction of area for a bounding box to remain this box in list. Default: 0.0.

required

Compose

Compose transforms and handle all transformations regrading bounding boxes

Parameters:

Name Type Description Default
transforms list

list of transformations to compose.

required
bbox_params BboxParams

Parameters for bounding boxes transforms

required
keypoint_params KeypointParams

Parameters for keypoints transforms

required
additional_targets dict

Dict with keys - new target name, values - old target name. ex: {'image2': 'image'}

required
p float

probability of applying all list of transforms. Default: 1.0.

required

KeypointParams

Parameters of keypoints

Parameters:

Name Type Description Default
format str

format of keypoints. Should be 'xy', 'yx', 'xya', 'xys', 'xyas', 'xysa'.

x - X coordinate,

y - Y coordinate

s - Keypoint scale

a - Keypoint orientation in radians or degrees (depending on KeypointParams.angle_in_degrees)

required
label_fields list

list of fields that are joined with keypoints, e.g labels. Should be same type as keypoints.

required
remove_invisible bool

to remove invisible points after transform or not

required
angle_in_degrees bool

angle in degrees or radians in 'xya', 'xyas', 'xysa' keypoints

required

OneOf

Select one of transforms to apply

Parameters:

Name Type Description Default
transforms list

list of transformations to compose.

required
p float

probability of applying selected transform. Default: 0.5.

required

PerChannel

Apply transformations per-channel

Parameters:

Name Type Description Default
transforms list

list of transformations to compose.

required
channels list

channels to apply the transform to. Pass None to apply to all. Default: None (apply to all)

required
p float

probability of applying the transform. Default: 0.5.

required