random_shapes
RandomShapes
¶
Bases: NumpyOp
Add random shapes to an image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inputs |
Union[str, Iterable[str]]
|
Key(s) of images to be modified. |
required |
outputs |
Union[str, Iterable[str]]
|
Key(s) into which to write the modified images. |
required |
mode |
Union[None, str, Iterable[str]]
|
What mode(s) to execute this Op in. For example, "train", "eval", "test", or "infer". To execute regardless of mode, pass None. To execute in all modes except for a particular one, you can pass an argument like "!infer" or "!train". |
None
|
ds_id |
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Op in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|
max_shapes |
int
|
The maximum number of shapes to add to the image. |
3
|
max_size |
Optional[int]
|
The maximum size of the shapes to generate. |
None
|
intensity_range |
Tuple[int, int]
|
The allowable pixel values for the shapes. |
(0, 254)
|
transparency_range |
Tuple[float, float]
|
The range of transparency values to be randomly sampled from. 0 means that shapes are completely transparent, and 1 means that shapes are completely opaque. |
(0.1, 0.9)
|
Raises:
Type | Description |
---|---|
AssertionError
|
If the |
Source code in fastestimator/fastestimator/op/numpyop/univariate/random_shapes.py
set_rua_level
¶
Set the augmentation intensity based on the magnitude_coef.
This method is specifically designed to be invoked by the RUA Op.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
magnitude_coef |
Union[int, float]
|
The desired augmentation intensity (range [0-1]). |
required |