diff --git a/model_zoo/official/cv/ctpn/src/dataset.py b/model_zoo/official/cv/ctpn/src/dataset.py index e715699dec9..ff2a9a0cf1f 100644 --- a/model_zoo/official/cv/ctpn/src/dataset.py +++ b/model_zoo/official/cv/ctpn/src/dataset.py @@ -50,7 +50,7 @@ class PhotoMetricDistortion: self.contrast_upper) img *= alpha # convert color from BGR to HSV - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_BGR2HSV'))) + img = cv2.cvtColor((img, cv2.COLOR_BGR2HSV)) # random saturation if random.randint(2): img[..., 1] *= random.uniform(self.saturation_lower, @@ -61,7 +61,7 @@ class PhotoMetricDistortion: img[..., 0][img[..., 0] > 360] -= 360 img[..., 0][img[..., 0] < 0] += 360 # convert color from HSV to BGR - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_HSV2BGR'))) + img = cv2.cvtColor((img, cv2.COLOR_HSV2BGR)) # random contrast if mode == 0: if random.randint(2): diff --git a/model_zoo/official/cv/deeptext/src/dataset.py b/model_zoo/official/cv/deeptext/src/dataset.py index de6e643e8a9..4c49635c37a 100644 --- a/model_zoo/official/cv/deeptext/src/dataset.py +++ b/model_zoo/official/cv/deeptext/src/dataset.py @@ -107,7 +107,7 @@ class PhotoMetricDistortion: img *= alpha # convert color from BGR to HSV - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_BGR2HSV'))) + img = cv2.cvtColor((img, cv2.COLOR_BGR2HSV)) # random saturation if random.randint(2): @@ -121,7 +121,7 @@ class PhotoMetricDistortion: img[..., 0][img[..., 0] < 0] += 360 # convert color from HSV to BGR - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_HSV2BGR'))) + img = cv2.cvtColor((img, cv2.COLOR_HSV2BGR)) # random contrast if mode == 0: diff --git a/model_zoo/official/cv/faster_rcnn/src/dataset.py b/model_zoo/official/cv/faster_rcnn/src/dataset.py index 1adb7f217dd..6dd423f1203 100644 --- a/model_zoo/official/cv/faster_rcnn/src/dataset.py +++ b/model_zoo/official/cv/faster_rcnn/src/dataset.py @@ -102,7 +102,7 @@ class PhotoMetricDistortion: img *= alpha # convert color from BGR to HSV - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_BGR2HSV'))) + img = cv2.cvtColor((img, cv2.COLOR_BGR2HSV)) # random saturation if random.randint(2): @@ -116,7 +116,7 @@ class PhotoMetricDistortion: img[..., 0][img[..., 0] < 0] += 360 # convert color from HSV to BGR - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_HSV2BGR'))) + img = cv2.cvtColor((img, cv2.COLOR_HSV2BGR)) # random contrast if mode == 0: diff --git a/model_zoo/official/cv/maskrcnn/src/dataset.py b/model_zoo/official/cv/maskrcnn/src/dataset.py index d2c6b3936ec..61eb9be20cb 100644 --- a/model_zoo/official/cv/maskrcnn/src/dataset.py +++ b/model_zoo/official/cv/maskrcnn/src/dataset.py @@ -103,7 +103,7 @@ class PhotoMetricDistortion: img *= alpha # convert color from BGR to HSV - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_BGR2HSV'))) + img = cv2.cvtColor((img, cv2.COLOR_BGR2HSV)) # random saturation if random.randint(2): @@ -117,7 +117,7 @@ class PhotoMetricDistortion: img[..., 0][img[..., 0] < 0] += 360 # convert color from HSV to BGR - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_HSV2BGR'))) + img = cv2.cvtColor((img, cv2.COLOR_HSV2BGR)) # random contrast if mode == 0: diff --git a/model_zoo/official/cv/maskrcnn_mobilenetv1/src/dataset.py b/model_zoo/official/cv/maskrcnn_mobilenetv1/src/dataset.py index 817ea752e7d..2fc4764072f 100644 --- a/model_zoo/official/cv/maskrcnn_mobilenetv1/src/dataset.py +++ b/model_zoo/official/cv/maskrcnn_mobilenetv1/src/dataset.py @@ -116,7 +116,7 @@ class PhotoMetricDistortion: img *= alpha # convert color from BGR to HSV - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_BGR2HSV'))) + img = cv2.cvtColor((img, cv2.COLOR_BGR2HSV)) # random saturation if random.randint(2): @@ -130,7 +130,7 @@ class PhotoMetricDistortion: img[..., 0][img[..., 0] < 0] += 360 # convert color from HSV to BGR - img = cv2.cvtColor((img, getattr(cv2, f'COLOR_HSV2BGR'))) + img = cv2.cvtColor((img, cv2.COLOR_HSV2BGR)) # random contrast if mode == 0: