mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-09-19 01:53:56 +08:00
commit fix by running pre-commit run -a (#12165)
This commit is contained in:
@@ -38,7 +38,7 @@ class DRRGTargets(object):
|
||||
min_rand_half_height=8.0,
|
||||
max_rand_half_height=24.0,
|
||||
jitter_level=0.2,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__()
|
||||
self.orientation_thr = orientation_thr
|
||||
|
||||
@@ -32,7 +32,7 @@ class EASTProcessTrain(object):
|
||||
background_ratio=0.125,
|
||||
min_crop_side_ratio=0.1,
|
||||
min_text_size=10,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.input_size = image_shape[1]
|
||||
self.random_scale = np.array([0.5, 1, 2.0, 3.0])
|
||||
|
||||
@@ -359,7 +359,7 @@ class RandomRotatePolyInstances:
|
||||
max_angle=10,
|
||||
pad_with_fixed_color=False,
|
||||
pad_value=(0, 0, 0),
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
"""Randomly rotate images and polygon masks.
|
||||
|
||||
@@ -487,7 +487,7 @@ class SquareResizePad:
|
||||
pad_ratio=0.6,
|
||||
pad_with_fixed_color=False,
|
||||
pad_value=(0, 0, 0),
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
"""Resize or pad images to be square shape.
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ class FCENetTargets:
|
||||
level_size_divisors=(8, 16, 32),
|
||||
level_proportion_range=((0, 0.25), (0.2, 0.65), (0.55, 1.0)),
|
||||
orientation_thr=2.0,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__()
|
||||
assert isinstance(level_size_divisors, tuple)
|
||||
|
||||
@@ -589,7 +589,7 @@ class SRNLabelEncode(BaseRecLabelEncode):
|
||||
max_text_length=25,
|
||||
character_dict_path=None,
|
||||
use_space_char=False,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(SRNLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
@@ -638,7 +638,7 @@ class TableLabelEncode(AttnLabelEncode):
|
||||
merge_no_span_structure=False,
|
||||
learn_empty_box=False,
|
||||
loc_reg_num=4,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.max_text_len = max_text_length
|
||||
self.lower = False
|
||||
@@ -786,7 +786,7 @@ class TableMasterLabelEncode(TableLabelEncode):
|
||||
merge_no_span_structure=False,
|
||||
learn_empty_box=False,
|
||||
loc_reg_num=4,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(TableMasterLabelEncode, self).__init__(
|
||||
max_text_length,
|
||||
@@ -795,7 +795,7 @@ class TableMasterLabelEncode(TableLabelEncode):
|
||||
merge_no_span_structure,
|
||||
learn_empty_box,
|
||||
loc_reg_num,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
)
|
||||
self.pad_idx = self.dict[self.pad_str]
|
||||
self.unknown_idx = self.dict[self.unknown_str]
|
||||
@@ -909,7 +909,7 @@ class SATRNLabelEncode(BaseRecLabelEncode):
|
||||
character_dict_path=None,
|
||||
use_space_char=False,
|
||||
lower=False,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(SATRNLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
@@ -1019,7 +1019,7 @@ class VQATokenLabelEncode(object):
|
||||
order_method=None,
|
||||
infer_mode=False,
|
||||
ocr_engine=None,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(VQATokenLabelEncode, self).__init__()
|
||||
from paddlenlp.transformers import (
|
||||
@@ -1273,7 +1273,7 @@ class MultiLabelEncode(BaseRecLabelEncode):
|
||||
character_dict_path=None,
|
||||
use_space_char=False,
|
||||
gtc_encode=None,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(MultiLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
@@ -1381,7 +1381,7 @@ class ViTSTRLabelEncode(BaseRecLabelEncode):
|
||||
character_dict_path=None,
|
||||
use_space_char=False,
|
||||
ignore_index=0,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(ViTSTRLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
@@ -1416,7 +1416,7 @@ class ABINetLabelEncode(BaseRecLabelEncode):
|
||||
character_dict_path=None,
|
||||
use_space_char=False,
|
||||
ignore_index=100,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(ABINetLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
@@ -1497,7 +1497,7 @@ class SPINLabelEncode(AttnLabelEncode):
|
||||
character_dict_path=None,
|
||||
use_space_char=False,
|
||||
lower=True,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(SPINLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
@@ -1619,7 +1619,7 @@ class CANLabelEncode(BaseRecLabelEncode):
|
||||
max_text_length=100,
|
||||
use_space_char=False,
|
||||
lower=True,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(CANLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char, lower
|
||||
@@ -1654,7 +1654,7 @@ class CPPDLabelEncode(BaseRecLabelEncode):
|
||||
use_space_char=False,
|
||||
ch=False,
|
||||
ignore_index=100,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(CPPDLabelEncode, self).__init__(
|
||||
max_text_length, character_dict_path, use_space_char
|
||||
|
||||
@@ -465,7 +465,7 @@ class SRResize(object):
|
||||
min_ratio=1,
|
||||
mask=False,
|
||||
infer_mode=False,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.imgH = imgH
|
||||
self.imgW = imgW
|
||||
|
||||
@@ -37,7 +37,7 @@ class PGProcessTrain(object):
|
||||
min_text_size=4,
|
||||
max_text_size=512,
|
||||
point_gather_mode=None,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.tcl_len = tcl_len
|
||||
self.max_text_length = max_text_length
|
||||
|
||||
@@ -133,7 +133,7 @@ class EastRandomCropData(object):
|
||||
max_tries=10,
|
||||
min_crop_side_ratio=0.1,
|
||||
keep_ratio=True,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.size = size
|
||||
self.max_tries = max_tries
|
||||
|
||||
@@ -41,7 +41,7 @@ class RecAug(object):
|
||||
jitter_prob=0.4,
|
||||
blur_prob=0.4,
|
||||
hsv_aug_prob=0.4,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.tia_prob = tia_prob
|
||||
self.bda = BaseDataAugmentation(
|
||||
@@ -74,7 +74,7 @@ class BaseDataAugmentation(object):
|
||||
jitter_prob=0.4,
|
||||
blur_prob=0.4,
|
||||
hsv_aug_prob=0.4,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.crop_prob = crop_prob
|
||||
self.reverse_prob = reverse_prob
|
||||
@@ -151,7 +151,7 @@ class RecConAug(object):
|
||||
image_shape=(32, 320, 3),
|
||||
max_text_length=25,
|
||||
ext_data_num=1,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.ext_data_num = ext_data_num
|
||||
self.prob = prob
|
||||
@@ -199,7 +199,7 @@ class SVTRRecAug(object):
|
||||
geometry_p=0.5,
|
||||
deterioration_p=0.25,
|
||||
colorjitter_p=0.25,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.transforms = Compose(
|
||||
[
|
||||
@@ -237,7 +237,7 @@ class ParseQRecAug(object):
|
||||
geometry_p=0.5,
|
||||
deterioration_p=0.25,
|
||||
colorjitter_p=0.25,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.transforms = Compose(
|
||||
[
|
||||
@@ -289,7 +289,7 @@ class RecResizeImg(object):
|
||||
eval_mode=False,
|
||||
character_dict_path="./ppocr/utils/ppocr_keys_v1.txt",
|
||||
padding=True,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.image_shape = image_shape
|
||||
self.infer_mode = infer_mode
|
||||
@@ -315,7 +315,7 @@ class VLRecResizeImg(object):
|
||||
infer_mode=False,
|
||||
character_dict_path="./ppocr/utils/ppocr_keys_v1.txt",
|
||||
padding=True,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.image_shape = image_shape
|
||||
self.infer_mode = infer_mode
|
||||
@@ -437,7 +437,7 @@ class SPINRecResizeImg(object):
|
||||
interpolation=2,
|
||||
mean=(127.5, 127.5, 127.5),
|
||||
std=(127.5, 127.5, 127.5),
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.image_shape = image_shape
|
||||
|
||||
@@ -485,7 +485,7 @@ class GrayRecResizeImg(object):
|
||||
inter_type="Image.Resampling.LANCZOS",
|
||||
scale=True,
|
||||
padding=False,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.image_shape = image_shape
|
||||
self.resize_type = resize_type
|
||||
|
||||
@@ -33,7 +33,7 @@ class SASTProcessTrain(object):
|
||||
min_crop_side_ratio=0.3,
|
||||
min_text_size=10,
|
||||
max_text_size=512,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.input_size = image_shape[1]
|
||||
self.min_crop_size = min_crop_size
|
||||
|
||||
@@ -26,7 +26,7 @@ class VQATokenPad(object):
|
||||
return_overflowing_tokens=False,
|
||||
return_special_tokens_mask=False,
|
||||
infer_mode=False,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
self.max_seq_len = max_seq_len
|
||||
self.pad_to_max_seq_len = max_seq_len
|
||||
|
||||
Reference in New Issue
Block a user