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
@@ -26,8 +26,8 @@ from ....utils.deps import class_requires_deps, is_dep_available
|
|
26
26
|
|
27
27
|
if is_dep_available("opencv-contrib-python"):
|
28
28
|
import cv2
|
29
|
-
if is_dep_available("
|
30
|
-
import
|
29
|
+
if is_dep_available("pypdfium2"):
|
30
|
+
import pypdfium2 as pdfium
|
31
31
|
if is_dep_available("soundfile"):
|
32
32
|
import soundfile
|
33
33
|
|
@@ -96,7 +96,7 @@ class _BaseReader(object):
|
|
96
96
|
class PDFReader(_BaseReader):
|
97
97
|
"""PDFReader"""
|
98
98
|
|
99
|
-
def __init__(self, backend="
|
99
|
+
def __init__(self, backend="pypdfium2", **bk_args):
|
100
100
|
super().__init__(backend, **bk_args)
|
101
101
|
|
102
102
|
def read(self, in_path):
|
@@ -244,19 +244,19 @@ class PILImageReaderBackend(_ImageReaderBackend):
|
|
244
244
|
return ImageOps.exif_transpose(Image.open(in_path))
|
245
245
|
|
246
246
|
|
247
|
-
@class_requires_deps("
|
247
|
+
@class_requires_deps("pypdfium2", "opencv-contrib-python")
|
248
248
|
class PDFReaderBackend(_BaseReaderBackend):
|
249
249
|
|
250
|
-
def __init__(self, rotate=0,
|
250
|
+
def __init__(self, rotate=0, zoom=2.0):
|
251
251
|
super().__init__()
|
252
|
-
self.
|
252
|
+
self._rotation = rotate
|
253
|
+
self._scale = zoom
|
253
254
|
|
254
255
|
def read_file(self, in_path):
|
255
|
-
for page in
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
)
|
256
|
+
for page in pdfium.PdfDocument(in_path):
|
257
|
+
image = page.render(scale=self._scale, rotation=self._rotation).to_pil()
|
258
|
+
image = image.convert("RGB")
|
259
|
+
img_cv = np.array(image)
|
260
260
|
img_cv = cv2.cvtColor(img_cv, cv2.COLOR_RGB2BGR)
|
261
261
|
yield img_cv
|
262
262
|
|
@@ -361,7 +361,7 @@ class DecordVideoReaderBackend(_VideoReaderBackend):
|
|
361
361
|
self.valid_mode = True
|
362
362
|
self._fps = 0
|
363
363
|
|
364
|
-
# XXX(gaotingquan): There is a
|
364
|
+
# XXX(gaotingquan): There is a conflict with `paddle` when import `decord` globally.
|
365
365
|
try:
|
366
366
|
import decord
|
367
367
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
MKLDNN_BLOCKLIST = [
|
16
|
+
"SLANeXt_wired",
|
17
|
+
"SLANeXt_wireless",
|
18
|
+
"LaTeX_OCR_rec",
|
19
|
+
"PP-FormulaNet-L",
|
20
|
+
"PP-FormulaNet-S",
|
21
|
+
"UniMERNet",
|
22
|
+
"PP-FormulaNet_plus-L",
|
23
|
+
"PP-FormulaNet_plus-M",
|
24
|
+
"PP-FormulaNet_plus-S",
|
25
|
+
]
|
@@ -37,6 +37,7 @@ OFFICIAL_MODELS = {
|
|
37
37
|
"PP-LCNet_x0_75": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x0_75_infer.tar",
|
38
38
|
"PP-LCNet_x1_0": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_0_infer.tar",
|
39
39
|
"PP-LCNet_x1_0_doc_ori": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_0_doc_ori_infer.tar",
|
40
|
+
"PP-LCNet_x1_0_textline_ori": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_0_textline_ori_infer.tar",
|
40
41
|
"PP-LCNet_x1_5": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x1_5_infer.tar",
|
41
42
|
"PP-LCNet_x2_5": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x2_5_infer.tar",
|
42
43
|
"PP-LCNet_x2_0": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-LCNet_x2_0_infer.tar",
|
@@ -250,6 +251,9 @@ PP-LCNet_x1_0_vehicle_attribute_infer.tar",
|
|
250
251
|
"UniMERNet": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/UniMERNet_infer.tar",
|
251
252
|
"PP-FormulaNet-S": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-FormulaNet-S_infer.tar",
|
252
253
|
"PP-FormulaNet-L": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-FormulaNet-L_infer.tar",
|
254
|
+
"PP-FormulaNet_plus-S": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-FormulaNet_plus-S_infer.tar",
|
255
|
+
"PP-FormulaNet_plus-M": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-FormulaNet_plus-M_infer.tar",
|
256
|
+
"PP-FormulaNet_plus-L": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-FormulaNet_plus-L_infer.tar",
|
253
257
|
"FasterRCNN-ResNet34-FPN": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/FasterRCNN-ResNet34-FPN_infer.tar",
|
254
258
|
"FasterRCNN-ResNet50": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/FasterRCNN-ResNet50_infer.tar",
|
255
259
|
"FasterRCNN-ResNet50-FPN": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/FasterRCNN-ResNet50-FPN_infer.tar",
|
@@ -331,10 +335,20 @@ PP-LCNet_x1_0_vehicle_attribute_infer.tar",
|
|
331
335
|
"PP-DocLayout-L": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocLayout-L_infer.tar",
|
332
336
|
"PP-DocLayout-M": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocLayout-M_infer.tar",
|
333
337
|
"PP-DocLayout-S": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocLayout-S_infer.tar",
|
338
|
+
"PP-DocLayout_plus-L": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocLayout_plus-L_infer.tar",
|
339
|
+
"PP-DocBlockLayout": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocBlockLayout_infer.tar",
|
334
340
|
"BEVFusion": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/BEVFusion_infer.tar",
|
335
341
|
"YOLO-Worldv2-L": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/YOLO-Worldv2-L_infer.tar",
|
336
342
|
"PP-DocBee-2B": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocBee-2B_infer.tar",
|
337
343
|
"PP-DocBee-7B": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocBee-7B_infer.tar",
|
344
|
+
"PP-Chart2Table": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-Chart2Table_infer.tar",
|
345
|
+
"PP-OCRv5_server_det": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-OCRv5_server_det_infer.tar",
|
346
|
+
"PP-OCRv5_mobile_det": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-OCRv5_mobile_det_infer.tar",
|
347
|
+
"PP-OCRv5_server_rec": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/\
|
348
|
+
PP-OCRv5_server_rec_infer.tar",
|
349
|
+
"PP-OCRv5_mobile_rec": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/\
|
350
|
+
PP-OCRv5_mobile_rec_infer.tar",
|
351
|
+
"PP-DocBee2-3B": "https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0.0/PP-DocBee2-3B_infer.tar",
|
338
352
|
}
|
339
353
|
|
340
354
|
|
@@ -13,6 +13,7 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
import os
|
16
|
+
from copy import deepcopy
|
16
17
|
from typing import Dict, List
|
17
18
|
|
18
19
|
from ...utils import logging
|
@@ -23,6 +24,7 @@ from ...utils.device import (
|
|
23
24
|
set_env_for_device_type,
|
24
25
|
)
|
25
26
|
from ...utils.flags import USE_PIR_TRT
|
27
|
+
from .mkldnn_blocklist import MKLDNN_BLOCKLIST
|
26
28
|
from .new_ir_blocklist import NEWIR_BLOCKLIST
|
27
29
|
from .trt_blocklist import TRT_BLOCKLIST
|
28
30
|
from .trt_config import TRT_CFG_SETTING, TRT_PRECISION_MAP
|
@@ -44,7 +46,7 @@ class PaddlePredictorOption(object):
|
|
44
46
|
)
|
45
47
|
SUPPORT_DEVICE = ("gpu", "cpu", "npu", "xpu", "mlu", "dcu", "gcu")
|
46
48
|
|
47
|
-
def __init__(self, model_name, **kwargs):
|
49
|
+
def __init__(self, model_name=None, **kwargs):
|
48
50
|
super().__init__()
|
49
51
|
self._model_name = model_name
|
50
52
|
self._cfg = {}
|
@@ -55,6 +57,10 @@ class PaddlePredictorOption(object):
|
|
55
57
|
def model_name(self):
|
56
58
|
return self._model_name
|
57
59
|
|
60
|
+
@model_name.setter
|
61
|
+
def model_name(self, model_name):
|
62
|
+
self._model_name = model_name
|
63
|
+
|
58
64
|
@property
|
59
65
|
def changed(self):
|
60
66
|
return self._changed
|
@@ -64,6 +70,13 @@ class PaddlePredictorOption(object):
|
|
64
70
|
assert isinstance(v, bool)
|
65
71
|
self._changed = v
|
66
72
|
|
73
|
+
def copy(self):
|
74
|
+
obj = type(self)(self._model_name)
|
75
|
+
obj._cfg = deepcopy(self._cfg)
|
76
|
+
if hasattr(self, "trt_cfg_setting"):
|
77
|
+
obj.trt_cfg_setting = self.trt_cfg_setting
|
78
|
+
return obj
|
79
|
+
|
67
80
|
def _init_option(self, **kwargs):
|
68
81
|
for k, v in kwargs.items():
|
69
82
|
if self._has_setter(k):
|
@@ -125,12 +138,20 @@ class PaddlePredictorOption(object):
|
|
125
138
|
raise ValueError(
|
126
139
|
f"`run_mode` must be {support_run_mode_str}, but received {repr(run_mode)}."
|
127
140
|
)
|
128
|
-
|
129
|
-
if
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
141
|
+
|
142
|
+
if self._model_name is not None:
|
143
|
+
# TRT Blocklist
|
144
|
+
if run_mode.startswith("trt") and self._model_name in TRT_BLOCKLIST:
|
145
|
+
logging.warning(
|
146
|
+
f"The model({self._model_name}) is not supported to run in trt mode! Using `paddle` instead!"
|
147
|
+
)
|
148
|
+
run_mode = "paddle"
|
149
|
+
# MKLDNN Blocklist
|
150
|
+
elif run_mode.startswith("mkldnn") and self._model_name in MKLDNN_BLOCKLIST:
|
151
|
+
logging.warning(
|
152
|
+
f"The model({self._model_name}) is not supported to run in MKLDNN mode! Using `paddle` instead!"
|
153
|
+
)
|
154
|
+
run_mode = "paddle"
|
134
155
|
|
135
156
|
self._update("run_mode", run_mode)
|
136
157
|
|
@@ -206,7 +227,7 @@ class PaddlePredictorOption(object):
|
|
206
227
|
"""set trt config"""
|
207
228
|
assert isinstance(
|
208
229
|
config, dict
|
209
|
-
), f"The trt_cfg_setting must be `dict` type, but
|
230
|
+
), f"The trt_cfg_setting must be `dict` type, but received `{type(config)}` type!"
|
210
231
|
self._update("trt_cfg_setting", config)
|
211
232
|
|
212
233
|
@property
|
paddlex/model.py
CHANGED
@@ -17,7 +17,7 @@ from copy import deepcopy
|
|
17
17
|
from .inference import PaddlePredictorOption, create_predictor
|
18
18
|
from .modules import (
|
19
19
|
build_dataset_checker,
|
20
|
-
|
20
|
+
build_evaluator,
|
21
21
|
build_exportor,
|
22
22
|
build_trainer,
|
23
23
|
)
|
@@ -119,7 +119,7 @@ class _ModelBasedConfig(_BaseModel):
|
|
119
119
|
trainer.train()
|
120
120
|
|
121
121
|
def evaluate(self):
|
122
|
-
evaluator =
|
122
|
+
evaluator = build_evaluator(self._config)
|
123
123
|
return evaluator.evaluate()
|
124
124
|
|
125
125
|
def export(self):
|
paddlex/modules/__init__.py
CHANGED
@@ -14,7 +14,7 @@
|
|
14
14
|
from importlib import import_module
|
15
15
|
|
16
16
|
from .anomaly_detection import UadDatasetChecker, UadEvaluator, UadExportor, UadTrainer
|
17
|
-
from .base import build_dataset_checker,
|
17
|
+
from .base import build_dataset_checker, build_evaluator, build_exportor, build_trainer
|
18
18
|
from .face_recognition import (
|
19
19
|
FaceRecDatasetChecker,
|
20
20
|
FaceRecEvaluator,
|
@@ -26,7 +26,7 @@ class UadEvaluator(BaseEvaluator):
|
|
26
26
|
entities = MODELS
|
27
27
|
|
28
28
|
def update_config(self):
|
29
|
-
"""update
|
29
|
+
"""update evaluation config"""
|
30
30
|
self.pdx_config.update_dataset(self.global_config.dataset_dir, "SegDataset")
|
31
31
|
self.pdx_config.update_pretrained_weights(None, is_backbone=True)
|
32
32
|
|
@@ -47,7 +47,7 @@ class UadEvaluator(BaseEvaluator):
|
|
47
47
|
return config_path
|
48
48
|
|
49
49
|
def get_eval_kwargs(self) -> dict:
|
50
|
-
"""get key-value arguments of model
|
50
|
+
"""get key-value arguments of model evaluation function
|
51
51
|
|
52
52
|
Returns:
|
53
53
|
dict: the arguments of evaluation function.
|
paddlex/modules/base/__init__.py
CHANGED
@@ -13,6 +13,6 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
from .dataset_checker import BaseDatasetChecker, build_dataset_checker
|
16
|
-
from .evaluator import BaseEvaluator,
|
16
|
+
from .evaluator import BaseEvaluator, build_evaluator
|
17
17
|
from .exportor import BaseExportor, build_exportor
|
18
18
|
from .trainer import BaseTrainer, build_trainer
|
@@ -27,14 +27,14 @@ from ...utils.misc import AutoRegisterABCMetaClass
|
|
27
27
|
from .build_model import build_model
|
28
28
|
|
29
29
|
|
30
|
-
def
|
31
|
-
"""build model
|
30
|
+
def build_evaluator(config: AttrDict) -> "BaseEvaluator":
|
31
|
+
"""build model evaluator
|
32
32
|
|
33
33
|
Args:
|
34
34
|
config (AttrDict): PaddleX pipeline config, which is loaded from pipeline yaml file.
|
35
35
|
|
36
36
|
Returns:
|
37
|
-
BaseEvaluator: the
|
37
|
+
BaseEvaluator: the evaluator, which is subclass of BaseEvaluator.
|
38
38
|
"""
|
39
39
|
model_name = config.Global.model
|
40
40
|
try:
|
@@ -161,10 +161,10 @@ evaling!"
|
|
161
161
|
|
162
162
|
@abstractmethod
|
163
163
|
def update_config(self):
|
164
|
-
"""update
|
164
|
+
"""update evaluation config"""
|
165
165
|
raise NotImplementedError
|
166
166
|
|
167
167
|
@abstractmethod
|
168
168
|
def get_eval_kwargs(self):
|
169
|
-
"""get key-value arguments of model
|
169
|
+
"""get key-value arguments of model evaluation function"""
|
170
170
|
raise NotImplementedError
|
paddlex/modules/base/trainer.py
CHANGED
@@ -21,7 +21,7 @@ from ...utils.device import (
|
|
21
21
|
set_env_for_device,
|
22
22
|
update_device_num,
|
23
23
|
)
|
24
|
-
from ...utils.flags import
|
24
|
+
from ...utils.flags import DISABLE_CINN_MODEL_WL, FLAGS_json_format_model
|
25
25
|
from ...utils.misc import AutoRegisterABCMetaClass
|
26
26
|
from .build_model import build_model
|
27
27
|
from .utils.cinn_setting import CINN_WHITELIST, enable_cinn_backend
|
@@ -18,12 +18,12 @@ from .model_list import MODELS
|
|
18
18
|
|
19
19
|
|
20
20
|
class DocVLMDatasetChecker(BaseDatasetChecker):
|
21
|
-
"""Dataset Checker for Document Vision
|
21
|
+
"""Dataset Checker for Document Vision Language Model"""
|
22
22
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def __init__(self, config):
|
26
26
|
# not support for now
|
27
27
|
raise UnsupportedAPIError(
|
28
|
-
"document vision
|
28
|
+
"document vision language models do not support data check for now."
|
29
29
|
)
|
@@ -18,12 +18,12 @@ from .model_list import MODELS
|
|
18
18
|
|
19
19
|
|
20
20
|
class DocVLMEvaluator(BaseEvaluator):
|
21
|
-
"""Document Vision
|
21
|
+
"""Document Vision Language Model Evaluator"""
|
22
22
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def __init__(self, config):
|
26
26
|
# not support for now
|
27
27
|
raise UnsupportedAPIError(
|
28
|
-
"document vision
|
28
|
+
"document vision language models do not support evaluate for now."
|
29
29
|
)
|
@@ -18,12 +18,12 @@ from .model_list import MODELS
|
|
18
18
|
|
19
19
|
|
20
20
|
class DocVLMExportor(BaseExportor):
|
21
|
-
"""Document Vision
|
21
|
+
"""Document Vision Language Model Exportor"""
|
22
22
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def __init__(self, config):
|
26
26
|
# not support for now
|
27
27
|
raise UnsupportedAPIError(
|
28
|
-
"document vision
|
28
|
+
"document vision language models do not support export for now."
|
29
29
|
)
|
@@ -18,14 +18,14 @@ from .model_list import MODELS
|
|
18
18
|
|
19
19
|
|
20
20
|
class DocVLMTrainer(BaseTrainer):
|
21
|
-
"""Document Vision
|
21
|
+
"""Document Vision Language Model Trainer"""
|
22
22
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def __init__(self, config):
|
26
26
|
# not support for now
|
27
27
|
raise UnsupportedAPIError(
|
28
|
-
"Document vision
|
28
|
+
"Document vision language models do not support train for now."
|
29
29
|
)
|
30
30
|
|
31
31
|
def update_config(self):
|
@@ -24,7 +24,7 @@ class FaceRecEvaluator(BaseEvaluator):
|
|
24
24
|
entities = MODELS
|
25
25
|
|
26
26
|
def update_config(self):
|
27
|
-
"""update
|
27
|
+
"""update evaluation config"""
|
28
28
|
if self.eval_config.log_interval:
|
29
29
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
30
30
|
self.update_dataset_cfg()
|
@@ -41,7 +41,7 @@ class FaceRecEvaluator(BaseEvaluator):
|
|
41
41
|
self.pdx_config.update(ds_cfg)
|
42
42
|
|
43
43
|
def get_eval_kwargs(self) -> dict:
|
44
|
-
"""get key-value arguments of model
|
44
|
+
"""get key-value arguments of model evaluation function
|
45
45
|
|
46
46
|
Returns:
|
47
47
|
dict: the arguments of evaluation function.
|
@@ -25,7 +25,7 @@ class FormulaRecEvaluator(BaseEvaluator):
|
|
25
25
|
entities = MODELS
|
26
26
|
|
27
27
|
def update_config(self):
|
28
|
-
"""update
|
28
|
+
"""update evaluation config"""
|
29
29
|
if self.eval_config.log_interval:
|
30
30
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
31
31
|
if self.global_config["model"] == "LaTeX_OCR_rec":
|
@@ -36,6 +36,9 @@ class FormulaRecEvaluator(BaseEvaluator):
|
|
36
36
|
"UniMERNet",
|
37
37
|
"PP-FormulaNet-L",
|
38
38
|
"PP-FormulaNet-S",
|
39
|
+
"PP-FormulaNet_plus-L",
|
40
|
+
"PP-FormulaNet_plus-M",
|
41
|
+
"PP-FormulaNet_plus-S",
|
39
42
|
):
|
40
43
|
self.pdx_config.update_dataset(
|
41
44
|
self.global_config.dataset_dir, "SimpleDataSet"
|
@@ -66,7 +69,7 @@ class FormulaRecEvaluator(BaseEvaluator):
|
|
66
69
|
self.pdx_config.update_delimiter(self.eval_config.delimiter, mode="eval")
|
67
70
|
|
68
71
|
def get_eval_kwargs(self) -> dict:
|
69
|
-
"""get key-value arguments of model
|
72
|
+
"""get key-value arguments of model evaluation function
|
70
73
|
|
71
74
|
Returns:
|
72
75
|
dict: the arguments of evaluation function.
|
@@ -53,6 +53,9 @@ class FormulaRecTrainer(BaseTrainer):
|
|
53
53
|
"UniMERNet",
|
54
54
|
"PP-FormulaNet-L",
|
55
55
|
"PP-FormulaNet-S",
|
56
|
+
"PP-FormulaNet_plus-L",
|
57
|
+
"PP-FormulaNet_plus-M",
|
58
|
+
"PP-FormulaNet_plus-S",
|
56
59
|
):
|
57
60
|
self.pdx_config.update_dataset(
|
58
61
|
self.global_config.dataset_dir, "SimpleDataSet"
|
@@ -22,7 +22,7 @@ class ShiTuRecEvaluator(ClsEvaluator):
|
|
22
22
|
entities = MODELS
|
23
23
|
|
24
24
|
def update_config(self):
|
25
|
-
"""update
|
25
|
+
"""update evaluation config"""
|
26
26
|
if self.eval_config.log_interval:
|
27
27
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
28
28
|
self.pdx_config.update_dataset(
|
@@ -22,7 +22,7 @@ class ClsEvaluator(BaseEvaluator):
|
|
22
22
|
entities = MODELS
|
23
23
|
|
24
24
|
def update_config(self):
|
25
|
-
"""update
|
25
|
+
"""update evaluation config"""
|
26
26
|
if self.eval_config.log_interval:
|
27
27
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
28
28
|
if self.pdx_config["Arch"]["name"] == "DistillationModel":
|
@@ -32,7 +32,7 @@ class ClsEvaluator(BaseEvaluator):
|
|
32
32
|
self.pdx_config.update_pretrained_weights(self.eval_config.weight_path)
|
33
33
|
|
34
34
|
def get_eval_kwargs(self) -> dict:
|
35
|
-
"""get key-value arguments of model
|
35
|
+
"""get key-value arguments of model evaluation function
|
36
36
|
|
37
37
|
Returns:
|
38
38
|
dict: the arguments of evaluation function.
|
@@ -23,7 +23,7 @@ class InstanceSegEvaluator(DetEvaluator):
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def update_config(self):
|
26
|
-
"""update
|
26
|
+
"""update evaluation config"""
|
27
27
|
if self.eval_config.log_interval:
|
28
28
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
29
29
|
self.pdx_config.update_dataset(
|
@@ -23,7 +23,7 @@ class KeypointEvaluator(DetEvaluator):
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def update_config(self):
|
26
|
-
"""update
|
26
|
+
"""update evaluation config"""
|
27
27
|
if self.eval_config.log_interval:
|
28
28
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
29
29
|
metric = self.pdx_config.metric
|
@@ -23,7 +23,7 @@ class BEVFusionEvaluator(BaseEvaluator):
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def update_config(self):
|
26
|
-
"""update
|
26
|
+
"""update evaluation config"""
|
27
27
|
if self.eval_config.batch_size is not None:
|
28
28
|
self.pdx_config.update_batch_size(self.eval_config.batch_size)
|
29
29
|
self.pdx_config.update_dataset(
|
@@ -35,7 +35,7 @@ class BEVFusionEvaluator(BaseEvaluator):
|
|
35
35
|
self.pdx_config.update_weights(self.eval_config.weight_path)
|
36
36
|
|
37
37
|
def get_eval_kwargs(self) -> dict:
|
38
|
-
"""get key-value arguments of model
|
38
|
+
"""get key-value arguments of model evaluation function
|
39
39
|
|
40
40
|
Returns:
|
41
41
|
dict: the arguments of evaluation function.
|
@@ -22,7 +22,7 @@ class MLClsEvaluator(BaseEvaluator):
|
|
22
22
|
entities = MODELS
|
23
23
|
|
24
24
|
def update_config(self):
|
25
|
-
"""update
|
25
|
+
"""update evaluation config"""
|
26
26
|
if self.eval_config.log_interval:
|
27
27
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
28
28
|
if self.pdx_config["Arch"]["name"] == "DistillationModel":
|
@@ -32,7 +32,7 @@ class MLClsEvaluator(BaseEvaluator):
|
|
32
32
|
self.pdx_config.update_pretrained_weights(self.eval_config.weight_path)
|
33
33
|
|
34
34
|
def get_eval_kwargs(self) -> dict:
|
35
|
-
"""get key-value arguments of model
|
35
|
+
"""get key-value arguments of model evaluation function
|
36
36
|
|
37
37
|
Returns:
|
38
38
|
dict: the arguments of evaluation function.
|
@@ -267,8 +267,8 @@ def voc_get_label_anno(root_dir, anno_path):
|
|
267
267
|
Read VOC format annotation file.
|
268
268
|
|
269
269
|
Args:
|
270
|
-
root_dir (str): The
|
271
|
-
anno_path (str): The
|
270
|
+
root_dir (str): The directory of VOC annotation file.
|
271
|
+
anno_path (str): The annotation file path.
|
272
272
|
|
273
273
|
Returns:
|
274
274
|
tuple: A tuple of two elements, the first of which is of type dict, representing the mapping between tag names
|
@@ -295,7 +295,7 @@ def voc_get_label_anno(root_dir, anno_path):
|
|
295
295
|
|
296
296
|
def voc_get_image_info(annotation_root, img_indexer):
|
297
297
|
"""
|
298
|
-
Get the
|
298
|
+
Get the image info from VOC annotation file.
|
299
299
|
|
300
300
|
Args:
|
301
301
|
annotation_root: The annotation root.
|
@@ -425,7 +425,7 @@ def voc_xmls_to_cocojson(
|
|
425
425
|
output_json_dict["images"].append(img_info)
|
426
426
|
|
427
427
|
for obj in ann_root.findall("object"):
|
428
|
-
if obj.find("bndbox") is None: # Skip the
|
428
|
+
if obj.find("bndbox") is None: # Skip the object without bndbox
|
429
429
|
continue
|
430
430
|
ann = voc_get_coco_annotation(obj=obj, label_indexer=label_indexer)
|
431
431
|
ann.update({"image_id": img_info["id"], "id": bnd_id})
|
@@ -39,14 +39,14 @@ class DetEvaluator(BaseEvaluator):
|
|
39
39
|
)
|
40
40
|
|
41
41
|
def update_config(self):
|
42
|
-
"""update
|
42
|
+
"""update evaluation config"""
|
43
43
|
if self.eval_config.log_interval:
|
44
44
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
45
45
|
self._update_dataset()
|
46
46
|
self.pdx_config.update_weights(self.eval_config.weight_path)
|
47
47
|
|
48
48
|
def get_eval_kwargs(self) -> dict:
|
49
|
-
"""get key-value arguments of model
|
49
|
+
"""get key-value arguments of model evaluation function
|
50
50
|
|
51
51
|
Returns:
|
52
52
|
dict: the arguments of evaluation function.
|
@@ -26,7 +26,7 @@ class SegEvaluator(BaseEvaluator):
|
|
26
26
|
entities = MODELS
|
27
27
|
|
28
28
|
def update_config(self):
|
29
|
-
"""update
|
29
|
+
"""update evaluation config"""
|
30
30
|
self.pdx_config.update_dataset(self.global_config.dataset_dir, "SegDataset")
|
31
31
|
self.pdx_config.update_pretrained_weights(None, is_backbone=True)
|
32
32
|
|
@@ -47,7 +47,7 @@ class SegEvaluator(BaseEvaluator):
|
|
47
47
|
return config_path
|
48
48
|
|
49
49
|
def get_eval_kwargs(self) -> dict:
|
50
|
-
"""get key-value arguments of model
|
50
|
+
"""get key-value arguments of model evaluation function
|
51
51
|
|
52
52
|
Returns:
|
53
53
|
dict: the arguments of evaluation function.
|
@@ -23,7 +23,7 @@ class TableRecEvaluator(BaseEvaluator):
|
|
23
23
|
entities = MODELS
|
24
24
|
|
25
25
|
def update_config(self):
|
26
|
-
"""update
|
26
|
+
"""update evaluation config"""
|
27
27
|
if self.eval_config.log_interval:
|
28
28
|
self.pdx_config.update_log_interval(self.eval_config.log_interval)
|
29
29
|
|
@@ -32,7 +32,7 @@ class TableRecEvaluator(BaseEvaluator):
|
|
32
32
|
)
|
33
33
|
|
34
34
|
def get_eval_kwargs(self) -> dict:
|
35
|
-
"""get key-value arguments of model
|
35
|
+
"""get key-value arguments of model evaluation function
|
36
36
|
|
37
37
|
Returns:
|
38
38
|
dict: the arguments of evaluation function.
|