8.1.2.9. blueoil.tfds_augmentor
¶
8.1.2.9.1. Module Contents¶
8.1.2.9.1.1. Classes¶
Add padding to images. |
|
Randomly crop an image. |
|
Flip left right with a probability 0.5. |
|
Adjust the brightness of images by a random factor. |
|
Randomly change image hue. |
|
Randomly adjust the saturation of a RGB image. |
|
Randomly adjust the contrast of an image. |
8.1.2.9.1.2. Functions¶
|
Flip left right only bounding box. |
-
class
blueoil.tfds_augmentor.
TFDSPad
(value, fill=0)¶ Bases:
blueoil.data_processor.Processor
Add padding to images.
- Parameters
value (int or tuple) – Padding on each border. If a single int is provided this is used to pad all borders. If tuple of length 2 is provided this is the padding on left/right and top/bottom respectively. If a tuple of length 4 is provided this is the padding for the left, top, right and bottom borders respectively.
fill (int) – Pixel fill value. Default is 0.
-
__call__
(self, image, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.
-
class
blueoil.tfds_augmentor.
TFDSCrop
(size, seed=0)¶ Bases:
blueoil.data_processor.Processor
Randomly crop an image.
- Parameters
size (tuple | list) – the size to crop. i.e. [crop_height, crop_width]
seed (int) – seed of a random factor
-
__call__
(self, image, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.
-
blueoil.tfds_augmentor.
_random_flip_left_right_bounding_box
(image, gt_boxes, seed)¶ Flip left right only bounding box.
- Parameters
image (tf.Tensor) – image
gt_boxes (tf.Tensor) – bounding boxes. shape is [num_boxes, 5(x, y, w, h, class_id)]
seed (int) – seed of a random factor
-
class
blueoil.tfds_augmentor.
TFDSFlipLeftRight
(seed=0)¶ Bases:
blueoil.data_processor.Processor
Flip left right with a probability 0.5.
- Parameters
seed (int) – seed of a random factor
-
__call__
(self, image, gt_boxes=None, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.
-
class
blueoil.tfds_augmentor.
TFDSBrightness
(delta=0.25, seed=0)¶ Bases:
blueoil.data_processor.Processor
- Adjust the brightness of images by a random factor.
(picked from uniform distribution [-delta, delta) )
- Parameters
delta (float) – max delta for distribution. must be positive
seed (int) – seed of a random factor
-
__call__
(self, image, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.
-
class
blueoil.tfds_augmentor.
TFDSHue
(delta=10.0 / 255, seed=0)¶ Bases:
blueoil.data_processor.Processor
Randomly change image hue.
- Parameters
delta (float) – max delta for distribution. must be in [0, 0.5]
seed (int) – seed of a random factor
-
__call__
(self, image, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.
-
class
blueoil.tfds_augmentor.
TFDSSaturation
(value=(0.75, 1.25), seed=0)¶ Bases:
blueoil.data_processor.Processor
- Randomly adjust the saturation of a RGB image.
Random factor is picked from [lower, upper] 0 <= lower < upper must be satisfied.
- Parameters
value (float|tuple|list) – Range for random factor is taken as [1 - value, 1 + value] if value is float value and [1 - value[0], 1 + value[1]] if tuple or list with 2 elements
seed (int) – seed of a random factor
-
__call__
(self, image, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.
-
class
blueoil.tfds_augmentor.
TFDSContrast
(value=(0.75, 1.25), seed=0)¶ Bases:
blueoil.data_processor.Processor
- Randomly adjust the contrast of an image.
Random factor is picked from [lower, upper] 0 <= lower < upper must be satisfied.
- Parameters
value (float|tuple|list) – Range for random factor is taken as [1 - value, 1 + value] if value is float value and [1 - value[0], 1 + value[1]] if tuple or list with 2 elements
seed (int) – seed of a random factor
-
__call__
(self, image, **kwargs)¶ Call processor method for each a element of data.
Return image and labels etc.