From 715b1d9aa4150819248d899253ca693f5d28498f Mon Sep 17 00:00:00 2001 From: co63oc Date: Fri, 28 Mar 2025 16:28:38 +0800 Subject: [PATCH] Fix typos (#14941) --- benchmark/PaddleOCR_DBNet/data_loader/modules/augment.py | 8 ++++---- benchmark/PaddleOCR_DBNet/models/backbone/resnet.py | 2 +- benchmark/PaddleOCR_DBNet/tools/infer.py | 2 +- benchmark/PaddleOCR_DBNet/tools/predict.py | 2 +- .../utils/ocr_metric/icdar2015/detection/deteval.py | 2 +- .../utils/ocr_metric/icdar2015/detection/icdar2013.py | 2 +- benchmark/PaddleOCR_DBNet/utils/util.py | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/benchmark/PaddleOCR_DBNet/data_loader/modules/augment.py b/benchmark/PaddleOCR_DBNet/data_loader/modules/augment.py index bd0e483c8..3b08a0281 100644 --- a/benchmark/PaddleOCR_DBNet/data_loader/modules/augment.py +++ b/benchmark/PaddleOCR_DBNet/data_loader/modules/augment.py @@ -33,7 +33,7 @@ class RandomScale: def __init__(self, scales, random_rate): """ :param scales: 尺度 - :param ramdon_rate: 随机系数 + :param random_rate: 随机系数 :return: """ self.random_rate = random_rate @@ -64,7 +64,7 @@ class RandomRotateImgBox: def __init__(self, degrees, random_rate, same_size=False): """ :param degrees: 角度,可以是一个数值或者list - :param ramdon_rate: 随机系数 + :param random_rate: 随机系数 :param same_size: 是否保持和原图一样大 :return: """ @@ -145,7 +145,7 @@ class RandomResize: def __init__(self, size, random_rate, keep_ratio=False): """ :param input_size: resize尺寸,数字或者list的形式,如果为list形式,就是[w,h] - :param ramdon_rate: 随机系数 + :param random_rate: 随机系数 :param keep_ratio: 是否保持长宽比 :return: """ @@ -280,7 +280,7 @@ class HorizontalFlip: return data -class VerticallFlip: +class VerticalFlip: def __init__(self, random_rate): """ diff --git a/benchmark/PaddleOCR_DBNet/models/backbone/resnet.py b/benchmark/PaddleOCR_DBNet/models/backbone/resnet.py index 597136dfd..9aa886d18 100644 --- a/benchmark/PaddleOCR_DBNet/models/backbone/resnet.py +++ b/benchmark/PaddleOCR_DBNet/models/backbone/resnet.py @@ -60,7 +60,7 @@ class BasicBlock(nn.Layer): planes, planes, kernel_size=3, padding=1, bias_attr=False ) else: - from paddle.version.ops import DeformConv2D + from paddle.vision.ops import DeformConv2D deformable_groups = dcn.get("deformable_groups", 1) offset_channels = 18 diff --git a/benchmark/PaddleOCR_DBNet/tools/infer.py b/benchmark/PaddleOCR_DBNet/tools/infer.py index 30428e9dd..fb4253651 100644 --- a/benchmark/PaddleOCR_DBNet/tools/infer.py +++ b/benchmark/PaddleOCR_DBNet/tools/infer.py @@ -35,7 +35,7 @@ from utils.util import draw_bbox, save_result class InferenceEngine(object): """InferenceEngine - Inference engina class which contains preprocess, run, postprocess + Inference engine class which contains preprocess, run, postprocess """ def __init__(self, args): diff --git a/benchmark/PaddleOCR_DBNet/tools/predict.py b/benchmark/PaddleOCR_DBNet/tools/predict.py index 56312a27f..3d6a08952 100644 --- a/benchmark/PaddleOCR_DBNet/tools/predict.py +++ b/benchmark/PaddleOCR_DBNet/tools/predict.py @@ -69,7 +69,7 @@ class PaddleModel: def predict(self, img_path: str, is_output_polygon=False, short_size: int = 1024): """ - 对传入的图像进行预测,支持图像地址,opecv 读取图片,偏慢 + 对传入的图像进行预测,支持图像地址,opencv 读取图片,偏慢 :param img_path: 图像地址 :param is_numpy: :return: diff --git a/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/deteval.py b/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/deteval.py index a23839e3d..7b799ec55 100644 --- a/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/deteval.py +++ b/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/deteval.py @@ -209,7 +209,7 @@ class DetectionDetEvalEvaluator(object): precision = 0 if len(detRects) > 0 else 1 if len(detRects) > 0: - # Calculate recall and precision matrixs + # Calculate recall and precision matrixes outputShape = [len(gtRects), len(detRects)] recallMat = np.empty(outputShape) precisionMat = np.empty(outputShape) diff --git a/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/icdar2013.py b/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/icdar2013.py index d29c2c0c0..1fd67b5e4 100644 --- a/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/icdar2013.py +++ b/benchmark/PaddleOCR_DBNet/utils/ocr_metric/icdar2015/detection/icdar2013.py @@ -187,7 +187,7 @@ class DetectionICDAR2013Evaluator(object): precision = 0 if len(detRects) > 0 else 1 if len(detRects) > 0: - # Calculate recall and precision matrixs + # Calculate recall and precision matrixes outputShape = [len(gtRects), len(detRects)] recallMat = np.empty(outputShape) precisionMat = np.empty(outputShape) diff --git a/benchmark/PaddleOCR_DBNet/utils/util.py b/benchmark/PaddleOCR_DBNet/utils/util.py index ad36cabb8..5efc9dc36 100644 --- a/benchmark/PaddleOCR_DBNet/utils/util.py +++ b/benchmark/PaddleOCR_DBNet/utils/util.py @@ -303,7 +303,7 @@ class Config(object): def print_cfg(self, print_func=print): """ Recursively visualize a dict and - indenting acrrording by the relationship of keys. + indenting according by the relationship of keys. """ print_func("----------- Config -----------") print_dict(self.cfg, print_func)