This commit is contained in:
co63oc 2025-03-28 16:28:38 +08:00 committed by GitHub
parent 33fa33e4a9
commit 715b1d9aa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 10 additions and 10 deletions

View File

@ -33,7 +33,7 @@ class RandomScale:
def __init__(self, scales, random_rate): def __init__(self, scales, random_rate):
""" """
:param scales: 尺度 :param scales: 尺度
:param ramdon_rate: 随机系数 :param random_rate: 随机系数
:return: :return:
""" """
self.random_rate = random_rate self.random_rate = random_rate
@ -64,7 +64,7 @@ class RandomRotateImgBox:
def __init__(self, degrees, random_rate, same_size=False): def __init__(self, degrees, random_rate, same_size=False):
""" """
:param degrees: 角度可以是一个数值或者list :param degrees: 角度可以是一个数值或者list
:param ramdon_rate: 随机系数 :param random_rate: 随机系数
:param same_size: 是否保持和原图一样大 :param same_size: 是否保持和原图一样大
:return: :return:
""" """
@ -145,7 +145,7 @@ class RandomResize:
def __init__(self, size, random_rate, keep_ratio=False): def __init__(self, size, random_rate, keep_ratio=False):
""" """
:param input_size: resize尺寸,数字或者list的形式如果为list形式就是[w,h] :param input_size: resize尺寸,数字或者list的形式如果为list形式就是[w,h]
:param ramdon_rate: 随机系数 :param random_rate: 随机系数
:param keep_ratio: 是否保持长宽比 :param keep_ratio: 是否保持长宽比
:return: :return:
""" """
@ -280,7 +280,7 @@ class HorizontalFlip:
return data return data
class VerticallFlip: class VerticalFlip:
def __init__(self, random_rate): def __init__(self, random_rate):
""" """

View File

@ -60,7 +60,7 @@ class BasicBlock(nn.Layer):
planes, planes, kernel_size=3, padding=1, bias_attr=False planes, planes, kernel_size=3, padding=1, bias_attr=False
) )
else: else:
from paddle.version.ops import DeformConv2D from paddle.vision.ops import DeformConv2D
deformable_groups = dcn.get("deformable_groups", 1) deformable_groups = dcn.get("deformable_groups", 1)
offset_channels = 18 offset_channels = 18

View File

@ -35,7 +35,7 @@ from utils.util import draw_bbox, save_result
class InferenceEngine(object): class InferenceEngine(object):
"""InferenceEngine """InferenceEngine
Inference engina class which contains preprocess, run, postprocess Inference engine class which contains preprocess, run, postprocess
""" """
def __init__(self, args): def __init__(self, args):

View File

@ -69,7 +69,7 @@ class PaddleModel:
def predict(self, img_path: str, is_output_polygon=False, short_size: int = 1024): def predict(self, img_path: str, is_output_polygon=False, short_size: int = 1024):
""" """
对传入的图像进行预测支持图像地址,opecv 读取图片偏慢 对传入的图像进行预测支持图像地址,opencv 读取图片偏慢
:param img_path: 图像地址 :param img_path: 图像地址
:param is_numpy: :param is_numpy:
:return: :return:

View File

@ -209,7 +209,7 @@ class DetectionDetEvalEvaluator(object):
precision = 0 if len(detRects) > 0 else 1 precision = 0 if len(detRects) > 0 else 1
if len(detRects) > 0: if len(detRects) > 0:
# Calculate recall and precision matrixs # Calculate recall and precision matrixes
outputShape = [len(gtRects), len(detRects)] outputShape = [len(gtRects), len(detRects)]
recallMat = np.empty(outputShape) recallMat = np.empty(outputShape)
precisionMat = np.empty(outputShape) precisionMat = np.empty(outputShape)

View File

@ -187,7 +187,7 @@ class DetectionICDAR2013Evaluator(object):
precision = 0 if len(detRects) > 0 else 1 precision = 0 if len(detRects) > 0 else 1
if len(detRects) > 0: if len(detRects) > 0:
# Calculate recall and precision matrixs # Calculate recall and precision matrixes
outputShape = [len(gtRects), len(detRects)] outputShape = [len(gtRects), len(detRects)]
recallMat = np.empty(outputShape) recallMat = np.empty(outputShape)
precisionMat = np.empty(outputShape) precisionMat = np.empty(outputShape)

View File

@ -303,7 +303,7 @@ class Config(object):
def print_cfg(self, print_func=print): def print_cfg(self, print_func=print):
""" """
Recursively visualize a dict and Recursively visualize a dict and
indenting acrrording by the relationship of keys. indenting according by the relationship of keys.
""" """
print_func("----------- Config -----------") print_func("----------- Config -----------")
print_dict(self.cfg, print_func) print_dict(self.cfg, print_func)