|
@@ -116,7 +116,7 @@ class Compose(object):
|
|
|
|
|
|
def __call__(self, sample):
|
|
def __call__(self, sample):
|
|
"""
|
|
"""
|
|
- This is equivalent to sequentially calling compose_obj.apply_transforms()
|
|
|
|
|
|
+ This is equivalent to sequentially calling compose_obj.apply_transforms()
|
|
and compose_obj.arrange_outputs().
|
|
and compose_obj.arrange_outputs().
|
|
"""
|
|
"""
|
|
if 'trans_info' not in sample:
|
|
if 'trans_info' not in sample:
|
|
@@ -193,20 +193,20 @@ class Transform(object):
|
|
class DecodeImg(Transform):
|
|
class DecodeImg(Transform):
|
|
"""
|
|
"""
|
|
Decode image(s) in input.
|
|
Decode image(s) in input.
|
|
-
|
|
|
|
|
|
+
|
|
Args:
|
|
Args:
|
|
- to_rgb (bool, optional): If True, convert input image(s) from BGR format to
|
|
|
|
|
|
+ to_rgb (bool, optional): If True, convert input image(s) from BGR format to
|
|
RGB format. Defaults to True.
|
|
RGB format. Defaults to True.
|
|
- to_uint8 (bool, optional): If True, quantize and convert decoded image(s) to
|
|
|
|
|
|
+ to_uint8 (bool, optional): If True, quantize and convert decoded image(s) to
|
|
uint8 type. Defaults to True.
|
|
uint8 type. Defaults to True.
|
|
- decode_bgr (bool, optional): If True, automatically interpret a non-geo image
|
|
|
|
|
|
+ decode_bgr (bool, optional): If True, automatically interpret a non-geo image
|
|
(e.g., jpeg images) as a BGR image. Defaults to True.
|
|
(e.g., jpeg images) as a BGR image. Defaults to True.
|
|
- decode_sar (bool, optional): If True, automatically interpret a single-channel
|
|
|
|
- geo image (e.g. geotiff images) as a SAR image, set this argument to
|
|
|
|
|
|
+ decode_sar (bool, optional): If True, automatically interpret a single-channel
|
|
|
|
+ geo image (e.g. geotiff images) as a SAR image, set this argument to
|
|
True. Defaults to True.
|
|
True. Defaults to True.
|
|
- read_geo_info (bool, optional): If True, read geographical information from
|
|
|
|
|
|
+ read_geo_info (bool, optional): If True, read geographical information from
|
|
the image. Deafults to False.
|
|
the image. Deafults to False.
|
|
- use_stretch (bool, optional): Whether to apply 2% linear stretch. Valid only if
|
|
|
|
|
|
+ use_stretch (bool, optional): Whether to apply 2% linear stretch. Valid only if
|
|
`to_uint8` is True. Defaults to False.
|
|
`to_uint8` is True. Defaults to False.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -391,13 +391,13 @@ class Resize(Transform):
|
|
|
|
|
|
Args:
|
|
Args:
|
|
target_size (int | list[int] | tuple[int]): Target size. If it is an integer, the
|
|
target_size (int | list[int] | tuple[int]): Target size. If it is an integer, the
|
|
- target height and width will be both set to `target_size`. Otherwise,
|
|
|
|
|
|
+ target height and width will be both set to `target_size`. Otherwise,
|
|
`target_size` represents [target height, target width].
|
|
`target_size` represents [target height, target width].
|
|
- interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
- {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
|
|
|
|
+ interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
+ {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
Defaults to 'LINEAR'.
|
|
Defaults to 'LINEAR'.
|
|
- keep_ratio (bool, optional): If True, the scaling factor of width and height will
|
|
|
|
- be set to same value, and height/width of the resized image will be not
|
|
|
|
|
|
+ keep_ratio (bool, optional): If True, the scaling factor of width and height will
|
|
|
|
+ be set to same value, and height/width of the resized image will be not
|
|
greater than the target width/height. Defaults to False.
|
|
greater than the target width/height. Defaults to False.
|
|
|
|
|
|
Raises:
|
|
Raises:
|
|
@@ -526,8 +526,8 @@ class RandomResize(Transform):
|
|
Args:
|
|
Args:
|
|
target_sizes (list[int] | list[list|tuple] | tuple[list|tuple]):
|
|
target_sizes (list[int] | list[list|tuple] | tuple[list|tuple]):
|
|
Multiple target sizes, each of which should be int, list, or tuple.
|
|
Multiple target sizes, each of which should be int, list, or tuple.
|
|
- interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
- {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
|
|
|
|
+ interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
+ {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
Defaults to 'LINEAR'.
|
|
Defaults to 'LINEAR'.
|
|
|
|
|
|
Raises:
|
|
Raises:
|
|
@@ -566,8 +566,8 @@ class ResizeByShort(Transform):
|
|
short_size (int): Target size of the shorter side of the image(s).
|
|
short_size (int): Target size of the shorter side of the image(s).
|
|
max_size (int, optional): Upper bound of longer side of the image(s). If
|
|
max_size (int, optional): Upper bound of longer side of the image(s). If
|
|
`max_size` is -1, no upper bound will be applied. Defaults to -1.
|
|
`max_size` is -1, no upper bound will be applied. Defaults to -1.
|
|
- interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
- {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
|
|
|
|
+ interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
+ {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
Defaults to 'LINEAR'.
|
|
Defaults to 'LINEAR'.
|
|
|
|
|
|
Raises:
|
|
Raises:
|
|
@@ -606,10 +606,10 @@ class RandomResizeByShort(Transform):
|
|
|
|
|
|
Args:
|
|
Args:
|
|
short_sizes (list[int]): Target size of the shorter side of the image(s).
|
|
short_sizes (list[int]): Target size of the shorter side of the image(s).
|
|
- max_size (int, optional): Upper bound of longer side of the image(s).
|
|
|
|
|
|
+ max_size (int, optional): Upper bound of longer side of the image(s).
|
|
If `max_size` is -1, no upper bound will be applied. Defaults to -1.
|
|
If `max_size` is -1, no upper bound will be applied. Defaults to -1.
|
|
- interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
- {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
|
|
|
|
+ interp (str, optional): Interpolation method for resizing image(s). One of
|
|
|
|
+ {'NEAREST', 'LINEAR', 'CUBIC', 'AREA', 'LANCZOS4', 'RANDOM'}.
|
|
Defaults to 'LINEAR'.
|
|
Defaults to 'LINEAR'.
|
|
|
|
|
|
Raises:
|
|
Raises:
|
|
@@ -663,12 +663,12 @@ class RandomFlipOrRotate(Transform):
|
|
Flip or Rotate an image in different directions with a certain probability.
|
|
Flip or Rotate an image in different directions with a certain probability.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- probs (list[float]): Probabilities of performing flipping and rotation.
|
|
|
|
|
|
+ probs (list[float]): Probabilities of performing flipping and rotation.
|
|
Default: [0.35,0.25].
|
|
Default: [0.35,0.25].
|
|
- probsf (list[float]): Probabilities of 5 flipping modes (horizontal,
|
|
|
|
- vertical, both horizontal and vertical, diagonal, anti-diagonal).
|
|
|
|
|
|
+ probsf (list[float]): Probabilities of 5 flipping modes (horizontal,
|
|
|
|
+ vertical, both horizontal and vertical, diagonal, anti-diagonal).
|
|
Default: [0.3, 0.3, 0.2, 0.1, 0.1].
|
|
Default: [0.3, 0.3, 0.2, 0.1, 0.1].
|
|
- probsr (list[float]): Probabilities of 3 rotation modes (90°, 180°, 270°
|
|
|
|
|
|
+ probsr (list[float]): Probabilities of 3 rotation modes (90°, 180°, 270°
|
|
clockwise). Default: [0.25, 0.5, 0.25].
|
|
clockwise). Default: [0.25, 0.5, 0.25].
|
|
|
|
|
|
Examples:
|
|
Examples:
|
|
@@ -938,13 +938,13 @@ class Normalize(Transform):
|
|
3. im = im / std
|
|
3. im = im / std
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- mean (list[float] | tuple[float], optional): Mean of input image(s).
|
|
|
|
|
|
+ mean (list[float] | tuple[float], optional): Mean of input image(s).
|
|
Defaults to [0.485, 0.456, 0.406].
|
|
Defaults to [0.485, 0.456, 0.406].
|
|
- std (list[float] | tuple[float], optional): Standard deviation of input
|
|
|
|
|
|
+ std (list[float] | tuple[float], optional): Standard deviation of input
|
|
image(s). Defaults to [0.229, 0.224, 0.225].
|
|
image(s). Defaults to [0.229, 0.224, 0.225].
|
|
- min_val (list[float] | tuple[float], optional): Minimum value of input
|
|
|
|
|
|
+ min_val (list[float] | tuple[float], optional): Minimum value of input
|
|
image(s). If None, use 0 for all channels. Defaults to None.
|
|
image(s). If None, use 0 for all channels. Defaults to None.
|
|
- max_val (list[float] | tuple[float], optional): Maximum value of input
|
|
|
|
|
|
+ max_val (list[float] | tuple[float], optional): Maximum value of input
|
|
image(s). If None, use 255. for all channels. Defaults to None.
|
|
image(s). If None, use 255. for all channels. Defaults to None.
|
|
apply_to_tar (bool, optional): Whether to apply transformation to the target
|
|
apply_to_tar (bool, optional): Whether to apply transformation to the target
|
|
image. Defaults to True.
|
|
image. Defaults to True.
|
|
@@ -1004,7 +1004,7 @@ class CenterCrop(Transform):
|
|
2. Crop the image.
|
|
2. Crop the image.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- crop_size (int, optional): Target size of the cropped image(s).
|
|
|
|
|
|
+ crop_size (int, optional): Target size of the cropped image(s).
|
|
Defaults to 224.
|
|
Defaults to 224.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -1038,26 +1038,26 @@ class CenterCrop(Transform):
|
|
class RandomCrop(Transform):
|
|
class RandomCrop(Transform):
|
|
"""
|
|
"""
|
|
Randomly crop the input.
|
|
Randomly crop the input.
|
|
- 1. Compute the height and width of cropped area according to `aspect_ratio` and
|
|
|
|
|
|
+ 1. Compute the height and width of cropped area according to `aspect_ratio` and
|
|
`scaling`.
|
|
`scaling`.
|
|
2. Locate the upper left corner of cropped area randomly.
|
|
2. Locate the upper left corner of cropped area randomly.
|
|
3. Crop the image(s).
|
|
3. Crop the image(s).
|
|
4. Resize the cropped area to `crop_size` x `crop_size`.
|
|
4. Resize the cropped area to `crop_size` x `crop_size`.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- crop_size (int | list[int] | tuple[int]): Target size of the cropped area. If
|
|
|
|
|
|
+ crop_size (int | list[int] | tuple[int]): Target size of the cropped area. If
|
|
None, the cropped area will not be resized. Defaults to None.
|
|
None, the cropped area will not be resized. Defaults to None.
|
|
- aspect_ratio (list[float], optional): Aspect ratio of cropped region in
|
|
|
|
|
|
+ aspect_ratio (list[float], optional): Aspect ratio of cropped region in
|
|
[min, max] format. Defaults to [.5, 2.].
|
|
[min, max] format. Defaults to [.5, 2.].
|
|
- thresholds (list[float], optional): Iou thresholds to decide a valid bbox
|
|
|
|
|
|
+ thresholds (list[float], optional): Iou thresholds to decide a valid bbox
|
|
crop. Defaults to [.0, .1, .3, .5, .7, .9].
|
|
crop. Defaults to [.0, .1, .3, .5, .7, .9].
|
|
- scaling (list[float], optional): Ratio between the cropped region and the
|
|
|
|
|
|
+ scaling (list[float], optional): Ratio between the cropped region and the
|
|
original image in [min, max] format. Defaults to [.3, 1.].
|
|
original image in [min, max] format. Defaults to [.3, 1.].
|
|
- num_attempts (int, optional): Max number of tries before giving up.
|
|
|
|
|
|
+ num_attempts (int, optional): Max number of tries before giving up.
|
|
Defaults to 50.
|
|
Defaults to 50.
|
|
- allow_no_crop (bool, optional): Whether returning without doing crop is
|
|
|
|
|
|
+ allow_no_crop (bool, optional): Whether returning without doing crop is
|
|
allowed. Defaults to True.
|
|
allowed. Defaults to True.
|
|
- cover_all_box (bool, optional): Whether to ensure all bboxes be covered in
|
|
|
|
|
|
+ cover_all_box (bool, optional): Whether to ensure all bboxes be covered in
|
|
the final crop. Defaults to False.
|
|
the final crop. Defaults to False.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -1251,7 +1251,7 @@ class RandomScaleAspect(Transform):
|
|
"""
|
|
"""
|
|
Crop input image(s) and resize back to original sizes.
|
|
Crop input image(s) and resize back to original sizes.
|
|
|
|
|
|
- Args:
|
|
|
|
|
|
+ Args:
|
|
min_scale (float): Minimum ratio between the cropped region and the original
|
|
min_scale (float): Minimum ratio between the cropped region and the original
|
|
image. If 0, image(s) will not be cropped. Defaults to .5.
|
|
image. If 0, image(s) will not be cropped. Defaults to .5.
|
|
aspect_ratio (float): Aspect ratio of cropped region. Defaults to .33.
|
|
aspect_ratio (float): Aspect ratio of cropped region. Defaults to .33.
|
|
@@ -1279,12 +1279,12 @@ class RandomExpand(Transform):
|
|
Randomly expand the input by padding according to random offsets.
|
|
Randomly expand the input by padding according to random offsets.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- upper_ratio (float, optional): Maximum ratio to which the original image
|
|
|
|
|
|
+ upper_ratio (float, optional): Maximum ratio to which the original image
|
|
is expanded. Defaults to 4..
|
|
is expanded. Defaults to 4..
|
|
prob (float, optional): Probability of apply expanding. Defaults to .5.
|
|
prob (float, optional): Probability of apply expanding. Defaults to .5.
|
|
- im_padding_value (list[float] | tuple[float], optional): RGB filling value
|
|
|
|
|
|
+ im_padding_value (list[float] | tuple[float], optional): RGB filling value
|
|
for the image. Defaults to (127.5, 127.5, 127.5).
|
|
for the image. Defaults to (127.5, 127.5, 127.5).
|
|
- label_padding_value (int, optional): Filling value for the mask.
|
|
|
|
|
|
+ label_padding_value (int, optional): Filling value for the mask.
|
|
Defaults to 255.
|
|
Defaults to 255.
|
|
|
|
|
|
See Also:
|
|
See Also:
|
|
@@ -1337,17 +1337,17 @@ class Pad(Transform):
|
|
Pad image to a specified size or multiple of `size_divisor`.
|
|
Pad image to a specified size or multiple of `size_divisor`.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- target_size (list[int] | tuple[int], optional): Image target size, if None, pad to
|
|
|
|
|
|
+ target_size (list[int] | tuple[int], optional): Image target size, if None, pad to
|
|
multiple of size_divisor. Defaults to None.
|
|
multiple of size_divisor. Defaults to None.
|
|
pad_mode (int, optional): Pad mode. Currently only four modes are supported:
|
|
pad_mode (int, optional): Pad mode. Currently only four modes are supported:
|
|
[-1, 0, 1, 2]. if -1, use specified offsets. If 0, only pad to right and bottom
|
|
[-1, 0, 1, 2]. if -1, use specified offsets. If 0, only pad to right and bottom
|
|
If 1, pad according to center. If 2, only pad left and top. Defaults to 0.
|
|
If 1, pad according to center. If 2, only pad left and top. Defaults to 0.
|
|
offsets (list[int]|None, optional): Padding offsets. Defaults to None.
|
|
offsets (list[int]|None, optional): Padding offsets. Defaults to None.
|
|
- im_padding_value (list[float] | tuple[float]): RGB value of padded area.
|
|
|
|
|
|
+ im_padding_value (list[float] | tuple[float]): RGB value of padded area.
|
|
Defaults to (127.5, 127.5, 127.5).
|
|
Defaults to (127.5, 127.5, 127.5).
|
|
- label_padding_value (int, optional): Filling value for the mask.
|
|
|
|
|
|
+ label_padding_value (int, optional): Filling value for the mask.
|
|
Defaults to 255.
|
|
Defaults to 255.
|
|
- size_divisor (int): Image width and height after padding will be a multiple of
|
|
|
|
|
|
+ size_divisor (int): Image width and height after padding will be a multiple of
|
|
`size_divisor`.
|
|
`size_divisor`.
|
|
"""
|
|
"""
|
|
super(Pad, self).__init__()
|
|
super(Pad, self).__init__()
|
|
@@ -1426,7 +1426,7 @@ class Pad(Transform):
|
|
h, w = self.target_size
|
|
h, w = self.target_size
|
|
assert (
|
|
assert (
|
|
im_h <= h and im_w <= w
|
|
im_h <= h and im_w <= w
|
|
- ), 'target size ({}, {}) cannot be less than image size ({}, {})'\
|
|
|
|
|
|
+ ), 'target size ({}, {}) cannot be less than image size ({}, {})' \
|
|
.format(h, w, im_h, im_w)
|
|
.format(h, w, im_h, im_w)
|
|
else:
|
|
else:
|
|
h = (np.ceil(im_h / self.size_divisor) *
|
|
h = (np.ceil(im_h / self.size_divisor) *
|
|
@@ -1477,11 +1477,12 @@ class MixupImage(Transform):
|
|
Mixup two images and their gt_bbbox/gt_score.
|
|
Mixup two images and their gt_bbbox/gt_score.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- alpha (float, optional): Alpha parameter of beta distribution.
|
|
|
|
|
|
+ alpha (float, optional): Alpha parameter of beta distribution.
|
|
Defaults to 1.5.
|
|
Defaults to 1.5.
|
|
- beta (float, optional): Beta parameter of beta distribution.
|
|
|
|
|
|
+ beta (float, optional): Beta parameter of beta distribution.
|
|
Defaults to 1.5.
|
|
Defaults to 1.5.
|
|
"""
|
|
"""
|
|
|
|
+
|
|
super(MixupImage, self).__init__()
|
|
super(MixupImage, self).__init__()
|
|
if alpha <= 0.0:
|
|
if alpha <= 0.0:
|
|
raise ValueError("`alpha` should be positive in MixupImage.")
|
|
raise ValueError("`alpha` should be positive in MixupImage.")
|
|
@@ -1558,24 +1559,24 @@ class RandomDistort(Transform):
|
|
Random color distortion.
|
|
Random color distortion.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- brightness_range (float, optional): Range of brightness distortion.
|
|
|
|
|
|
+ brightness_range (float, optional): Range of brightness distortion.
|
|
Defaults to .5.
|
|
Defaults to .5.
|
|
- brightness_prob (float, optional): Probability of brightness distortion.
|
|
|
|
|
|
+ brightness_prob (float, optional): Probability of brightness distortion.
|
|
Defaults to .5.
|
|
Defaults to .5.
|
|
- contrast_range (float, optional): Range of contrast distortion.
|
|
|
|
|
|
+ contrast_range (float, optional): Range of contrast distortion.
|
|
Defaults to .5.
|
|
Defaults to .5.
|
|
- contrast_prob (float, optional): Probability of contrast distortion.
|
|
|
|
|
|
+ contrast_prob (float, optional): Probability of contrast distortion.
|
|
Defaults to .5.
|
|
Defaults to .5.
|
|
- saturation_range (float, optional): Range of saturation distortion.
|
|
|
|
|
|
+ saturation_range (float, optional): Range of saturation distortion.
|
|
Defaults to .5.
|
|
Defaults to .5.
|
|
- saturation_prob (float, optional): Probability of saturation distortion.
|
|
|
|
|
|
+ saturation_prob (float, optional): Probability of saturation distortion.
|
|
Defaults to .5.
|
|
Defaults to .5.
|
|
hue_range (float, optional): Range of hue distortion. Defaults to .5.
|
|
hue_range (float, optional): Range of hue distortion. Defaults to .5.
|
|
hue_prob (float, optional): Probability of hue distortion. Defaults to .5.
|
|
hue_prob (float, optional): Probability of hue distortion. Defaults to .5.
|
|
random_apply (bool, optional): Apply the transformation in random (yolo) or
|
|
random_apply (bool, optional): Apply the transformation in random (yolo) or
|
|
fixed (SSD) order. Defaults to True.
|
|
fixed (SSD) order. Defaults to True.
|
|
count (int, optional): Number of distortions to apply. Defaults to 4.
|
|
count (int, optional): Number of distortions to apply. Defaults to 4.
|
|
- shuffle_channel (bool, optional): Whether to swap channels randomly.
|
|
|
|
|
|
+ shuffle_channel (bool, optional): Whether to swap channels randomly.
|
|
Defaults to False.
|
|
Defaults to False.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -1722,7 +1723,7 @@ class RandomBlur(Transform):
|
|
"""
|
|
"""
|
|
Randomly blur input image(s).
|
|
Randomly blur input image(s).
|
|
|
|
|
|
- Args:
|
|
|
|
|
|
+ Args:
|
|
prob (float): Probability of blurring.
|
|
prob (float): Probability of blurring.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -1758,7 +1759,7 @@ class Dehaze(Transform):
|
|
"""
|
|
"""
|
|
Dehaze input image(s).
|
|
Dehaze input image(s).
|
|
|
|
|
|
- Args:
|
|
|
|
|
|
+ Args:
|
|
gamma (bool, optional): Use gamma correction or not. Defaults to False.
|
|
gamma (bool, optional): Use gamma correction or not. Defaults to False.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -1781,7 +1782,7 @@ class ReduceDim(Transform):
|
|
"""
|
|
"""
|
|
Use PCA to reduce the dimension of input image(s).
|
|
Use PCA to reduce the dimension of input image(s).
|
|
|
|
|
|
- Args:
|
|
|
|
|
|
+ Args:
|
|
joblib_path (str): Path of *.joblib file of PCA.
|
|
joblib_path (str): Path of *.joblib file of PCA.
|
|
apply_to_tar (bool, optional): Whether to apply transformation to the target
|
|
apply_to_tar (bool, optional): Whether to apply transformation to the target
|
|
image. Defaults to True.
|
|
image. Defaults to True.
|
|
@@ -1816,8 +1817,8 @@ class SelectBand(Transform):
|
|
"""
|
|
"""
|
|
Select a set of bands of input image(s).
|
|
Select a set of bands of input image(s).
|
|
|
|
|
|
- Args:
|
|
|
|
- band_list (list, optional): Bands to select (band index starts from 1).
|
|
|
|
|
|
+ Args:
|
|
|
|
+ band_list (list, optional): Bands to select (band index starts from 1).
|
|
Defaults to [1, 2, 3].
|
|
Defaults to [1, 2, 3].
|
|
apply_to_tar (bool, optional): Whether to apply transformation to the target
|
|
apply_to_tar (bool, optional): Whether to apply transformation to the target
|
|
image. Defaults to True.
|
|
image. Defaults to True.
|
|
@@ -1935,7 +1936,7 @@ class RandomSwap(Transform):
|
|
Randomly swap multi-temporal images.
|
|
Randomly swap multi-temporal images.
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- prob (float, optional): Probability of swapping the input images.
|
|
|
|
|
|
+ prob (float, optional): Probability of swapping the input images.
|
|
Default: 0.2.
|
|
Default: 0.2.
|
|
"""
|
|
"""
|
|
|
|
|
|
@@ -1967,15 +1968,15 @@ class AppendIndex(Transform):
|
|
Append remote sensing index to input image(s).
|
|
Append remote sensing index to input image(s).
|
|
|
|
|
|
Args:
|
|
Args:
|
|
- index_type (str): Type of remote sensinng index. See supported
|
|
|
|
- index types in
|
|
|
|
|
|
+ index_type (str): Type of remote sensinng index. See supported
|
|
|
|
+ index types in
|
|
https://github.com/PaddlePaddle/PaddleRS/tree/develop/paddlers/transforms/indices.py .
|
|
https://github.com/PaddlePaddle/PaddleRS/tree/develop/paddlers/transforms/indices.py .
|
|
- band_indices (dict, optional): Mapping of band names to band indices
|
|
|
|
- (starting from 1). See band names in
|
|
|
|
|
|
+ band_indices (dict, optional): Mapping of band names to band indices
|
|
|
|
+ (starting from 1). See band names in
|
|
https://github.com/PaddlePaddle/PaddleRS/tree/develop/paddlers/transforms/indices.py .
|
|
https://github.com/PaddlePaddle/PaddleRS/tree/develop/paddlers/transforms/indices.py .
|
|
Default: None.
|
|
Default: None.
|
|
- satellite (str, optional): Type of satellite. If set,
|
|
|
|
- band indices will be automatically determined accordingly. See supported satellites in
|
|
|
|
|
|
+ satellite (str, optional): Type of satellite. If set,
|
|
|
|
+ band indices will be automatically determined accordingly. See supported satellites in
|
|
https://github.com/PaddlePaddle/PaddleRS/tree/develop/paddlers/transforms/satellites.py .
|
|
https://github.com/PaddlePaddle/PaddleRS/tree/develop/paddlers/transforms/satellites.py .
|
|
Default: None.
|
|
Default: None.
|
|
"""
|
|
"""
|
|
@@ -2025,8 +2026,8 @@ class MatchRadiance(Transform):
|
|
|
|
|
|
Args:
|
|
Args:
|
|
method (str, optional): Method used to match the radiance of the
|
|
method (str, optional): Method used to match the radiance of the
|
|
- bi-temporal images. Choices are {'hist', 'lsr', 'fft}. 'hist'
|
|
|
|
- stands for histogram matching, 'lsr' stands for least-squares
|
|
|
|
|
|
+ bi-temporal images. Choices are {'hist', 'lsr', 'fft}. 'hist'
|
|
|
|
+ stands for histogram matching, 'lsr' stands for least-squares
|
|
regression, and 'fft' replaces the low-frequency components of
|
|
regression, and 'fft' replaces the low-frequency components of
|
|
the image to match the reference image. Default: 'hist'.
|
|
the image to match the reference image. Default: 'hist'.
|
|
"""
|
|
"""
|