paddlex 3.0.0rc1__py3-none-any.whl → 3.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paddlex/.version +1 -1
- paddlex/__init__.py +1 -1
- paddlex/configs/modules/chart_parsing/PP-Chart2Table.yaml +13 -0
- paddlex/configs/modules/doc_vlm/PP-DocBee2-3B.yaml +14 -0
- paddlex/configs/modules/formula_recognition/PP-FormulaNet_plus-L.yaml +40 -0
- paddlex/configs/modules/formula_recognition/PP-FormulaNet_plus-M.yaml +40 -0
- paddlex/configs/modules/formula_recognition/PP-FormulaNet_plus-S.yaml +40 -0
- paddlex/configs/modules/layout_detection/PP-DocBlockLayout.yaml +40 -0
- paddlex/configs/modules/layout_detection/PP-DocLayout-L.yaml +2 -2
- paddlex/configs/modules/layout_detection/PP-DocLayout-M.yaml +2 -2
- paddlex/configs/modules/layout_detection/PP-DocLayout-S.yaml +2 -2
- paddlex/configs/modules/layout_detection/PP-DocLayout_plus-L.yaml +40 -0
- paddlex/configs/modules/text_detection/PP-OCRv5_mobile_det.yaml +40 -0
- paddlex/configs/modules/text_detection/PP-OCRv5_server_det.yaml +40 -0
- paddlex/configs/modules/text_recognition/PP-OCRv5_mobile_rec.yaml +39 -0
- paddlex/configs/modules/text_recognition/PP-OCRv5_server_rec.yaml +39 -0
- paddlex/configs/modules/textline_orientation/PP-LCNet_x1_0_textline_ori.yaml +41 -0
- paddlex/configs/pipelines/OCR.yaml +7 -6
- paddlex/configs/pipelines/PP-ChatOCRv3-doc.yaml +3 -1
- paddlex/configs/pipelines/PP-ChatOCRv4-doc.yaml +91 -34
- paddlex/configs/pipelines/PP-StructureV3.yaml +72 -72
- paddlex/configs/pipelines/doc_understanding.yaml +1 -1
- paddlex/configs/pipelines/formula_recognition.yaml +2 -2
- paddlex/configs/pipelines/layout_parsing.yaml +3 -2
- paddlex/configs/pipelines/seal_recognition.yaml +1 -0
- paddlex/configs/pipelines/table_recognition.yaml +2 -1
- paddlex/configs/pipelines/table_recognition_v2.yaml +7 -1
- paddlex/hpip_links.html +20 -20
- paddlex/inference/common/batch_sampler/doc_vlm_batch_sampler.py +33 -10
- paddlex/inference/common/batch_sampler/image_batch_sampler.py +34 -25
- paddlex/inference/common/result/mixin.py +19 -12
- paddlex/inference/models/base/predictor/base_predictor.py +2 -8
- paddlex/inference/models/common/static_infer.py +11 -59
- paddlex/inference/models/common/tokenizer/__init__.py +2 -0
- paddlex/inference/models/common/tokenizer/clip_tokenizer.py +1 -1
- paddlex/inference/models/common/tokenizer/gpt_tokenizer.py +2 -2
- paddlex/inference/models/common/tokenizer/qwen2_5_tokenizer.py +112 -0
- paddlex/inference/models/common/tokenizer/qwen2_tokenizer.py +7 -1
- paddlex/inference/models/common/tokenizer/qwen_tokenizer.py +288 -0
- paddlex/inference/models/common/tokenizer/tokenizer_utils.py +13 -13
- paddlex/inference/models/common/tokenizer/tokenizer_utils_base.py +3 -3
- paddlex/inference/models/common/tokenizer/vocab.py +7 -7
- paddlex/inference/models/common/vlm/conversion_utils.py +99 -0
- paddlex/inference/models/common/vlm/fusion_ops.py +205 -0
- paddlex/inference/models/common/vlm/generation/configuration_utils.py +1 -1
- paddlex/inference/models/common/vlm/generation/logits_process.py +1 -1
- paddlex/inference/models/common/vlm/generation/utils.py +1 -1
- paddlex/inference/models/common/vlm/transformers/configuration_utils.py +3 -3
- paddlex/inference/models/common/vlm/transformers/conversion_utils.py +3 -3
- paddlex/inference/models/common/vlm/transformers/model_outputs.py +2 -2
- paddlex/inference/models/common/vlm/transformers/model_utils.py +7 -31
- paddlex/inference/models/doc_vlm/modeling/GOT_ocr_2_0.py +830 -0
- paddlex/inference/models/doc_vlm/modeling/__init__.py +2 -0
- paddlex/inference/models/doc_vlm/modeling/qwen2.py +1606 -0
- paddlex/inference/models/doc_vlm/modeling/qwen2_5_vl.py +3006 -0
- paddlex/inference/models/doc_vlm/modeling/qwen2_vl.py +0 -105
- paddlex/inference/models/doc_vlm/predictor.py +79 -24
- paddlex/inference/models/doc_vlm/processors/GOT_ocr_2_0.py +97 -0
- paddlex/inference/models/doc_vlm/processors/__init__.py +2 -0
- paddlex/inference/models/doc_vlm/processors/common.py +189 -0
- paddlex/inference/models/doc_vlm/processors/qwen2_5_vl.py +548 -0
- paddlex/inference/models/doc_vlm/processors/qwen2_vl.py +21 -176
- paddlex/inference/models/formula_recognition/predictor.py +7 -1
- paddlex/inference/models/formula_recognition/processors.py +92 -79
- paddlex/inference/models/formula_recognition/result.py +28 -27
- paddlex/inference/models/image_feature/processors.py +3 -4
- paddlex/inference/models/keypoint_detection/predictor.py +3 -0
- paddlex/inference/models/object_detection/predictor.py +2 -0
- paddlex/inference/models/object_detection/processors.py +28 -3
- paddlex/inference/models/object_detection/utils.py +2 -0
- paddlex/inference/models/table_structure_recognition/result.py +0 -10
- paddlex/inference/models/text_detection/predictor.py +8 -0
- paddlex/inference/models/text_detection/processors.py +44 -10
- paddlex/inference/models/text_detection/result.py +0 -10
- paddlex/inference/pipelines/__init__.py +9 -5
- paddlex/inference/pipelines/_parallel.py +172 -0
- paddlex/inference/pipelines/anomaly_detection/pipeline.py +16 -6
- paddlex/inference/pipelines/attribute_recognition/pipeline.py +11 -1
- paddlex/inference/pipelines/base.py +14 -4
- paddlex/inference/pipelines/components/faisser.py +1 -1
- paddlex/inference/pipelines/doc_preprocessor/pipeline.py +53 -27
- paddlex/inference/pipelines/formula_recognition/pipeline.py +120 -82
- paddlex/inference/pipelines/formula_recognition/result.py +1 -11
- paddlex/inference/pipelines/image_classification/pipeline.py +16 -6
- paddlex/inference/pipelines/image_multilabel_classification/pipeline.py +16 -6
- paddlex/inference/pipelines/instance_segmentation/pipeline.py +16 -6
- paddlex/inference/pipelines/keypoint_detection/pipeline.py +16 -6
- paddlex/inference/pipelines/layout_parsing/pipeline.py +34 -47
- paddlex/inference/pipelines/layout_parsing/pipeline_v2.py +893 -260
- paddlex/inference/pipelines/layout_parsing/result.py +4 -17
- paddlex/inference/pipelines/layout_parsing/result_v2.py +523 -245
- paddlex/inference/pipelines/layout_parsing/setting.py +87 -0
- paddlex/inference/pipelines/layout_parsing/utils.py +565 -1998
- paddlex/inference/pipelines/layout_parsing/xycut_enhanced/__init__.py +16 -0
- paddlex/inference/pipelines/layout_parsing/xycut_enhanced/utils.py +1144 -0
- paddlex/inference/pipelines/layout_parsing/xycut_enhanced/xycuts.py +563 -0
- paddlex/inference/pipelines/m_3d_bev_detection/pipeline.py +2 -2
- paddlex/inference/pipelines/multilingual_speech_recognition/pipeline.py +2 -2
- paddlex/inference/pipelines/object_detection/pipeline.py +16 -6
- paddlex/inference/pipelines/ocr/pipeline.py +127 -70
- paddlex/inference/pipelines/ocr/result.py +19 -16
- paddlex/inference/pipelines/open_vocabulary_detection/pipeline.py +2 -2
- paddlex/inference/pipelines/open_vocabulary_segmentation/pipeline.py +2 -2
- paddlex/inference/pipelines/pp_chatocr/pipeline_base.py +2 -2
- paddlex/inference/pipelines/pp_chatocr/pipeline_v3.py +2 -5
- paddlex/inference/pipelines/pp_chatocr/pipeline_v4.py +5 -5
- paddlex/inference/pipelines/rotated_object_detection/pipeline.py +16 -6
- paddlex/inference/pipelines/seal_recognition/pipeline.py +109 -53
- paddlex/inference/pipelines/semantic_segmentation/pipeline.py +16 -6
- paddlex/inference/pipelines/small_object_detection/pipeline.py +16 -6
- paddlex/inference/pipelines/table_recognition/pipeline.py +26 -18
- paddlex/inference/pipelines/table_recognition/pipeline_v2.py +624 -53
- paddlex/inference/pipelines/table_recognition/result.py +1 -1
- paddlex/inference/pipelines/table_recognition/table_recognition_post_processing_v2.py +9 -5
- paddlex/inference/pipelines/ts_anomaly_detection/pipeline.py +2 -2
- paddlex/inference/pipelines/ts_classification/pipeline.py +2 -2
- paddlex/inference/pipelines/ts_forecasting/pipeline.py +2 -2
- paddlex/inference/pipelines/video_classification/pipeline.py +2 -2
- paddlex/inference/pipelines/video_detection/pipeline.py +2 -2
- paddlex/inference/serving/basic_serving/_pipeline_apps/_common/common.py +5 -1
- paddlex/inference/serving/basic_serving/_pipeline_apps/layout_parsing.py +0 -1
- paddlex/inference/serving/basic_serving/_pipeline_apps/pp_chatocrv3_doc.py +0 -1
- paddlex/inference/serving/basic_serving/_pipeline_apps/pp_chatocrv4_doc.py +1 -1
- paddlex/inference/serving/basic_serving/_pipeline_apps/pp_structurev3.py +6 -2
- paddlex/inference/serving/basic_serving/_pipeline_apps/table_recognition.py +1 -5
- paddlex/inference/serving/basic_serving/_pipeline_apps/table_recognition_v2.py +4 -5
- paddlex/inference/serving/infra/utils.py +20 -22
- paddlex/inference/serving/schemas/formula_recognition.py +1 -1
- paddlex/inference/serving/schemas/layout_parsing.py +1 -2
- paddlex/inference/serving/schemas/pp_chatocrv3_doc.py +1 -2
- paddlex/inference/serving/schemas/pp_chatocrv4_doc.py +2 -2
- paddlex/inference/serving/schemas/pp_structurev3.py +10 -6
- paddlex/inference/serving/schemas/seal_recognition.py +1 -1
- paddlex/inference/serving/schemas/table_recognition.py +2 -6
- paddlex/inference/serving/schemas/table_recognition_v2.py +5 -6
- paddlex/inference/utils/hpi.py +8 -1
- paddlex/inference/utils/hpi_model_info_collection.json +81 -2
- paddlex/inference/utils/io/readers.py +12 -12
- paddlex/inference/utils/mkldnn_blocklist.py +25 -0
- paddlex/inference/utils/official_models.py +14 -0
- paddlex/inference/utils/pp_option.py +29 -8
- paddlex/model.py +2 -2
- paddlex/modules/__init__.py +1 -1
- paddlex/modules/anomaly_detection/evaluator.py +2 -2
- paddlex/modules/base/__init__.py +1 -1
- paddlex/modules/base/evaluator.py +5 -5
- paddlex/modules/base/trainer.py +1 -1
- paddlex/modules/doc_vlm/dataset_checker.py +2 -2
- paddlex/modules/doc_vlm/evaluator.py +2 -2
- paddlex/modules/doc_vlm/exportor.py +2 -2
- paddlex/modules/doc_vlm/model_list.py +1 -1
- paddlex/modules/doc_vlm/trainer.py +2 -2
- paddlex/modules/face_recognition/evaluator.py +2 -2
- paddlex/modules/formula_recognition/evaluator.py +5 -2
- paddlex/modules/formula_recognition/model_list.py +3 -0
- paddlex/modules/formula_recognition/trainer.py +3 -0
- paddlex/modules/general_recognition/evaluator.py +1 -1
- paddlex/modules/image_classification/evaluator.py +2 -2
- paddlex/modules/image_classification/model_list.py +1 -0
- paddlex/modules/instance_segmentation/evaluator.py +1 -1
- paddlex/modules/keypoint_detection/evaluator.py +1 -1
- paddlex/modules/m_3d_bev_detection/evaluator.py +2 -2
- paddlex/modules/multilabel_classification/evaluator.py +2 -2
- paddlex/modules/object_detection/dataset_checker/dataset_src/convert_dataset.py +4 -4
- paddlex/modules/object_detection/evaluator.py +2 -2
- paddlex/modules/object_detection/model_list.py +2 -0
- paddlex/modules/semantic_segmentation/evaluator.py +2 -2
- paddlex/modules/table_recognition/evaluator.py +2 -2
- paddlex/modules/text_detection/evaluator.py +2 -2
- paddlex/modules/text_detection/model_list.py +2 -0
- paddlex/modules/text_recognition/evaluator.py +2 -2
- paddlex/modules/text_recognition/model_list.py +2 -0
- paddlex/modules/ts_anomaly_detection/evaluator.py +2 -2
- paddlex/modules/ts_classification/dataset_checker/dataset_src/split_dataset.py +1 -1
- paddlex/modules/ts_classification/evaluator.py +2 -2
- paddlex/modules/ts_forecast/evaluator.py +2 -2
- paddlex/modules/video_classification/evaluator.py +2 -2
- paddlex/modules/video_detection/evaluator.py +2 -2
- paddlex/ops/__init__.py +2 -2
- paddlex/paddlex_cli.py +19 -13
- paddlex/repo_apis/Paddle3D_api/bev_fusion/model.py +2 -2
- paddlex/repo_apis/PaddleClas_api/cls/config.py +1 -1
- paddlex/repo_apis/PaddleClas_api/cls/model.py +1 -1
- paddlex/repo_apis/PaddleClas_api/cls/register.py +10 -0
- paddlex/repo_apis/PaddleClas_api/cls/runner.py +1 -1
- paddlex/repo_apis/PaddleDetection_api/instance_seg/model.py +1 -1
- paddlex/repo_apis/PaddleDetection_api/instance_seg/runner.py +1 -1
- paddlex/repo_apis/PaddleDetection_api/object_det/config.py +1 -1
- paddlex/repo_apis/PaddleDetection_api/object_det/model.py +1 -1
- paddlex/repo_apis/PaddleDetection_api/object_det/official_categories.py +25 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/register.py +30 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/runner.py +1 -1
- paddlex/repo_apis/PaddleOCR_api/formula_rec/config.py +3 -3
- paddlex/repo_apis/PaddleOCR_api/formula_rec/model.py +5 -9
- paddlex/repo_apis/PaddleOCR_api/formula_rec/register.py +27 -0
- paddlex/repo_apis/PaddleOCR_api/formula_rec/runner.py +1 -1
- paddlex/repo_apis/PaddleOCR_api/table_rec/model.py +1 -1
- paddlex/repo_apis/PaddleOCR_api/table_rec/runner.py +1 -1
- paddlex/repo_apis/PaddleOCR_api/text_det/model.py +1 -1
- paddlex/repo_apis/PaddleOCR_api/text_det/register.py +18 -0
- paddlex/repo_apis/PaddleOCR_api/text_det/runner.py +1 -1
- paddlex/repo_apis/PaddleOCR_api/text_rec/config.py +3 -3
- paddlex/repo_apis/PaddleOCR_api/text_rec/model.py +5 -9
- paddlex/repo_apis/PaddleOCR_api/text_rec/register.py +18 -0
- paddlex/repo_apis/PaddleOCR_api/text_rec/runner.py +1 -1
- paddlex/repo_apis/PaddleSeg_api/seg/model.py +1 -1
- paddlex/repo_apis/PaddleSeg_api/seg/runner.py +1 -1
- paddlex/repo_apis/PaddleTS_api/ts_ad/config.py +3 -3
- paddlex/repo_apis/PaddleTS_api/ts_cls/config.py +2 -2
- paddlex/repo_apis/PaddleTS_api/ts_fc/config.py +4 -4
- paddlex/repo_apis/PaddleVideo_api/video_cls/config.py +1 -1
- paddlex/repo_apis/PaddleVideo_api/video_cls/model.py +1 -1
- paddlex/repo_apis/PaddleVideo_api/video_cls/runner.py +1 -1
- paddlex/repo_apis/PaddleVideo_api/video_det/config.py +1 -1
- paddlex/repo_apis/PaddleVideo_api/video_det/model.py +1 -1
- paddlex/repo_apis/PaddleVideo_api/video_det/runner.py +1 -1
- paddlex/repo_apis/base/config.py +1 -1
- paddlex/repo_manager/core.py +3 -3
- paddlex/repo_manager/meta.py +6 -2
- paddlex/repo_manager/repo.py +17 -16
- paddlex/utils/custom_device_list.py +26 -2
- paddlex/utils/deps.py +1 -1
- paddlex/utils/device.py +15 -8
- paddlex/utils/env.py +4 -0
- paddlex/utils/flags.py +2 -4
- paddlex/utils/fonts/__init__.py +34 -4
- paddlex/utils/misc.py +1 -1
- {paddlex-3.0.0rc1.dist-info → paddlex-3.0.1.dist-info}/METADATA +52 -56
- {paddlex-3.0.0rc1.dist-info → paddlex-3.0.1.dist-info}/RECORD +233 -206
- {paddlex-3.0.0rc1.dist-info → paddlex-3.0.1.dist-info}/WHEEL +1 -1
- {paddlex-3.0.0rc1.dist-info → paddlex-3.0.1.dist-info}/entry_points.txt +0 -0
- {paddlex-3.0.0rc1.dist-info → paddlex-3.0.1.dist-info}/licenses/LICENSE +0 -0
- {paddlex-3.0.0rc1.dist-info → paddlex-3.0.1.dist-info}/top_level.txt +0 -0
@@ -22,6 +22,7 @@ from ...common.batch_sampler import ImageBatchSampler
|
|
22
22
|
from ...common.reader import ReadImage
|
23
23
|
from ...utils.hpi import HPIConfig
|
24
24
|
from ...utils.pp_option import PaddlePredictorOption
|
25
|
+
from .._parallel import AutoParallelImageSimpleInferencePipeline
|
25
26
|
from ..base import BasePipeline
|
26
27
|
from ..components import (
|
27
28
|
CropByPolys,
|
@@ -33,12 +34,9 @@ from ..components import (
|
|
33
34
|
from .result import OCRResult
|
34
35
|
|
35
36
|
|
36
|
-
|
37
|
-
class OCRPipeline(BasePipeline):
|
37
|
+
class _OCRPipeline(BasePipeline):
|
38
38
|
"""OCR Pipeline"""
|
39
39
|
|
40
|
-
entities = "OCR"
|
41
|
-
|
42
40
|
def __init__(
|
43
41
|
self,
|
44
42
|
config: Dict,
|
@@ -55,9 +53,9 @@ class OCRPipeline(BasePipeline):
|
|
55
53
|
device (str, optional): Device to run the predictions on. Defaults to None.
|
56
54
|
pp_option (PaddlePredictorOption, optional): PaddlePredictor options. Defaults to None.
|
57
55
|
use_hpip (bool, optional): Whether to use the high-performance
|
58
|
-
inference plugin (HPIP). Defaults to False.
|
56
|
+
inference plugin (HPIP) by default. Defaults to False.
|
59
57
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
60
|
-
The high-performance inference configuration dictionary.
|
58
|
+
The default high-performance inference configuration dictionary.
|
61
59
|
Defaults to None.
|
62
60
|
"""
|
63
61
|
super().__init__(
|
@@ -93,6 +91,7 @@ class OCRPipeline(BasePipeline):
|
|
93
91
|
if self.text_type == "general":
|
94
92
|
self.text_det_limit_side_len = text_det_config.get("limit_side_len", 960)
|
95
93
|
self.text_det_limit_type = text_det_config.get("limit_type", "max")
|
94
|
+
self.text_det_max_side_limit = text_det_config.get("max_side_limit", 4000)
|
96
95
|
self.text_det_thresh = text_det_config.get("thresh", 0.3)
|
97
96
|
self.text_det_box_thresh = text_det_config.get("box_thresh", 0.6)
|
98
97
|
self.input_shape = text_det_config.get("input_shape", None)
|
@@ -102,6 +101,7 @@ class OCRPipeline(BasePipeline):
|
|
102
101
|
elif self.text_type == "seal":
|
103
102
|
self.text_det_limit_side_len = text_det_config.get("limit_side_len", 736)
|
104
103
|
self.text_det_limit_type = text_det_config.get("limit_type", "min")
|
104
|
+
self.text_det_max_side_limit = text_det_config.get("max_side_limit", 4000)
|
105
105
|
self.text_det_thresh = text_det_config.get("thresh", 0.2)
|
106
106
|
self.text_det_box_thresh = text_det_config.get("box_thresh", 0.6)
|
107
107
|
self.text_det_unclip_ratio = text_det_config.get("unclip_ratio", 0.5)
|
@@ -115,6 +115,7 @@ class OCRPipeline(BasePipeline):
|
|
115
115
|
text_det_config,
|
116
116
|
limit_side_len=self.text_det_limit_side_len,
|
117
117
|
limit_type=self.text_det_limit_type,
|
118
|
+
max_side_limit=self.text_det_max_side_limit,
|
118
119
|
thresh=self.text_det_thresh,
|
119
120
|
box_thresh=self.text_det_box_thresh,
|
120
121
|
unclip_ratio=self.text_det_unclip_ratio,
|
@@ -131,7 +132,7 @@ class OCRPipeline(BasePipeline):
|
|
131
132
|
text_rec_config, input_shape=self.input_shape
|
132
133
|
)
|
133
134
|
|
134
|
-
self.batch_sampler = ImageBatchSampler(batch_size=1)
|
135
|
+
self.batch_sampler = ImageBatchSampler(batch_size=config.get("batch_size", 1))
|
135
136
|
self.img_reader = ReadImage(format="BGR")
|
136
137
|
|
137
138
|
def rotate_image(
|
@@ -234,6 +235,7 @@ class OCRPipeline(BasePipeline):
|
|
234
235
|
self,
|
235
236
|
text_det_limit_side_len: Optional[int] = None,
|
236
237
|
text_det_limit_type: Optional[str] = None,
|
238
|
+
text_det_max_side_limit: Optional[int] = None,
|
237
239
|
text_det_thresh: Optional[float] = None,
|
238
240
|
text_det_box_thresh: Optional[float] = None,
|
239
241
|
text_det_unclip_ratio: Optional[float] = None,
|
@@ -246,6 +248,7 @@ class OCRPipeline(BasePipeline):
|
|
246
248
|
Args:
|
247
249
|
text_det_limit_side_len (Optional[int]): The maximum side length of the text box.
|
248
250
|
text_det_limit_type (Optional[str]): The type of limit to apply to the text box.
|
251
|
+
text_det_max_side_limit (Optional[int]): The maximum side length of the text box.
|
249
252
|
text_det_thresh (Optional[float]): The threshold for text detection.
|
250
253
|
text_det_box_thresh (Optional[float]): The threshold for the bounding box.
|
251
254
|
text_det_unclip_ratio (Optional[float]): The ratio for unclipping the text box.
|
@@ -257,6 +260,8 @@ class OCRPipeline(BasePipeline):
|
|
257
260
|
text_det_limit_side_len = self.text_det_limit_side_len
|
258
261
|
if text_det_limit_type is None:
|
259
262
|
text_det_limit_type = self.text_det_limit_type
|
263
|
+
if text_det_max_side_limit is None:
|
264
|
+
text_det_max_side_limit = self.text_det_max_side_limit
|
260
265
|
if text_det_thresh is None:
|
261
266
|
text_det_thresh = self.text_det_thresh
|
262
267
|
if text_det_box_thresh is None:
|
@@ -267,6 +272,7 @@ class OCRPipeline(BasePipeline):
|
|
267
272
|
limit_side_len=text_det_limit_side_len,
|
268
273
|
limit_type=text_det_limit_type,
|
269
274
|
thresh=text_det_thresh,
|
275
|
+
max_side_limit=text_det_max_side_limit,
|
270
276
|
box_thresh=text_det_box_thresh,
|
271
277
|
unclip_ratio=text_det_unclip_ratio,
|
272
278
|
)
|
@@ -279,6 +285,7 @@ class OCRPipeline(BasePipeline):
|
|
279
285
|
use_textline_orientation: Optional[bool] = None,
|
280
286
|
text_det_limit_side_len: Optional[int] = None,
|
281
287
|
text_det_limit_type: Optional[str] = None,
|
288
|
+
text_det_max_side_limit: Optional[int] = None,
|
282
289
|
text_det_thresh: Optional[float] = None,
|
283
290
|
text_det_box_thresh: Optional[float] = None,
|
284
291
|
text_det_unclip_ratio: Optional[float] = None,
|
@@ -294,6 +301,7 @@ class OCRPipeline(BasePipeline):
|
|
294
301
|
use_textline_orientation (Optional[bool]): Whether to use textline orientation prediction.
|
295
302
|
text_det_limit_side_len (Optional[int]): Maximum side length for text detection.
|
296
303
|
text_det_limit_type (Optional[str]): Type of limit to apply for text detection.
|
304
|
+
text_det_max_side_limit (Optional[int]): Maximum side length for text detection.
|
297
305
|
text_det_thresh (Optional[float]): Threshold for text detection.
|
298
306
|
text_det_box_thresh (Optional[float]): Threshold for text detection boxes.
|
299
307
|
text_det_unclip_ratio (Optional[float]): Ratio for unclipping text detection boxes.
|
@@ -312,6 +320,7 @@ class OCRPipeline(BasePipeline):
|
|
312
320
|
text_det_params = self.get_text_det_params(
|
313
321
|
text_det_limit_side_len,
|
314
322
|
text_det_limit_type,
|
323
|
+
text_det_max_side_limit,
|
315
324
|
text_det_thresh,
|
316
325
|
text_det_box_thresh,
|
317
326
|
text_det_unclip_ratio,
|
@@ -320,87 +329,135 @@ class OCRPipeline(BasePipeline):
|
|
320
329
|
if text_rec_score_thresh is None:
|
321
330
|
text_rec_score_thresh = self.text_rec_score_thresh
|
322
331
|
|
323
|
-
for
|
324
|
-
|
332
|
+
for _, batch_data in enumerate(self.batch_sampler(input)):
|
333
|
+
image_arrays = self.img_reader(batch_data.instances)
|
325
334
|
|
326
335
|
if model_settings["use_doc_preprocessor"]:
|
327
|
-
|
336
|
+
doc_preprocessor_results = list(
|
328
337
|
self.doc_preprocessor_pipeline(
|
329
|
-
|
338
|
+
image_arrays,
|
330
339
|
use_doc_orientation_classify=use_doc_orientation_classify,
|
331
340
|
use_doc_unwarping=use_doc_unwarping,
|
332
341
|
)
|
333
342
|
)
|
334
343
|
else:
|
335
|
-
|
344
|
+
doc_preprocessor_results = [{"output_img": arr} for arr in image_arrays]
|
336
345
|
|
337
|
-
|
346
|
+
doc_preprocessor_images = [
|
347
|
+
item["output_img"] for item in doc_preprocessor_results
|
348
|
+
]
|
338
349
|
|
339
|
-
|
340
|
-
self.text_det_model(
|
350
|
+
det_results = list(
|
351
|
+
self.text_det_model(doc_preprocessor_images, **text_det_params)
|
341
352
|
)
|
342
353
|
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
354
|
+
dt_polys_list = [item["dt_polys"] for item in det_results]
|
355
|
+
|
356
|
+
dt_polys_list = [self._sort_boxes(item) for item in dt_polys_list]
|
357
|
+
|
358
|
+
results = [
|
359
|
+
{
|
360
|
+
"input_path": input_path,
|
361
|
+
"page_index": page_index,
|
362
|
+
"doc_preprocessor_res": doc_preprocessor_res,
|
363
|
+
"dt_polys": dt_polys,
|
364
|
+
"model_settings": model_settings,
|
365
|
+
"text_det_params": text_det_params,
|
366
|
+
"text_type": self.text_type,
|
367
|
+
"text_rec_score_thresh": text_rec_score_thresh,
|
368
|
+
"rec_texts": [],
|
369
|
+
"rec_scores": [],
|
370
|
+
"rec_polys": [],
|
371
|
+
}
|
372
|
+
for input_path, page_index, doc_preprocessor_res, dt_polys in zip(
|
373
|
+
batch_data.input_paths,
|
374
|
+
batch_data.page_indexes,
|
375
|
+
doc_preprocessor_results,
|
376
|
+
dt_polys_list,
|
365
377
|
)
|
378
|
+
]
|
379
|
+
|
380
|
+
indices = list(range(len(doc_preprocessor_images)))
|
381
|
+
indices = [idx for idx in indices if len(dt_polys_list[idx]) > 0]
|
382
|
+
|
383
|
+
if indices:
|
384
|
+
all_subs_of_imgs = []
|
385
|
+
chunk_indices = [0]
|
386
|
+
for idx in indices:
|
387
|
+
all_subs_of_img = list(
|
388
|
+
self._crop_by_polys(
|
389
|
+
doc_preprocessor_images[idx], dt_polys_list[idx]
|
390
|
+
)
|
391
|
+
)
|
392
|
+
all_subs_of_imgs.extend(all_subs_of_img)
|
393
|
+
chunk_indices.append(chunk_indices[-1] + len(all_subs_of_img))
|
394
|
+
|
366
395
|
# use textline orientation model
|
367
396
|
if model_settings["use_textline_orientation"]:
|
368
397
|
angles = [
|
369
398
|
int(textline_angle_info["class_ids"][0])
|
370
399
|
for textline_angle_info in self.textline_orientation_model(
|
371
|
-
|
400
|
+
all_subs_of_imgs
|
372
401
|
)
|
373
402
|
]
|
374
|
-
|
403
|
+
all_subs_of_imgs = self.rotate_image(all_subs_of_imgs, angles)
|
375
404
|
else:
|
376
|
-
angles = [-1] * len(
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
405
|
+
angles = [-1] * len(all_subs_of_imgs)
|
406
|
+
for i, idx in enumerate(indices):
|
407
|
+
res = results[idx]
|
408
|
+
res["textline_orientation_angles"] = angles[
|
409
|
+
chunk_indices[i] : chunk_indices[i + 1]
|
410
|
+
]
|
411
|
+
|
412
|
+
# TODO: Process all sub-images in the batch together
|
413
|
+
for i, idx in enumerate(indices):
|
414
|
+
all_subs_of_img = all_subs_of_imgs[
|
415
|
+
chunk_indices[i] : chunk_indices[i + 1]
|
416
|
+
]
|
417
|
+
res = results[idx]
|
418
|
+
dt_polys = dt_polys_list[idx]
|
419
|
+
sub_img_info_list = [
|
420
|
+
{
|
421
|
+
"sub_img_id": img_id,
|
422
|
+
"sub_img_ratio": sub_img.shape[1] / float(sub_img.shape[0]),
|
423
|
+
}
|
424
|
+
for img_id, sub_img in enumerate(all_subs_of_img)
|
425
|
+
]
|
426
|
+
sorted_subs_info = sorted(
|
427
|
+
sub_img_info_list, key=lambda x: x["sub_img_ratio"]
|
428
|
+
)
|
429
|
+
sorted_subs_of_img = [
|
430
|
+
all_subs_of_img[x["sub_img_id"]] for x in sorted_subs_info
|
431
|
+
]
|
432
|
+
for i, rec_res in enumerate(
|
433
|
+
self.text_rec_model(sorted_subs_of_img)
|
434
|
+
):
|
435
|
+
sub_img_id = sorted_subs_info[i]["sub_img_id"]
|
436
|
+
sub_img_info_list[sub_img_id]["rec_res"] = rec_res
|
437
|
+
for sno in range(len(sub_img_info_list)):
|
438
|
+
rec_res = sub_img_info_list[sno]["rec_res"]
|
439
|
+
if rec_res["rec_score"] >= text_rec_score_thresh:
|
440
|
+
res["rec_texts"].append(rec_res["rec_text"])
|
441
|
+
res["rec_scores"].append(rec_res["rec_score"])
|
442
|
+
res["rec_polys"].append(dt_polys[sno])
|
443
|
+
|
444
|
+
for res in results:
|
445
|
+
if self.text_type == "general":
|
446
|
+
rec_boxes = convert_points_to_boxes(res["rec_polys"])
|
447
|
+
res["rec_boxes"] = rec_boxes
|
448
|
+
else:
|
449
|
+
res["rec_boxes"] = np.array([])
|
450
|
+
|
451
|
+
yield OCRResult(res)
|
452
|
+
|
453
|
+
|
454
|
+
@pipeline_requires_extra("ocr")
|
455
|
+
class OCRPipeline(AutoParallelImageSimpleInferencePipeline):
|
456
|
+
entities = "OCR"
|
457
|
+
|
458
|
+
@property
|
459
|
+
def _pipeline_cls(self):
|
460
|
+
return _OCRPipeline
|
461
|
+
|
462
|
+
def _get_batch_size(self, config):
|
463
|
+
return config.get("batch_size", 1)
|
@@ -14,14 +14,13 @@
|
|
14
14
|
|
15
15
|
import math
|
16
16
|
import random
|
17
|
-
from pathlib import Path
|
18
17
|
from typing import Dict
|
19
18
|
|
20
19
|
import numpy as np
|
21
20
|
from PIL import Image, ImageDraw
|
22
21
|
|
23
22
|
from ....utils.deps import class_requires_deps, function_requires_deps, is_dep_available
|
24
|
-
from ....utils.fonts import SIMFANG_FONT_FILE_PATH, create_font
|
23
|
+
from ....utils.fonts import SIMFANG_FONT_FILE_PATH, create_font, create_font_vertical
|
25
24
|
from ...common.result import BaseCVResult, JsonMixin
|
26
25
|
|
27
26
|
if is_dep_available("opencv-contrib-python"):
|
@@ -32,15 +31,6 @@ if is_dep_available("opencv-contrib-python"):
|
|
32
31
|
class OCRResult(BaseCVResult):
|
33
32
|
"""OCR result"""
|
34
33
|
|
35
|
-
def _get_input_fn(self):
|
36
|
-
fn = super()._get_input_fn()
|
37
|
-
if (page_idx := self["page_index"]) is not None:
|
38
|
-
fp = Path(fn)
|
39
|
-
stem, suffix = fp.stem, fp.suffix
|
40
|
-
return f"{stem}_{page_idx}{suffix}"
|
41
|
-
else:
|
42
|
-
return fn
|
43
|
-
|
44
34
|
def get_minarea_rect(self, points: np.ndarray) -> np.ndarray:
|
45
35
|
"""
|
46
36
|
Get the minimum area rectangle for the given points using OpenCV.
|
@@ -106,7 +96,9 @@ class OCRResult(BaseCVResult):
|
|
106
96
|
height = int(0.5 * (max(box[:, 1]) - min(box[:, 1])))
|
107
97
|
box[:2, 1] = np.mean(box[:, 1])
|
108
98
|
box[2:, 1] = np.mean(box[:, 1]) + min(20, height)
|
109
|
-
|
99
|
+
box_pts = [(int(x), int(y)) for x, y in box.tolist()]
|
100
|
+
draw_left.polygon(box_pts, fill=color)
|
101
|
+
|
110
102
|
img_right_text = draw_box_txt_fine(
|
111
103
|
(w, h), box, txt, SIMFANG_FONT_FILE_PATH
|
112
104
|
)
|
@@ -221,12 +213,13 @@ def draw_box_txt_fine(
|
|
221
213
|
)
|
222
214
|
|
223
215
|
if box_height > 2 * box_width and box_height > 30:
|
224
|
-
img_text = Image.new("RGB", (
|
216
|
+
img_text = Image.new("RGB", (box_width, box_height), (255, 255, 255))
|
225
217
|
draw_text = ImageDraw.Draw(img_text)
|
226
218
|
if txt:
|
227
|
-
font =
|
228
|
-
|
229
|
-
|
219
|
+
font = create_font_vertical(txt, (box_width, box_height), font_path)
|
220
|
+
draw_vertical_text(
|
221
|
+
draw_text, (0, 0), txt, font, fill=(0, 0, 0), line_spacing=2
|
222
|
+
)
|
230
223
|
else:
|
231
224
|
img_text = Image.new("RGB", (box_width, box_height), (255, 255, 255))
|
232
225
|
draw_text = ImageDraw.Draw(img_text)
|
@@ -250,3 +243,13 @@ def draw_box_txt_fine(
|
|
250
243
|
borderValue=(255, 255, 255),
|
251
244
|
)
|
252
245
|
return img_right_text
|
246
|
+
|
247
|
+
|
248
|
+
@function_requires_deps("opencv-contrib-python")
|
249
|
+
def draw_vertical_text(draw, position, text, font, fill=(0, 0, 0), line_spacing=2):
|
250
|
+
x, y = position
|
251
|
+
for char in text:
|
252
|
+
draw.text((x, y), char, font=font, fill=fill)
|
253
|
+
bbox = font.getbbox(char)
|
254
|
+
char_height = bbox[3] - bbox[1]
|
255
|
+
y += char_height + line_spacing
|
@@ -45,9 +45,9 @@ class OpenVocabularyDetectionPipeline(BasePipeline):
|
|
45
45
|
device (str): The device to run the prediction on. Default is None.
|
46
46
|
pp_option (PaddlePredictorOption): Options for PaddlePaddle predictor. Default is None.
|
47
47
|
use_hpip (bool, optional): Whether to use the high-performance
|
48
|
-
inference plugin (HPIP). Defaults to False.
|
48
|
+
inference plugin (HPIP) by default. Defaults to False.
|
49
49
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
50
|
-
The high-performance inference configuration dictionary.
|
50
|
+
The default high-performance inference configuration dictionary.
|
51
51
|
Defaults to None.
|
52
52
|
"""
|
53
53
|
super().__init__(
|
@@ -47,9 +47,9 @@ class OpenVocabularySegmentationPipeline(BasePipeline):
|
|
47
47
|
device (str): The device to run the prediction on. Default is None.
|
48
48
|
pp_option (PaddlePredictorOption): Options for PaddlePaddle predictor. Default is None.
|
49
49
|
use_hpip (bool, optional): Whether to use the high-performance
|
50
|
-
inference plugin (HPIP). Defaults to False.
|
50
|
+
inference plugin (HPIP) by default. Defaults to False.
|
51
51
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
52
|
-
The high-performance inference configuration dictionary.
|
52
|
+
The default high-performance inference configuration dictionary.
|
53
53
|
Defaults to None.
|
54
54
|
"""
|
55
55
|
super().__init__(
|
@@ -37,9 +37,9 @@ class PP_ChatOCR_Pipeline(BasePipeline):
|
|
37
37
|
device (str, optional): Device to run the predictions on. Defaults to None.
|
38
38
|
pp_option (PaddlePredictorOption, optional): PaddlePredictor options. Defaults to None.
|
39
39
|
use_hpip (bool, optional): Whether to use the high-performance
|
40
|
-
inference plugin (HPIP). Defaults to False.
|
40
|
+
inference plugin (HPIP) by default. Defaults to False.
|
41
41
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
42
|
-
The high-performance inference configuration dictionary.
|
42
|
+
The default high-performance inference configuration dictionary.
|
43
43
|
Defaults to None.
|
44
44
|
"""
|
45
45
|
|
@@ -54,9 +54,9 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
|
|
54
54
|
device (str, optional): Device to run the predictions on. Defaults to None.
|
55
55
|
pp_option (PaddlePredictorOption, optional): PaddlePredictor options. Defaults to None.
|
56
56
|
use_hpip (bool, optional): Whether to use the high-performance
|
57
|
-
inference plugin (HPIP). Defaults to False.
|
57
|
+
inference plugin (HPIP) by default. Defaults to False.
|
58
58
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
59
|
-
The high-performance inference configuration dictionary.
|
59
|
+
The default high-performance inference configuration dictionary.
|
60
60
|
Defaults to None.
|
61
61
|
initial_predictor (bool, optional): Whether to initialize the predictor. Defaults to True.
|
62
62
|
"""
|
@@ -206,7 +206,6 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
|
|
206
206
|
input: Union[str, List[str], np.ndarray, List[np.ndarray]],
|
207
207
|
use_doc_orientation_classify: Optional[bool] = None,
|
208
208
|
use_doc_unwarping: Optional[bool] = None,
|
209
|
-
use_general_ocr: Optional[bool] = None,
|
210
209
|
use_seal_recognition: Optional[bool] = None,
|
211
210
|
use_table_recognition: Optional[bool] = None,
|
212
211
|
layout_threshold: Optional[Union[float, dict]] = None,
|
@@ -237,7 +236,6 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
|
|
237
236
|
numpy array of an image, or list of numpy arrays.
|
238
237
|
use_doc_orientation_classify (bool): Flag to use document orientation classification.
|
239
238
|
use_doc_unwarping (bool): Flag to use document unwarping.
|
240
|
-
use_general_ocr (bool): Flag to use general OCR.
|
241
239
|
use_seal_recognition (bool): Flag to use seal recognition.
|
242
240
|
use_table_recognition (bool): Flag to use table recognition.
|
243
241
|
layout_threshold (Optional[float]): The threshold value to filter out low-confidence predictions. Default is None.
|
@@ -280,7 +278,6 @@ class PP_ChatOCRv3_Pipeline(PP_ChatOCR_Pipeline):
|
|
280
278
|
input,
|
281
279
|
use_doc_orientation_classify=use_doc_orientation_classify,
|
282
280
|
use_doc_unwarping=use_doc_unwarping,
|
283
|
-
use_general_ocr=use_general_ocr,
|
284
281
|
use_seal_recognition=use_seal_recognition,
|
285
282
|
use_table_recognition=use_table_recognition,
|
286
283
|
layout_threshold=layout_threshold,
|
@@ -62,9 +62,9 @@ class PP_ChatOCRv4_Pipeline(PP_ChatOCR_Pipeline):
|
|
62
62
|
device (str, optional): Device to run the predictions on. Defaults to None.
|
63
63
|
pp_option (PaddlePredictorOption, optional): PaddlePredictor options. Defaults to None.
|
64
64
|
use_hpip (bool, optional): Whether to use the high-performance
|
65
|
-
inference plugin (HPIP). Defaults to False.
|
65
|
+
inference plugin (HPIP) by default. Defaults to False.
|
66
66
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
67
|
-
The high-performance inference configuration dictionary.
|
67
|
+
The default high-performance inference configuration dictionary.
|
68
68
|
Defaults to None.
|
69
69
|
initial_predictor (bool, optional): Whether to initialize the predictor. Defaults to True.
|
70
70
|
"""
|
@@ -249,7 +249,7 @@ class PP_ChatOCRv4_Pipeline(PP_ChatOCR_Pipeline):
|
|
249
249
|
input: Union[str, List[str], np.ndarray, List[np.ndarray]],
|
250
250
|
use_doc_orientation_classify: Optional[bool] = None,
|
251
251
|
use_doc_unwarping: Optional[bool] = None,
|
252
|
-
|
252
|
+
use_textline_orientation: Optional[bool] = None,
|
253
253
|
use_seal_recognition: Optional[bool] = None,
|
254
254
|
use_table_recognition: Optional[bool] = None,
|
255
255
|
layout_threshold: Optional[Union[float, dict]] = None,
|
@@ -280,7 +280,7 @@ class PP_ChatOCRv4_Pipeline(PP_ChatOCR_Pipeline):
|
|
280
280
|
numpy array of an image, or list of numpy arrays.
|
281
281
|
use_doc_orientation_classify (bool): Flag to use document orientation classification.
|
282
282
|
use_doc_unwarping (bool): Flag to use document unwarping.
|
283
|
-
|
283
|
+
use_textline_orientation (Optional[bool]): Whether to use textline orientation prediction.
|
284
284
|
use_seal_recognition (bool): Flag to use seal recognition.
|
285
285
|
use_table_recognition (bool): Flag to use table recognition.
|
286
286
|
layout_threshold (Optional[float]): The threshold value to filter out low-confidence predictions. Default is None.
|
@@ -322,7 +322,7 @@ class PP_ChatOCRv4_Pipeline(PP_ChatOCR_Pipeline):
|
|
322
322
|
input,
|
323
323
|
use_doc_orientation_classify=use_doc_orientation_classify,
|
324
324
|
use_doc_unwarping=use_doc_unwarping,
|
325
|
-
|
325
|
+
use_textline_orientation=use_textline_orientation,
|
326
326
|
use_seal_recognition=use_seal_recognition,
|
327
327
|
use_table_recognition=use_table_recognition,
|
328
328
|
layout_threshold=layout_threshold,
|
@@ -20,15 +20,13 @@ from ....utils.deps import pipeline_requires_extra
|
|
20
20
|
from ...models.object_detection.result import DetResult
|
21
21
|
from ...utils.hpi import HPIConfig
|
22
22
|
from ...utils.pp_option import PaddlePredictorOption
|
23
|
+
from .._parallel import AutoParallelImageSimpleInferencePipeline
|
23
24
|
from ..base import BasePipeline
|
24
25
|
|
25
26
|
|
26
|
-
|
27
|
-
class RotatedObjectDetectionPipeline(BasePipeline):
|
27
|
+
class _RotatedObjectDetectionPipeline(BasePipeline):
|
28
28
|
"""Rotated Object Detection Pipeline"""
|
29
29
|
|
30
|
-
entities = "rotated_object_detection"
|
31
|
-
|
32
30
|
def __init__(
|
33
31
|
self,
|
34
32
|
config: Dict,
|
@@ -45,9 +43,9 @@ class RotatedObjectDetectionPipeline(BasePipeline):
|
|
45
43
|
device (str): The device to run the prediction on. Default is None.
|
46
44
|
pp_option (PaddlePredictorOption): Options for PaddlePaddle predictor. Default is None.
|
47
45
|
use_hpip (bool, optional): Whether to use the high-performance
|
48
|
-
inference plugin (HPIP). Defaults to False.
|
46
|
+
inference plugin (HPIP) by default. Defaults to False.
|
49
47
|
hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
|
50
|
-
The high-performance inference configuration dictionary.
|
48
|
+
The default high-performance inference configuration dictionary.
|
51
49
|
Defaults to None.
|
52
50
|
"""
|
53
51
|
super().__init__(
|
@@ -83,3 +81,15 @@ class RotatedObjectDetectionPipeline(BasePipeline):
|
|
83
81
|
DetResult: The predicted rotated object detection results.
|
84
82
|
"""
|
85
83
|
yield from self.rotated_object_detection_model(input, threshold=threshold)
|
84
|
+
|
85
|
+
|
86
|
+
@pipeline_requires_extra("cv")
|
87
|
+
class RotatedObjectDetectionPipeline(AutoParallelImageSimpleInferencePipeline):
|
88
|
+
entities = "rotated_object_detection"
|
89
|
+
|
90
|
+
@property
|
91
|
+
def _pipeline_cls(self):
|
92
|
+
return _RotatedObjectDetectionPipeline
|
93
|
+
|
94
|
+
def _get_batch_size(self, config):
|
95
|
+
return config["SubModules"]["RotatedObjectDetection"].get("batch_size", 1)
|