From ab6ca82d2af79384016d19e64daa5b19cc0691e9 Mon Sep 17 00:00:00 2001 From: nuaaceieyty <58867937+nuaaceieyty@users.noreply.github.com> Date: Tue, 3 Aug 2021 20:48:06 +0800 Subject: [PATCH] Fixed some spelling errors and corrected ImageError to UnidentifiedImageError (#3846) --- ppdet/data/transform/mot_operators.py | 5 +++-- ppdet/data/transform/operators.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ppdet/data/transform/mot_operators.py b/ppdet/data/transform/mot_operators.py index 5af64bb44..a656102de 100644 --- a/ppdet/data/transform/mot_operators.py +++ b/ppdet/data/transform/mot_operators.py @@ -108,7 +108,8 @@ class LetterBoxResize(BaseOperator): if not isinstance(im, np.ndarray): raise TypeError("{}: image type is not numpy.".format(self)) if len(im.shape) != 3: - raise ImageError('{}: image is not 3-dimensional.'.format(self)) + from PIL import UnidentifiedImageError + raise UnidentifiedImageError('{}: image is not 3-dimensional.'.format(self)) # apply image height, width = self.target_size @@ -135,7 +136,7 @@ class MOTRandomAffine(BaseOperator): Args: degrees (list[2]): the rotate range to apply, transform range is [min, max] - translate (list[2]): the translate range to apply, ransform range is [min, max] + translate (list[2]): the translate range to apply, transform range is [min, max] scale (list[2]): the scale range to apply, transform range is [min, max] shear (list[2]): the shear range to apply, transform range is [min, max] borderValue (list[3]): value used in case of a constant border when appling diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index 2053606df..969bdbd41 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -199,7 +199,7 @@ class RandomErasingImage(BaseOperator): super(RandomErasingImage, self).__init__() self.prob = prob self.lower = lower - self.heigher = heigher + self.higher = higher self.aspect_ratio = aspect_ratio def apply(self, sample): -- GitLab