paddlex 2.0.0rc4__py3-none-any.whl → 3.0.0b2__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 -0
- paddlex/__init__.py +51 -18
- paddlex/__main__.py +40 -0
- paddlex/configs/anomaly_detection/STFPM.yaml +41 -0
- paddlex/configs/doc_text_orientation/PP-LCNet_x1_0_doc_ori.yaml +41 -0
- paddlex/configs/face_detection/BlazeFace-FPN-SSH.yaml +40 -0
- paddlex/configs/face_detection/BlazeFace.yaml +40 -0
- paddlex/configs/face_detection/PP-YOLOE_plus-S_face.yaml +40 -0
- paddlex/configs/face_detection/PicoDet_LCNet_x2_5_face.yaml +40 -0
- paddlex/configs/face_recognition/MobileFaceNet.yaml +44 -0
- paddlex/configs/face_recognition/ResNet50_face.yaml +44 -0
- paddlex/configs/formula_recognition/LaTeX_OCR_rec.yaml +40 -0
- paddlex/configs/general_recognition/PP-ShiTuV2_rec.yaml +42 -0
- paddlex/configs/general_recognition/PP-ShiTuV2_rec_CLIP_vit_base.yaml +42 -0
- paddlex/configs/general_recognition/PP-ShiTuV2_rec_CLIP_vit_large.yaml +41 -0
- paddlex/configs/human_detection/PP-YOLOE-L_human.yaml +42 -0
- paddlex/configs/human_detection/PP-YOLOE-S_human.yaml +42 -0
- paddlex/configs/image_classification/CLIP_vit_base_patch16_224.yaml +41 -0
- paddlex/configs/image_classification/CLIP_vit_large_patch14_224.yaml +41 -0
- paddlex/configs/image_classification/ConvNeXt_base_224.yaml +41 -0
- paddlex/configs/image_classification/ConvNeXt_base_384.yaml +41 -0
- paddlex/configs/image_classification/ConvNeXt_large_224.yaml +41 -0
- paddlex/configs/image_classification/ConvNeXt_large_384.yaml +41 -0
- paddlex/configs/image_classification/ConvNeXt_small.yaml +41 -0
- paddlex/configs/image_classification/ConvNeXt_tiny.yaml +41 -0
- paddlex/configs/image_classification/FasterNet-L.yaml +40 -0
- paddlex/configs/image_classification/FasterNet-M.yaml +40 -0
- paddlex/configs/image_classification/FasterNet-S.yaml +40 -0
- paddlex/configs/image_classification/FasterNet-T0.yaml +40 -0
- paddlex/configs/image_classification/FasterNet-T1.yaml +40 -0
- paddlex/configs/image_classification/FasterNet-T2.yaml +40 -0
- paddlex/configs/image_classification/MobileNetV1_x0_25.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV1_x0_5.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV1_x0_75.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV1_x1_0.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV2_x0_25.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV2_x0_5.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV2_x1_0.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV2_x1_5.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV2_x2_0.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_large_x0_35.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_large_x0_5.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_large_x0_75.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_large_x1_0.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_large_x1_25.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_small_x0_35.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_small_x0_5.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_small_x0_75.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_small_x1_0.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV3_small_x1_25.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV4_conv_large.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV4_conv_medium.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV4_conv_small.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV4_hybrid_large.yaml +41 -0
- paddlex/configs/image_classification/MobileNetV4_hybrid_medium.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B0.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B1.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B2.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B3.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B4.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B5.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNetV2-B6.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNet_base.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNet_small.yaml +41 -0
- paddlex/configs/image_classification/PP-HGNet_tiny.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNetV2_base.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNetV2_large.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNetV2_small.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x0_25.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x0_35.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x0_5.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x0_75.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x1_0.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x1_5.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x2_0.yaml +41 -0
- paddlex/configs/image_classification/PP-LCNet_x2_5.yaml +41 -0
- paddlex/configs/image_classification/ResNet101.yaml +41 -0
- paddlex/configs/image_classification/ResNet101_vd.yaml +41 -0
- paddlex/configs/image_classification/ResNet152.yaml +41 -0
- paddlex/configs/image_classification/ResNet152_vd.yaml +41 -0
- paddlex/configs/image_classification/ResNet18.yaml +41 -0
- paddlex/configs/image_classification/ResNet18_vd.yaml +41 -0
- paddlex/configs/image_classification/ResNet200_vd.yaml +41 -0
- paddlex/configs/image_classification/ResNet34.yaml +41 -0
- paddlex/configs/image_classification/ResNet34_vd.yaml +41 -0
- paddlex/configs/image_classification/ResNet50.yaml +41 -0
- paddlex/configs/image_classification/ResNet50_vd.yaml +41 -0
- paddlex/configs/image_classification/StarNet-S1.yaml +41 -0
- paddlex/configs/image_classification/StarNet-S2.yaml +41 -0
- paddlex/configs/image_classification/StarNet-S3.yaml +41 -0
- paddlex/configs/image_classification/StarNet-S4.yaml +41 -0
- paddlex/configs/image_classification/SwinTransformer_base_patch4_window12_384.yaml +41 -0
- paddlex/configs/image_classification/SwinTransformer_base_patch4_window7_224.yaml +41 -0
- paddlex/configs/image_classification/SwinTransformer_large_patch4_window12_384.yaml +41 -0
- paddlex/configs/image_classification/SwinTransformer_large_patch4_window7_224.yaml +41 -0
- paddlex/configs/image_classification/SwinTransformer_small_patch4_window7_224.yaml +41 -0
- paddlex/configs/image_classification/SwinTransformer_tiny_patch4_window7_224.yaml +41 -0
- paddlex/configs/image_unwarping/UVDoc.yaml +12 -0
- paddlex/configs/instance_segmentation/Cascade-MaskRCNN-ResNet50-FPN.yaml +40 -0
- paddlex/configs/instance_segmentation/Cascade-MaskRCNN-ResNet50-vd-SSLDv2-FPN.yaml +40 -0
- paddlex/configs/instance_segmentation/Mask-RT-DETR-H.yaml +40 -0
- paddlex/configs/instance_segmentation/Mask-RT-DETR-L.yaml +40 -0
- paddlex/configs/instance_segmentation/Mask-RT-DETR-M.yaml +40 -0
- paddlex/configs/instance_segmentation/Mask-RT-DETR-S.yaml +40 -0
- paddlex/configs/instance_segmentation/Mask-RT-DETR-X.yaml +40 -0
- paddlex/configs/instance_segmentation/MaskRCNN-ResNeXt101-vd-FPN.yaml +39 -0
- paddlex/configs/instance_segmentation/MaskRCNN-ResNet101-FPN.yaml +40 -0
- paddlex/configs/instance_segmentation/MaskRCNN-ResNet101-vd-FPN.yaml +40 -0
- paddlex/configs/instance_segmentation/MaskRCNN-ResNet50-FPN.yaml +40 -0
- paddlex/configs/instance_segmentation/MaskRCNN-ResNet50-vd-FPN.yaml +40 -0
- paddlex/configs/instance_segmentation/MaskRCNN-ResNet50.yaml +40 -0
- paddlex/configs/instance_segmentation/PP-YOLOE_seg-S.yaml +40 -0
- paddlex/configs/instance_segmentation/SOLOv2.yaml +40 -0
- paddlex/configs/mainbody_detection/PP-ShiTuV2_det.yaml +41 -0
- paddlex/configs/multilabel_classification/CLIP_vit_base_patch16_448_ML.yaml +41 -0
- paddlex/configs/multilabel_classification/PP-HGNetV2-B0_ML.yaml +41 -0
- paddlex/configs/multilabel_classification/PP-HGNetV2-B4_ML.yaml +41 -0
- paddlex/configs/multilabel_classification/PP-HGNetV2-B6_ML.yaml +41 -0
- paddlex/configs/multilabel_classification/PP-LCNet_x1_0_ML.yaml +41 -0
- paddlex/configs/multilabel_classification/ResNet50_ML.yaml +41 -0
- paddlex/configs/object_detection/Cascade-FasterRCNN-ResNet50-FPN.yaml +41 -0
- paddlex/configs/object_detection/Cascade-FasterRCNN-ResNet50-vd-SSLDv2-FPN.yaml +42 -0
- paddlex/configs/object_detection/CenterNet-DLA-34.yaml +41 -0
- paddlex/configs/object_detection/CenterNet-ResNet50.yaml +41 -0
- paddlex/configs/object_detection/DETR-R50.yaml +42 -0
- paddlex/configs/object_detection/FCOS-ResNet50.yaml +41 -0
- paddlex/configs/object_detection/FasterRCNN-ResNeXt101-vd-FPN.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet101-FPN.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet101.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet34-FPN.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet50-FPN.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet50-vd-FPN.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet50-vd-SSLDv2-FPN.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-ResNet50.yaml +42 -0
- paddlex/configs/object_detection/FasterRCNN-Swin-Tiny-FPN.yaml +42 -0
- paddlex/configs/object_detection/PP-YOLOE_plus-L.yaml +40 -0
- paddlex/configs/object_detection/PP-YOLOE_plus-M.yaml +40 -0
- paddlex/configs/object_detection/PP-YOLOE_plus-S.yaml +40 -0
- paddlex/configs/object_detection/PP-YOLOE_plus-X.yaml +40 -0
- paddlex/configs/object_detection/PicoDet-L.yaml +40 -0
- paddlex/configs/object_detection/PicoDet-M.yaml +42 -0
- paddlex/configs/object_detection/PicoDet-S.yaml +40 -0
- paddlex/configs/object_detection/PicoDet-XS.yaml +42 -0
- paddlex/configs/object_detection/RT-DETR-H.yaml +40 -0
- paddlex/configs/object_detection/RT-DETR-L.yaml +40 -0
- paddlex/configs/object_detection/RT-DETR-R18.yaml +40 -0
- paddlex/configs/object_detection/RT-DETR-R50.yaml +40 -0
- paddlex/configs/object_detection/RT-DETR-X.yaml +40 -0
- paddlex/configs/object_detection/YOLOX-L.yaml +40 -0
- paddlex/configs/object_detection/YOLOX-M.yaml +40 -0
- paddlex/configs/object_detection/YOLOX-N.yaml +40 -0
- paddlex/configs/object_detection/YOLOX-S.yaml +40 -0
- paddlex/configs/object_detection/YOLOX-T.yaml +40 -0
- paddlex/configs/object_detection/YOLOX-X.yaml +40 -0
- paddlex/configs/object_detection/YOLOv3-DarkNet53.yaml +40 -0
- paddlex/configs/object_detection/YOLOv3-MobileNetV3.yaml +40 -0
- paddlex/configs/object_detection/YOLOv3-ResNet50_vd_DCN.yaml +40 -0
- paddlex/configs/pedestrian_attribute/PP-LCNet_x1_0_pedestrian_attribute.yaml +41 -0
- paddlex/configs/semantic_segmentation/Deeplabv3-R101.yaml +40 -0
- paddlex/configs/semantic_segmentation/Deeplabv3-R50.yaml +40 -0
- paddlex/configs/semantic_segmentation/Deeplabv3_Plus-R101.yaml +40 -0
- paddlex/configs/semantic_segmentation/Deeplabv3_Plus-R50.yaml +40 -0
- paddlex/configs/semantic_segmentation/OCRNet_HRNet-W18.yaml +40 -0
- paddlex/configs/semantic_segmentation/OCRNet_HRNet-W48.yaml +40 -0
- paddlex/configs/semantic_segmentation/PP-LiteSeg-B.yaml +41 -0
- paddlex/configs/semantic_segmentation/PP-LiteSeg-T.yaml +40 -0
- paddlex/configs/semantic_segmentation/SeaFormer_base.yaml +40 -0
- paddlex/configs/semantic_segmentation/SeaFormer_large.yaml +40 -0
- paddlex/configs/semantic_segmentation/SeaFormer_small.yaml +40 -0
- paddlex/configs/semantic_segmentation/SeaFormer_tiny.yaml +40 -0
- paddlex/configs/semantic_segmentation/SegFormer-B0.yaml +40 -0
- paddlex/configs/semantic_segmentation/SegFormer-B1.yaml +40 -0
- paddlex/configs/semantic_segmentation/SegFormer-B2.yaml +40 -0
- paddlex/configs/semantic_segmentation/SegFormer-B3.yaml +40 -0
- paddlex/configs/semantic_segmentation/SegFormer-B4.yaml +40 -0
- paddlex/configs/semantic_segmentation/SegFormer-B5.yaml +40 -0
- paddlex/configs/small_object_detection/PP-YOLOE_plus_SOD-L.yaml +42 -0
- paddlex/configs/small_object_detection/PP-YOLOE_plus_SOD-S.yaml +42 -0
- paddlex/configs/small_object_detection/PP-YOLOE_plus_SOD-largesize-L.yaml +42 -0
- paddlex/configs/structure_analysis/PicoDet-L_layout_17cls.yaml +40 -0
- paddlex/configs/structure_analysis/PicoDet-L_layout_3cls.yaml +40 -0
- paddlex/configs/structure_analysis/PicoDet-S_layout_17cls.yaml +40 -0
- paddlex/configs/structure_analysis/PicoDet-S_layout_3cls.yaml +40 -0
- paddlex/configs/structure_analysis/PicoDet_layout_1x.yaml +40 -0
- paddlex/configs/structure_analysis/PicoDet_layout_1x_table.yaml +40 -0
- paddlex/configs/structure_analysis/RT-DETR-H_layout_17cls.yaml +40 -0
- paddlex/configs/structure_analysis/RT-DETR-H_layout_3cls.yaml +40 -0
- paddlex/configs/table_recognition/SLANet.yaml +39 -0
- paddlex/configs/table_recognition/SLANet_plus.yaml +39 -0
- paddlex/configs/text_detection/PP-OCRv4_mobile_det.yaml +40 -0
- paddlex/configs/text_detection/PP-OCRv4_server_det.yaml +40 -0
- paddlex/configs/text_detection_seal/PP-OCRv4_mobile_seal_det.yaml +40 -0
- paddlex/configs/text_detection_seal/PP-OCRv4_server_seal_det.yaml +40 -0
- paddlex/configs/text_recognition/PP-OCRv4_mobile_rec.yaml +39 -0
- paddlex/configs/text_recognition/PP-OCRv4_server_rec.yaml +39 -0
- paddlex/configs/text_recognition/ch_RepSVTR_rec.yaml +39 -0
- paddlex/configs/text_recognition/ch_SVTRv2_rec.yaml +39 -0
- paddlex/configs/ts_anomaly_detection/AutoEncoder_ad.yaml +37 -0
- paddlex/configs/ts_anomaly_detection/DLinear_ad.yaml +37 -0
- paddlex/configs/ts_anomaly_detection/Nonstationary_ad.yaml +37 -0
- paddlex/configs/ts_anomaly_detection/PatchTST_ad.yaml +37 -0
- paddlex/configs/ts_anomaly_detection/TimesNet_ad.yaml +37 -0
- paddlex/configs/ts_classification/TimesNet_cls.yaml +37 -0
- paddlex/configs/ts_forecast/DLinear.yaml +38 -0
- paddlex/configs/ts_forecast/NLinear.yaml +38 -0
- paddlex/configs/ts_forecast/Nonstationary.yaml +38 -0
- paddlex/configs/ts_forecast/PatchTST.yaml +38 -0
- paddlex/configs/ts_forecast/RLinear.yaml +38 -0
- paddlex/configs/ts_forecast/TiDE.yaml +38 -0
- paddlex/configs/ts_forecast/TimesNet.yaml +38 -0
- paddlex/configs/vehicle_attribute/PP-LCNet_x1_0_vehicle_attribute.yaml +41 -0
- paddlex/configs/vehicle_detection/PP-YOLOE-L_vehicle.yaml +41 -0
- paddlex/configs/vehicle_detection/PP-YOLOE-S_vehicle.yaml +42 -0
- paddlex/engine.py +54 -0
- paddlex/inference/__init__.py +17 -0
- paddlex/inference/components/__init__.py +18 -0
- paddlex/inference/components/base.py +292 -0
- paddlex/inference/components/llm/__init__.py +25 -0
- paddlex/inference/components/llm/base.py +65 -0
- paddlex/inference/components/llm/erniebot.py +212 -0
- paddlex/inference/components/paddle_predictor/__init__.py +20 -0
- paddlex/inference/components/paddle_predictor/predictor.py +332 -0
- paddlex/inference/components/retrieval/__init__.py +15 -0
- paddlex/inference/components/retrieval/faiss.py +359 -0
- paddlex/inference/components/task_related/__init__.py +33 -0
- paddlex/inference/components/task_related/clas.py +124 -0
- paddlex/inference/components/task_related/det.py +284 -0
- paddlex/inference/components/task_related/instance_seg.py +89 -0
- paddlex/inference/components/task_related/seal_det_warp.py +940 -0
- paddlex/inference/components/task_related/seg.py +40 -0
- paddlex/inference/components/task_related/table_rec.py +191 -0
- paddlex/inference/components/task_related/text_det.py +895 -0
- paddlex/inference/components/task_related/text_rec.py +353 -0
- paddlex/inference/components/task_related/warp.py +43 -0
- paddlex/inference/components/transforms/__init__.py +16 -0
- paddlex/inference/components/transforms/image/__init__.py +15 -0
- paddlex/inference/components/transforms/image/common.py +598 -0
- paddlex/inference/components/transforms/image/funcs.py +58 -0
- paddlex/inference/components/transforms/read_data.py +67 -0
- paddlex/inference/components/transforms/ts/__init__.py +15 -0
- paddlex/inference/components/transforms/ts/common.py +393 -0
- paddlex/inference/components/transforms/ts/funcs.py +424 -0
- paddlex/inference/models/__init__.py +106 -0
- paddlex/inference/models/anomaly_detection.py +87 -0
- paddlex/inference/models/base/__init__.py +16 -0
- paddlex/inference/models/base/base_predictor.py +76 -0
- paddlex/inference/models/base/basic_predictor.py +122 -0
- paddlex/inference/models/face_recognition.py +21 -0
- paddlex/inference/models/formula_recognition.py +55 -0
- paddlex/inference/models/general_recognition.py +99 -0
- paddlex/inference/models/image_classification.py +101 -0
- paddlex/inference/models/image_unwarping.py +43 -0
- paddlex/inference/models/instance_segmentation.py +66 -0
- paddlex/inference/models/multilabel_classification.py +33 -0
- paddlex/inference/models/object_detection.py +129 -0
- paddlex/inference/models/semantic_segmentation.py +86 -0
- paddlex/inference/models/table_recognition.py +106 -0
- paddlex/inference/models/text_detection.py +105 -0
- paddlex/inference/models/text_recognition.py +78 -0
- paddlex/inference/models/ts_ad.py +68 -0
- paddlex/inference/models/ts_cls.py +57 -0
- paddlex/inference/models/ts_fc.py +73 -0
- paddlex/inference/pipelines/__init__.py +127 -0
- paddlex/inference/pipelines/attribute_recognition.py +92 -0
- paddlex/inference/pipelines/base.py +86 -0
- paddlex/inference/pipelines/face_recognition.py +49 -0
- paddlex/inference/pipelines/formula_recognition.py +102 -0
- paddlex/inference/pipelines/layout_parsing/__init__.py +15 -0
- paddlex/inference/pipelines/layout_parsing/layout_parsing.py +362 -0
- paddlex/inference/pipelines/ocr.py +80 -0
- paddlex/inference/pipelines/pp_shitu_v2.py +152 -0
- paddlex/inference/pipelines/ppchatocrv3/__init__.py +15 -0
- paddlex/inference/pipelines/ppchatocrv3/ch_prompt.yaml +14 -0
- paddlex/inference/pipelines/ppchatocrv3/ppchatocrv3.py +717 -0
- paddlex/inference/pipelines/ppchatocrv3/utils.py +168 -0
- paddlex/inference/pipelines/seal_recognition.py +152 -0
- paddlex/inference/pipelines/serving/__init__.py +17 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/__init__.py +205 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/anomaly_detection.py +80 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/face_recognition.py +317 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/formula_recognition.py +119 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/image_classification.py +101 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/instance_segmentation.py +112 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/layout_parsing.py +205 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/multi_label_image_classification.py +90 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/object_detection.py +90 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/ocr.py +98 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/pedestrian_attribute_recognition.py +102 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/pp_shitu_v2.py +319 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/ppchatocrv3.py +445 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/seal_recognition.py +110 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/semantic_segmentation.py +82 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/small_object_detection.py +92 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/table_recognition.py +110 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/ts_ad.py +68 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/ts_cls.py +68 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/ts_fc.py +68 -0
- paddlex/inference/pipelines/serving/_pipeline_apps/vehicle_attribute_recognition.py +102 -0
- paddlex/inference/pipelines/serving/app.py +164 -0
- paddlex/inference/pipelines/serving/models.py +30 -0
- paddlex/inference/pipelines/serving/server.py +25 -0
- paddlex/inference/pipelines/serving/storage.py +161 -0
- paddlex/inference/pipelines/serving/utils.py +190 -0
- paddlex/inference/pipelines/single_model_pipeline.py +76 -0
- paddlex/inference/pipelines/table_recognition/__init__.py +15 -0
- paddlex/inference/pipelines/table_recognition/table_recognition.py +193 -0
- paddlex/inference/pipelines/table_recognition/utils.py +457 -0
- paddlex/inference/results/__init__.py +31 -0
- paddlex/inference/results/attribute_rec.py +89 -0
- paddlex/inference/results/base.py +43 -0
- paddlex/inference/results/chat_ocr.py +158 -0
- paddlex/inference/results/clas.py +133 -0
- paddlex/inference/results/det.py +86 -0
- paddlex/inference/results/face_rec.py +34 -0
- paddlex/inference/results/formula_rec.py +363 -0
- paddlex/inference/results/instance_seg.py +152 -0
- paddlex/inference/results/ocr.py +157 -0
- paddlex/inference/results/seal_rec.py +50 -0
- paddlex/inference/results/seg.py +72 -0
- paddlex/inference/results/shitu.py +35 -0
- paddlex/inference/results/table_rec.py +109 -0
- paddlex/inference/results/text_det.py +33 -0
- paddlex/inference/results/text_rec.py +66 -0
- paddlex/inference/results/ts.py +37 -0
- paddlex/inference/results/utils/__init__.py +13 -0
- paddlex/inference/results/utils/mixin.py +204 -0
- paddlex/inference/results/warp.py +31 -0
- paddlex/inference/utils/__init__.py +13 -0
- paddlex/inference/utils/benchmark.py +214 -0
- paddlex/inference/utils/color_map.py +123 -0
- paddlex/inference/utils/get_pipeline_path.py +26 -0
- paddlex/inference/utils/io/__init__.py +33 -0
- paddlex/inference/utils/io/readers.py +353 -0
- paddlex/inference/utils/io/style.py +374 -0
- paddlex/inference/utils/io/tablepyxl.py +149 -0
- paddlex/inference/utils/io/writers.py +376 -0
- paddlex/inference/utils/new_ir_blacklist.py +22 -0
- paddlex/inference/utils/official_models.py +286 -0
- paddlex/inference/utils/pp_option.py +236 -0
- paddlex/inference/utils/process_hook.py +54 -0
- paddlex/model.py +106 -0
- paddlex/modules/__init__.py +105 -0
- paddlex/modules/anomaly_detection/__init__.py +18 -0
- paddlex/modules/anomaly_detection/dataset_checker/__init__.py +95 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/analyse_dataset.py +79 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/check_dataset.py +87 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/convert_dataset.py +230 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/split_dataset.py +87 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/anomaly_detection/dataset_checker/dataset_src/utils/visualizer.py +71 -0
- paddlex/modules/anomaly_detection/evaluator.py +58 -0
- paddlex/modules/anomaly_detection/exportor.py +22 -0
- paddlex/modules/anomaly_detection/model_list.py +16 -0
- paddlex/modules/anomaly_detection/trainer.py +71 -0
- paddlex/modules/base/__init__.py +18 -0
- paddlex/modules/base/build_model.py +34 -0
- paddlex/modules/base/dataset_checker/__init__.py +16 -0
- paddlex/modules/base/dataset_checker/dataset_checker.py +164 -0
- paddlex/modules/base/dataset_checker/utils.py +110 -0
- paddlex/modules/base/evaluator.py +154 -0
- paddlex/modules/base/exportor.py +121 -0
- paddlex/modules/base/trainer.py +111 -0
- paddlex/modules/face_recognition/__init__.py +18 -0
- paddlex/modules/face_recognition/dataset_checker/__init__.py +71 -0
- paddlex/modules/face_recognition/dataset_checker/dataset_src/__init__.py +16 -0
- paddlex/modules/face_recognition/dataset_checker/dataset_src/check_dataset.py +174 -0
- paddlex/modules/face_recognition/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/face_recognition/dataset_checker/dataset_src/utils/visualizer.py +156 -0
- paddlex/modules/face_recognition/evaluator.py +52 -0
- paddlex/modules/face_recognition/exportor.py +22 -0
- paddlex/modules/face_recognition/model_list.py +15 -0
- paddlex/modules/face_recognition/trainer.py +97 -0
- paddlex/modules/formula_recognition/__init__.py +13 -0
- paddlex/modules/formula_recognition/model_list.py +17 -0
- paddlex/modules/general_recognition/__init__.py +18 -0
- paddlex/modules/general_recognition/dataset_checker/__init__.py +107 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/analyse_dataset.py +98 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/check_dataset.py +100 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/convert_dataset.py +99 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/split_dataset.py +82 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/general_recognition/dataset_checker/dataset_src/utils/visualizer.py +150 -0
- paddlex/modules/general_recognition/evaluator.py +31 -0
- paddlex/modules/general_recognition/exportor.py +22 -0
- paddlex/modules/general_recognition/model_list.py +19 -0
- paddlex/modules/general_recognition/trainer.py +52 -0
- paddlex/modules/image_classification/__init__.py +18 -0
- paddlex/modules/image_classification/dataset_checker/__init__.py +104 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/analyse_dataset.py +93 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/check_dataset.py +131 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/convert_dataset.py +51 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/split_dataset.py +81 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/image_classification/dataset_checker/dataset_src/utils/visualizer.py +156 -0
- paddlex/modules/image_classification/evaluator.py +43 -0
- paddlex/modules/image_classification/exportor.py +22 -0
- paddlex/modules/image_classification/model_list.py +97 -0
- paddlex/modules/image_classification/trainer.py +82 -0
- paddlex/modules/image_unwarping/__init__.py +13 -0
- paddlex/modules/image_unwarping/model_list.py +17 -0
- paddlex/modules/instance_segmentation/__init__.py +18 -0
- paddlex/modules/instance_segmentation/dataset_checker/__init__.py +93 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/analyse_dataset.py +78 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/check_dataset.py +92 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/convert_dataset.py +241 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/split_dataset.py +119 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/instance_segmentation/dataset_checker/dataset_src/utils/visualizer.py +221 -0
- paddlex/modules/instance_segmentation/evaluator.py +32 -0
- paddlex/modules/instance_segmentation/exportor.py +22 -0
- paddlex/modules/instance_segmentation/model_list.py +33 -0
- paddlex/modules/instance_segmentation/trainer.py +31 -0
- paddlex/modules/multilabel_classification/__init__.py +18 -0
- paddlex/modules/multilabel_classification/dataset_checker/__init__.py +106 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/analyse_dataset.py +95 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/check_dataset.py +131 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/convert_dataset.py +117 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/split_dataset.py +81 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/multilabel_classification/dataset_checker/dataset_src/utils/visualizer.py +153 -0
- paddlex/modules/multilabel_classification/evaluator.py +43 -0
- paddlex/modules/multilabel_classification/exportor.py +22 -0
- paddlex/modules/multilabel_classification/model_list.py +24 -0
- paddlex/modules/multilabel_classification/trainer.py +85 -0
- paddlex/modules/object_detection/__init__.py +18 -0
- paddlex/modules/object_detection/dataset_checker/__init__.py +115 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/analyse_dataset.py +80 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/check_dataset.py +86 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/convert_dataset.py +433 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/split_dataset.py +119 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/object_detection/dataset_checker/dataset_src/utils/visualizer.py +192 -0
- paddlex/modules/object_detection/evaluator.py +41 -0
- paddlex/modules/object_detection/exportor.py +22 -0
- paddlex/modules/object_detection/model_list.py +74 -0
- paddlex/modules/object_detection/trainer.py +85 -0
- paddlex/modules/semantic_segmentation/__init__.py +18 -0
- paddlex/modules/semantic_segmentation/dataset_checker/__init__.py +95 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/analyse_dataset.py +73 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/check_dataset.py +80 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/convert_dataset.py +162 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/split_dataset.py +87 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/utils/__init__.py +13 -0
- paddlex/modules/semantic_segmentation/dataset_checker/dataset_src/utils/visualizer.py +71 -0
- paddlex/modules/semantic_segmentation/evaluator.py +58 -0
- paddlex/modules/semantic_segmentation/exportor.py +22 -0
- paddlex/modules/semantic_segmentation/model_list.py +35 -0
- paddlex/modules/semantic_segmentation/trainer.py +71 -0
- paddlex/modules/table_recognition/__init__.py +18 -0
- paddlex/modules/table_recognition/dataset_checker/__init__.py +83 -0
- paddlex/modules/table_recognition/dataset_checker/dataset_src/__init__.py +18 -0
- paddlex/modules/table_recognition/dataset_checker/dataset_src/analyse_dataset.py +58 -0
- paddlex/modules/table_recognition/dataset_checker/dataset_src/check_dataset.py +87 -0
- paddlex/modules/table_recognition/dataset_checker/dataset_src/split_dataset.py +79 -0
- paddlex/modules/table_recognition/evaluator.py +43 -0
- paddlex/modules/table_recognition/exportor.py +22 -0
- paddlex/modules/table_recognition/model_list.py +19 -0
- paddlex/modules/table_recognition/trainer.py +70 -0
- paddlex/modules/text_detection/__init__.py +18 -0
- paddlex/modules/text_detection/dataset_checker/__init__.py +94 -0
- paddlex/modules/text_detection/dataset_checker/dataset_src/__init__.py +18 -0
- paddlex/modules/text_detection/dataset_checker/dataset_src/analyse_dataset.py +217 -0
- paddlex/modules/text_detection/dataset_checker/dataset_src/check_dataset.py +96 -0
- paddlex/modules/text_detection/dataset_checker/dataset_src/split_dataset.py +140 -0
- paddlex/modules/text_detection/evaluator.py +41 -0
- paddlex/modules/text_detection/exportor.py +22 -0
- paddlex/modules/text_detection/model_list.py +22 -0
- paddlex/modules/text_detection/trainer.py +68 -0
- paddlex/modules/text_recognition/__init__.py +18 -0
- paddlex/modules/text_recognition/dataset_checker/__init__.py +114 -0
- paddlex/modules/text_recognition/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/text_recognition/dataset_checker/dataset_src/analyse_dataset.py +161 -0
- paddlex/modules/text_recognition/dataset_checker/dataset_src/check_dataset.py +97 -0
- paddlex/modules/text_recognition/dataset_checker/dataset_src/convert_dataset.py +94 -0
- paddlex/modules/text_recognition/dataset_checker/dataset_src/split_dataset.py +81 -0
- paddlex/modules/text_recognition/evaluator.py +63 -0
- paddlex/modules/text_recognition/exportor.py +25 -0
- paddlex/modules/text_recognition/model_list.py +20 -0
- paddlex/modules/text_recognition/trainer.py +105 -0
- paddlex/modules/ts_anomaly_detection/__init__.py +19 -0
- paddlex/modules/ts_anomaly_detection/dataset_checker/__init__.py +97 -0
- paddlex/modules/ts_anomaly_detection/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/ts_anomaly_detection/dataset_checker/dataset_src/analyse_dataset.py +27 -0
- paddlex/modules/ts_anomaly_detection/dataset_checker/dataset_src/check_dataset.py +64 -0
- paddlex/modules/ts_anomaly_detection/dataset_checker/dataset_src/convert_dataset.py +78 -0
- paddlex/modules/ts_anomaly_detection/dataset_checker/dataset_src/split_dataset.py +63 -0
- paddlex/modules/ts_anomaly_detection/evaluator.py +67 -0
- paddlex/modules/ts_anomaly_detection/exportor.py +45 -0
- paddlex/modules/ts_anomaly_detection/model_list.py +22 -0
- paddlex/modules/ts_anomaly_detection/trainer.py +97 -0
- paddlex/modules/ts_classification/__init__.py +19 -0
- paddlex/modules/ts_classification/dataset_checker/__init__.py +97 -0
- paddlex/modules/ts_classification/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/ts_classification/dataset_checker/dataset_src/analyse_dataset.py +74 -0
- paddlex/modules/ts_classification/dataset_checker/dataset_src/check_dataset.py +64 -0
- paddlex/modules/ts_classification/dataset_checker/dataset_src/convert_dataset.py +78 -0
- paddlex/modules/ts_classification/dataset_checker/dataset_src/split_dataset.py +88 -0
- paddlex/modules/ts_classification/evaluator.py +66 -0
- paddlex/modules/ts_classification/exportor.py +45 -0
- paddlex/modules/ts_classification/model_list.py +18 -0
- paddlex/modules/ts_classification/trainer.py +92 -0
- paddlex/modules/ts_forecast/__init__.py +19 -0
- paddlex/modules/ts_forecast/dataset_checker/__init__.py +97 -0
- paddlex/modules/ts_forecast/dataset_checker/dataset_src/__init__.py +19 -0
- paddlex/modules/ts_forecast/dataset_checker/dataset_src/analyse_dataset.py +27 -0
- paddlex/modules/ts_forecast/dataset_checker/dataset_src/check_dataset.py +64 -0
- paddlex/modules/ts_forecast/dataset_checker/dataset_src/convert_dataset.py +77 -0
- paddlex/modules/ts_forecast/dataset_checker/dataset_src/split_dataset.py +63 -0
- paddlex/modules/ts_forecast/evaluator.py +66 -0
- paddlex/modules/ts_forecast/exportor.py +45 -0
- paddlex/modules/ts_forecast/model_list.py +24 -0
- paddlex/modules/ts_forecast/trainer.py +92 -0
- paddlex/paddlex_cli.py +197 -0
- paddlex/pipelines/OCR.yaml +8 -0
- paddlex/pipelines/PP-ChatOCRv3-doc.yaml +27 -0
- paddlex/pipelines/PP-ShiTuV2.yaml +13 -0
- paddlex/pipelines/anomaly_detection.yaml +7 -0
- paddlex/pipelines/face_recognition.yaml +13 -0
- paddlex/pipelines/formula_recognition.yaml +8 -0
- paddlex/pipelines/image_classification.yaml +7 -0
- paddlex/pipelines/instance_segmentation.yaml +7 -0
- paddlex/pipelines/layout_parsing.yaml +14 -0
- paddlex/pipelines/multi_label_image_classification.yaml +7 -0
- paddlex/pipelines/object_detection.yaml +7 -0
- paddlex/pipelines/pedestrian_attribute_recognition.yaml +7 -0
- paddlex/pipelines/seal_recognition.yaml +10 -0
- paddlex/pipelines/semantic_segmentation.yaml +7 -0
- paddlex/pipelines/small_object_detection.yaml +7 -0
- paddlex/pipelines/table_recognition.yaml +12 -0
- paddlex/pipelines/ts_ad.yaml +7 -0
- paddlex/pipelines/ts_cls.yaml +7 -0
- paddlex/pipelines/ts_fc.yaml +7 -0
- paddlex/pipelines/vehicle_attribute_recognition.yaml +7 -0
- paddlex/repo_apis/PaddleClas_api/__init__.py +17 -0
- paddlex/repo_apis/PaddleClas_api/cls/__init__.py +19 -0
- paddlex/repo_apis/PaddleClas_api/cls/config.py +594 -0
- paddlex/repo_apis/PaddleClas_api/cls/model.py +349 -0
- paddlex/repo_apis/PaddleClas_api/cls/register.py +890 -0
- paddlex/repo_apis/PaddleClas_api/cls/runner.py +219 -0
- paddlex/repo_apis/PaddleClas_api/shitu_rec/__init__.py +18 -0
- paddlex/repo_apis/PaddleClas_api/shitu_rec/config.py +141 -0
- paddlex/repo_apis/PaddleClas_api/shitu_rec/model.py +23 -0
- paddlex/repo_apis/PaddleClas_api/shitu_rec/register.py +68 -0
- paddlex/repo_apis/PaddleClas_api/shitu_rec/runner.py +55 -0
- paddlex/repo_apis/PaddleDetection_api/__init__.py +17 -0
- paddlex/repo_apis/PaddleDetection_api/config_helper.py +280 -0
- paddlex/repo_apis/PaddleDetection_api/instance_seg/__init__.py +18 -0
- paddlex/repo_apis/PaddleDetection_api/instance_seg/config.py +454 -0
- paddlex/repo_apis/PaddleDetection_api/instance_seg/model.py +397 -0
- paddlex/repo_apis/PaddleDetection_api/instance_seg/register.py +263 -0
- paddlex/repo_apis/PaddleDetection_api/instance_seg/runner.py +226 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/__init__.py +19 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/config.py +517 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/model.py +424 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/official_categories.py +139 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/register.py +927 -0
- paddlex/repo_apis/PaddleDetection_api/object_det/runner.py +226 -0
- paddlex/repo_apis/PaddleNLP_api/__init__.py +13 -0
- paddlex/repo_apis/PaddleOCR_api/__init__.py +20 -0
- paddlex/repo_apis/PaddleOCR_api/config_utils.py +53 -0
- paddlex/repo_apis/PaddleOCR_api/table_rec/__init__.py +16 -0
- paddlex/repo_apis/PaddleOCR_api/table_rec/config.py +64 -0
- paddlex/repo_apis/PaddleOCR_api/table_rec/model.py +126 -0
- paddlex/repo_apis/PaddleOCR_api/table_rec/register.py +53 -0
- paddlex/repo_apis/PaddleOCR_api/table_rec/runner.py +51 -0
- paddlex/repo_apis/PaddleOCR_api/text_det/__init__.py +16 -0
- paddlex/repo_apis/PaddleOCR_api/text_det/config.py +62 -0
- paddlex/repo_apis/PaddleOCR_api/text_det/model.py +72 -0
- paddlex/repo_apis/PaddleOCR_api/text_det/register.py +72 -0
- paddlex/repo_apis/PaddleOCR_api/text_det/runner.py +53 -0
- paddlex/repo_apis/PaddleOCR_api/text_rec/__init__.py +16 -0
- paddlex/repo_apis/PaddleOCR_api/text_rec/config.py +542 -0
- paddlex/repo_apis/PaddleOCR_api/text_rec/model.py +396 -0
- paddlex/repo_apis/PaddleOCR_api/text_rec/register.py +80 -0
- paddlex/repo_apis/PaddleOCR_api/text_rec/runner.py +240 -0
- paddlex/repo_apis/PaddleSeg_api/__init__.py +16 -0
- paddlex/repo_apis/PaddleSeg_api/base_seg_config.py +134 -0
- paddlex/repo_apis/PaddleSeg_api/seg/__init__.py +16 -0
- paddlex/repo_apis/PaddleSeg_api/seg/config.py +177 -0
- paddlex/repo_apis/PaddleSeg_api/seg/model.py +481 -0
- paddlex/repo_apis/PaddleSeg_api/seg/register.py +253 -0
- paddlex/repo_apis/PaddleSeg_api/seg/runner.py +262 -0
- paddlex/repo_apis/PaddleTS_api/__init__.py +19 -0
- paddlex/repo_apis/PaddleTS_api/ts_ad/__init__.py +16 -0
- paddlex/repo_apis/PaddleTS_api/ts_ad/config.py +89 -0
- paddlex/repo_apis/PaddleTS_api/ts_ad/register.py +146 -0
- paddlex/repo_apis/PaddleTS_api/ts_ad/runner.py +158 -0
- paddlex/repo_apis/PaddleTS_api/ts_base/__init__.py +13 -0
- paddlex/repo_apis/PaddleTS_api/ts_base/config.py +222 -0
- paddlex/repo_apis/PaddleTS_api/ts_base/model.py +272 -0
- paddlex/repo_apis/PaddleTS_api/ts_base/runner.py +158 -0
- paddlex/repo_apis/PaddleTS_api/ts_cls/__init__.py +16 -0
- paddlex/repo_apis/PaddleTS_api/ts_cls/config.py +73 -0
- paddlex/repo_apis/PaddleTS_api/ts_cls/register.py +59 -0
- paddlex/repo_apis/PaddleTS_api/ts_cls/runner.py +158 -0
- paddlex/repo_apis/PaddleTS_api/ts_fc/__init__.py +16 -0
- paddlex/repo_apis/PaddleTS_api/ts_fc/config.py +137 -0
- paddlex/repo_apis/PaddleTS_api/ts_fc/register.py +186 -0
- paddlex/repo_apis/__init__.py +13 -0
- paddlex/repo_apis/base/__init__.py +23 -0
- paddlex/repo_apis/base/config.py +238 -0
- paddlex/repo_apis/base/model.py +571 -0
- paddlex/repo_apis/base/register.py +135 -0
- paddlex/repo_apis/base/runner.py +390 -0
- paddlex/repo_apis/base/utils/__init__.py +13 -0
- paddlex/repo_apis/base/utils/arg.py +64 -0
- paddlex/repo_apis/base/utils/subprocess.py +107 -0
- paddlex/repo_manager/__init__.py +24 -0
- paddlex/repo_manager/core.py +271 -0
- paddlex/repo_manager/meta.py +143 -0
- paddlex/repo_manager/repo.py +396 -0
- paddlex/repo_manager/requirements.txt +18 -0
- paddlex/repo_manager/utils.py +298 -0
- paddlex/utils/__init__.py +1 -12
- paddlex/utils/cache.py +148 -0
- paddlex/utils/config.py +214 -0
- paddlex/utils/device.py +103 -0
- paddlex/utils/download.py +168 -182
- paddlex/utils/errors/__init__.py +17 -0
- paddlex/utils/errors/dataset_checker.py +78 -0
- paddlex/utils/errors/others.py +152 -0
- paddlex/utils/file_interface.py +212 -0
- paddlex/utils/flags.py +61 -0
- paddlex/utils/fonts/PingFang-SC-Regular.ttf +0 -0
- paddlex/utils/fonts/__init__.py +24 -0
- paddlex/utils/func_register.py +41 -0
- paddlex/utils/interactive_get_pipeline.py +55 -0
- paddlex/utils/lazy_loader.py +66 -0
- paddlex/utils/logging.py +132 -33
- paddlex/utils/misc.py +201 -0
- paddlex/utils/result_saver.py +59 -0
- paddlex/utils/subclass_register.py +101 -0
- paddlex/version.py +54 -0
- paddlex-3.0.0b2.dist-info/LICENSE +169 -0
- paddlex-3.0.0b2.dist-info/METADATA +760 -0
- paddlex-3.0.0b2.dist-info/RECORD +646 -0
- paddlex-3.0.0b2.dist-info/WHEEL +5 -0
- paddlex-3.0.0b2.dist-info/entry_points.txt +2 -0
- paddlex-3.0.0b2.dist-info/top_level.txt +1 -0
- PaddleClas/__init__.py +0 -16
- PaddleClas/paddleclas.py +0 -375
- PaddleClas/ppcls/__init__.py +0 -20
- PaddleClas/ppcls/data/__init__.py +0 -15
- PaddleClas/ppcls/data/imaug/__init__.py +0 -94
- PaddleClas/ppcls/data/imaug/autoaugment.py +0 -264
- PaddleClas/ppcls/data/imaug/batch_operators.py +0 -117
- PaddleClas/ppcls/data/imaug/cutout.py +0 -41
- PaddleClas/ppcls/data/imaug/fmix.py +0 -217
- PaddleClas/ppcls/data/imaug/grid.py +0 -89
- PaddleClas/ppcls/data/imaug/hide_and_seek.py +0 -44
- PaddleClas/ppcls/data/imaug/operators.py +0 -244
- PaddleClas/ppcls/data/imaug/randaugment.py +0 -106
- PaddleClas/ppcls/data/imaug/random_erasing.py +0 -55
- PaddleClas/ppcls/data/reader.py +0 -318
- PaddleClas/ppcls/modeling/__init__.py +0 -20
- PaddleClas/ppcls/modeling/architectures/__init__.py +0 -51
- PaddleClas/ppcls/modeling/architectures/alexnet.py +0 -132
- PaddleClas/ppcls/modeling/architectures/darknet.py +0 -161
- PaddleClas/ppcls/modeling/architectures/densenet.py +0 -308
- PaddleClas/ppcls/modeling/architectures/distillation_models.py +0 -65
- PaddleClas/ppcls/modeling/architectures/distilled_vision_transformer.py +0 -196
- PaddleClas/ppcls/modeling/architectures/dpn.py +0 -425
- PaddleClas/ppcls/modeling/architectures/efficientnet.py +0 -901
- PaddleClas/ppcls/modeling/architectures/ghostnet.py +0 -331
- PaddleClas/ppcls/modeling/architectures/googlenet.py +0 -207
- PaddleClas/ppcls/modeling/architectures/hrnet.py +0 -742
- PaddleClas/ppcls/modeling/architectures/inception_v3.py +0 -481
- PaddleClas/ppcls/modeling/architectures/inception_v4.py +0 -455
- PaddleClas/ppcls/modeling/architectures/mixnet.py +0 -782
- PaddleClas/ppcls/modeling/architectures/mobilenet_v1.py +0 -266
- PaddleClas/ppcls/modeling/architectures/mobilenet_v2.py +0 -248
- PaddleClas/ppcls/modeling/architectures/mobilenet_v3.py +0 -359
- PaddleClas/ppcls/modeling/architectures/regnet.py +0 -383
- PaddleClas/ppcls/modeling/architectures/repvgg.py +0 -339
- PaddleClas/ppcls/modeling/architectures/res2net.py +0 -272
- PaddleClas/ppcls/modeling/architectures/res2net_vd.py +0 -295
- PaddleClas/ppcls/modeling/architectures/resnest.py +0 -705
- PaddleClas/ppcls/modeling/architectures/resnet.py +0 -316
- PaddleClas/ppcls/modeling/architectures/resnet_vc.py +0 -309
- PaddleClas/ppcls/modeling/architectures/resnet_vd.py +0 -354
- PaddleClas/ppcls/modeling/architectures/resnext.py +0 -253
- PaddleClas/ppcls/modeling/architectures/resnext101_wsl.py +0 -447
- PaddleClas/ppcls/modeling/architectures/resnext_vd.py +0 -266
- PaddleClas/ppcls/modeling/architectures/rexnet.py +0 -240
- PaddleClas/ppcls/modeling/architectures/se_resnet_vd.py +0 -378
- PaddleClas/ppcls/modeling/architectures/se_resnext.py +0 -290
- PaddleClas/ppcls/modeling/architectures/se_resnext_vd.py +0 -285
- PaddleClas/ppcls/modeling/architectures/shufflenet_v2.py +0 -320
- PaddleClas/ppcls/modeling/architectures/squeezenet.py +0 -154
- PaddleClas/ppcls/modeling/architectures/vgg.py +0 -152
- PaddleClas/ppcls/modeling/architectures/vision_transformer.py +0 -402
- PaddleClas/ppcls/modeling/architectures/xception.py +0 -345
- PaddleClas/ppcls/modeling/architectures/xception_deeplab.py +0 -386
- PaddleClas/ppcls/modeling/loss.py +0 -154
- PaddleClas/ppcls/modeling/utils.py +0 -53
- PaddleClas/ppcls/optimizer/__init__.py +0 -19
- PaddleClas/ppcls/optimizer/learning_rate.py +0 -159
- PaddleClas/ppcls/optimizer/optimizer.py +0 -165
- PaddleClas/ppcls/utils/__init__.py +0 -27
- PaddleClas/ppcls/utils/check.py +0 -151
- PaddleClas/ppcls/utils/config.py +0 -201
- PaddleClas/ppcls/utils/logger.py +0 -120
- PaddleClas/ppcls/utils/metrics.py +0 -107
- PaddleClas/ppcls/utils/misc.py +0 -62
- PaddleClas/ppcls/utils/model_zoo.py +0 -213
- PaddleClas/ppcls/utils/save_load.py +0 -163
- PaddleClas/setup.py +0 -55
- PaddleClas/tools/__init__.py +0 -15
- PaddleClas/tools/download.py +0 -50
- PaddleClas/tools/ema.py +0 -58
- PaddleClas/tools/eval.py +0 -112
- PaddleClas/tools/export_model.py +0 -85
- PaddleClas/tools/export_serving_model.py +0 -76
- PaddleClas/tools/infer/__init__.py +0 -16
- PaddleClas/tools/infer/infer.py +0 -94
- PaddleClas/tools/infer/predict.py +0 -117
- PaddleClas/tools/infer/utils.py +0 -233
- PaddleClas/tools/program.py +0 -444
- PaddleClas/tools/test_hubserving.py +0 -113
- PaddleClas/tools/train.py +0 -141
- paddlex/cls.py +0 -76
- paddlex/command.py +0 -215
- paddlex/cv/__init__.py +0 -17
- paddlex/cv/datasets/__init__.py +0 -18
- paddlex/cv/datasets/coco.py +0 -169
- paddlex/cv/datasets/imagenet.py +0 -88
- paddlex/cv/datasets/seg_dataset.py +0 -91
- paddlex/cv/datasets/voc.py +0 -301
- paddlex/cv/models/__init__.py +0 -18
- paddlex/cv/models/base.py +0 -623
- paddlex/cv/models/classifier.py +0 -814
- paddlex/cv/models/detector.py +0 -1747
- paddlex/cv/models/load_model.py +0 -126
- paddlex/cv/models/segmenter.py +0 -673
- paddlex/cv/models/slim/__init__.py +0 -13
- paddlex/cv/models/slim/prune.py +0 -55
- paddlex/cv/models/utils/__init__.py +0 -13
- paddlex/cv/models/utils/det_metrics/__init__.py +0 -15
- paddlex/cv/models/utils/det_metrics/coco_utils.py +0 -217
- paddlex/cv/models/utils/det_metrics/metrics.py +0 -220
- paddlex/cv/models/utils/ema.py +0 -48
- paddlex/cv/models/utils/seg_metrics.py +0 -62
- paddlex/cv/models/utils/visualize.py +0 -394
- paddlex/cv/transforms/__init__.py +0 -46
- paddlex/cv/transforms/batch_operators.py +0 -286
- paddlex/cv/transforms/box_utils.py +0 -41
- paddlex/cv/transforms/functions.py +0 -193
- paddlex/cv/transforms/operators.py +0 -1402
- paddlex/det.py +0 -43
- paddlex/paddleseg/__init__.py +0 -17
- paddlex/paddleseg/core/__init__.py +0 -20
- paddlex/paddleseg/core/infer.py +0 -289
- paddlex/paddleseg/core/predict.py +0 -145
- paddlex/paddleseg/core/train.py +0 -258
- paddlex/paddleseg/core/val.py +0 -172
- paddlex/paddleseg/cvlibs/__init__.py +0 -17
- paddlex/paddleseg/cvlibs/callbacks.py +0 -279
- paddlex/paddleseg/cvlibs/config.py +0 -359
- paddlex/paddleseg/cvlibs/manager.py +0 -142
- paddlex/paddleseg/cvlibs/param_init.py +0 -91
- paddlex/paddleseg/datasets/__init__.py +0 -21
- paddlex/paddleseg/datasets/ade.py +0 -112
- paddlex/paddleseg/datasets/cityscapes.py +0 -86
- paddlex/paddleseg/datasets/cocostuff.py +0 -79
- paddlex/paddleseg/datasets/dataset.py +0 -164
- paddlex/paddleseg/datasets/mini_deep_globe_road_extraction.py +0 -95
- paddlex/paddleseg/datasets/optic_disc_seg.py +0 -97
- paddlex/paddleseg/datasets/pascal_context.py +0 -80
- paddlex/paddleseg/datasets/voc.py +0 -113
- paddlex/paddleseg/models/__init__.py +0 -39
- paddlex/paddleseg/models/ann.py +0 -436
- paddlex/paddleseg/models/attention_unet.py +0 -189
- paddlex/paddleseg/models/backbones/__init__.py +0 -18
- paddlex/paddleseg/models/backbones/hrnet.py +0 -815
- paddlex/paddleseg/models/backbones/mobilenetv3.py +0 -365
- paddlex/paddleseg/models/backbones/resnet_vd.py +0 -364
- paddlex/paddleseg/models/backbones/xception_deeplab.py +0 -415
- paddlex/paddleseg/models/bisenet.py +0 -311
- paddlex/paddleseg/models/danet.py +0 -220
- paddlex/paddleseg/models/decoupled_segnet.py +0 -233
- paddlex/paddleseg/models/deeplab.py +0 -258
- paddlex/paddleseg/models/dnlnet.py +0 -231
- paddlex/paddleseg/models/emanet.py +0 -219
- paddlex/paddleseg/models/fast_scnn.py +0 -318
- paddlex/paddleseg/models/fcn.py +0 -135
- paddlex/paddleseg/models/gcnet.py +0 -223
- paddlex/paddleseg/models/gscnn.py +0 -357
- paddlex/paddleseg/models/hardnet.py +0 -309
- paddlex/paddleseg/models/isanet.py +0 -202
- paddlex/paddleseg/models/layers/__init__.py +0 -19
- paddlex/paddleseg/models/layers/activation.py +0 -73
- paddlex/paddleseg/models/layers/attention.py +0 -146
- paddlex/paddleseg/models/layers/layer_libs.py +0 -168
- paddlex/paddleseg/models/layers/nonlocal2d.py +0 -155
- paddlex/paddleseg/models/layers/pyramid_pool.py +0 -182
- paddlex/paddleseg/models/losses/__init__.py +0 -27
- paddlex/paddleseg/models/losses/binary_cross_entropy_loss.py +0 -174
- paddlex/paddleseg/models/losses/bootstrapped_cross_entropy.py +0 -73
- paddlex/paddleseg/models/losses/cross_entropy_loss.py +0 -94
- paddlex/paddleseg/models/losses/decoupledsegnet_relax_boundary_loss.py +0 -129
- paddlex/paddleseg/models/losses/dice_loss.py +0 -61
- paddlex/paddleseg/models/losses/edge_attention_loss.py +0 -78
- paddlex/paddleseg/models/losses/gscnn_dual_task_loss.py +0 -141
- paddlex/paddleseg/models/losses/l1_loss.py +0 -76
- paddlex/paddleseg/models/losses/lovasz_loss.py +0 -222
- paddlex/paddleseg/models/losses/mean_square_error_loss.py +0 -65
- paddlex/paddleseg/models/losses/mixed_loss.py +0 -58
- paddlex/paddleseg/models/losses/ohem_cross_entropy_loss.py +0 -99
- paddlex/paddleseg/models/losses/ohem_edge_attention_loss.py +0 -114
- paddlex/paddleseg/models/ocrnet.py +0 -248
- paddlex/paddleseg/models/pspnet.py +0 -147
- paddlex/paddleseg/models/sfnet.py +0 -236
- paddlex/paddleseg/models/shufflenet_slim.py +0 -268
- paddlex/paddleseg/models/u2net.py +0 -574
- paddlex/paddleseg/models/unet.py +0 -155
- paddlex/paddleseg/models/unet_3plus.py +0 -316
- paddlex/paddleseg/models/unet_plusplus.py +0 -237
- paddlex/paddleseg/transforms/__init__.py +0 -16
- paddlex/paddleseg/transforms/functional.py +0 -161
- paddlex/paddleseg/transforms/transforms.py +0 -937
- paddlex/paddleseg/utils/__init__.py +0 -22
- paddlex/paddleseg/utils/config_check.py +0 -60
- paddlex/paddleseg/utils/download.py +0 -163
- paddlex/paddleseg/utils/env/__init__.py +0 -16
- paddlex/paddleseg/utils/env/seg_env.py +0 -56
- paddlex/paddleseg/utils/env/sys_env.py +0 -122
- paddlex/paddleseg/utils/logger.py +0 -48
- paddlex/paddleseg/utils/metrics.py +0 -146
- paddlex/paddleseg/utils/progbar.py +0 -212
- paddlex/paddleseg/utils/timer.py +0 -53
- paddlex/paddleseg/utils/utils.py +0 -120
- paddlex/paddleseg/utils/visualize.py +0 -90
- paddlex/ppcls/__init__.py +0 -20
- paddlex/ppcls/data/__init__.py +0 -15
- paddlex/ppcls/data/imaug/__init__.py +0 -94
- paddlex/ppcls/data/imaug/autoaugment.py +0 -264
- paddlex/ppcls/data/imaug/batch_operators.py +0 -117
- paddlex/ppcls/data/imaug/cutout.py +0 -41
- paddlex/ppcls/data/imaug/fmix.py +0 -217
- paddlex/ppcls/data/imaug/grid.py +0 -89
- paddlex/ppcls/data/imaug/hide_and_seek.py +0 -44
- paddlex/ppcls/data/imaug/operators.py +0 -256
- paddlex/ppcls/data/imaug/randaugment.py +0 -106
- paddlex/ppcls/data/imaug/random_erasing.py +0 -55
- paddlex/ppcls/data/reader.py +0 -318
- paddlex/ppcls/modeling/__init__.py +0 -20
- paddlex/ppcls/modeling/architectures/__init__.py +0 -51
- paddlex/ppcls/modeling/architectures/alexnet.py +0 -132
- paddlex/ppcls/modeling/architectures/darknet.py +0 -161
- paddlex/ppcls/modeling/architectures/densenet.py +0 -308
- paddlex/ppcls/modeling/architectures/distillation_models.py +0 -65
- paddlex/ppcls/modeling/architectures/distilled_vision_transformer.py +0 -196
- paddlex/ppcls/modeling/architectures/dpn.py +0 -425
- paddlex/ppcls/modeling/architectures/efficientnet.py +0 -901
- paddlex/ppcls/modeling/architectures/ghostnet.py +0 -331
- paddlex/ppcls/modeling/architectures/googlenet.py +0 -207
- paddlex/ppcls/modeling/architectures/hrnet.py +0 -742
- paddlex/ppcls/modeling/architectures/inception_v3.py +0 -541
- paddlex/ppcls/modeling/architectures/inception_v4.py +0 -455
- paddlex/ppcls/modeling/architectures/mixnet.py +0 -782
- paddlex/ppcls/modeling/architectures/mobilenet_v1.py +0 -266
- paddlex/ppcls/modeling/architectures/mobilenet_v2.py +0 -248
- paddlex/ppcls/modeling/architectures/mobilenet_v3.py +0 -359
- paddlex/ppcls/modeling/architectures/regnet.py +0 -383
- paddlex/ppcls/modeling/architectures/repvgg.py +0 -339
- paddlex/ppcls/modeling/architectures/res2net.py +0 -272
- paddlex/ppcls/modeling/architectures/res2net_vd.py +0 -295
- paddlex/ppcls/modeling/architectures/resnest.py +0 -705
- paddlex/ppcls/modeling/architectures/resnet.py +0 -317
- paddlex/ppcls/modeling/architectures/resnet_vc.py +0 -309
- paddlex/ppcls/modeling/architectures/resnet_vd.py +0 -354
- paddlex/ppcls/modeling/architectures/resnext.py +0 -259
- paddlex/ppcls/modeling/architectures/resnext101_wsl.py +0 -447
- paddlex/ppcls/modeling/architectures/resnext_vd.py +0 -266
- paddlex/ppcls/modeling/architectures/rexnet.py +0 -240
- paddlex/ppcls/modeling/architectures/se_resnet_vd.py +0 -378
- paddlex/ppcls/modeling/architectures/se_resnext.py +0 -290
- paddlex/ppcls/modeling/architectures/se_resnext_vd.py +0 -285
- paddlex/ppcls/modeling/architectures/shufflenet_v2.py +0 -320
- paddlex/ppcls/modeling/architectures/squeezenet.py +0 -154
- paddlex/ppcls/modeling/architectures/vgg.py +0 -152
- paddlex/ppcls/modeling/architectures/vision_transformer.py +0 -402
- paddlex/ppcls/modeling/architectures/xception.py +0 -345
- paddlex/ppcls/modeling/architectures/xception_deeplab.py +0 -386
- paddlex/ppcls/modeling/loss.py +0 -158
- paddlex/ppcls/modeling/utils.py +0 -53
- paddlex/ppcls/optimizer/__init__.py +0 -19
- paddlex/ppcls/optimizer/learning_rate.py +0 -159
- paddlex/ppcls/optimizer/optimizer.py +0 -165
- paddlex/ppcls/utils/__init__.py +0 -27
- paddlex/ppcls/utils/check.py +0 -151
- paddlex/ppcls/utils/config.py +0 -201
- paddlex/ppcls/utils/logger.py +0 -120
- paddlex/ppcls/utils/metrics.py +0 -112
- paddlex/ppcls/utils/misc.py +0 -62
- paddlex/ppcls/utils/model_zoo.py +0 -213
- paddlex/ppcls/utils/save_load.py +0 -163
- paddlex/ppdet/__init__.py +0 -16
- paddlex/ppdet/core/__init__.py +0 -15
- paddlex/ppdet/core/config/__init__.py +0 -13
- paddlex/ppdet/core/config/schema.py +0 -248
- paddlex/ppdet/core/config/yaml_helpers.py +0 -118
- paddlex/ppdet/core/workspace.py +0 -279
- paddlex/ppdet/data/__init__.py +0 -21
- paddlex/ppdet/data/reader.py +0 -304
- paddlex/ppdet/data/shm_utils.py +0 -67
- paddlex/ppdet/data/source/__init__.py +0 -27
- paddlex/ppdet/data/source/category.py +0 -823
- paddlex/ppdet/data/source/coco.py +0 -243
- paddlex/ppdet/data/source/dataset.py +0 -192
- paddlex/ppdet/data/source/keypoint_coco.py +0 -656
- paddlex/ppdet/data/source/mot.py +0 -360
- paddlex/ppdet/data/source/voc.py +0 -204
- paddlex/ppdet/data/source/widerface.py +0 -180
- paddlex/ppdet/data/transform/__init__.py +0 -28
- paddlex/ppdet/data/transform/autoaugment_utils.py +0 -1593
- paddlex/ppdet/data/transform/batch_operators.py +0 -758
- paddlex/ppdet/data/transform/gridmask_utils.py +0 -83
- paddlex/ppdet/data/transform/keypoint_operators.py +0 -665
- paddlex/ppdet/data/transform/mot_operators.py +0 -636
- paddlex/ppdet/data/transform/op_helper.py +0 -468
- paddlex/ppdet/data/transform/operators.py +0 -2103
- paddlex/ppdet/engine/__init__.py +0 -29
- paddlex/ppdet/engine/callbacks.py +0 -262
- paddlex/ppdet/engine/env.py +0 -47
- paddlex/ppdet/engine/export_utils.py +0 -118
- paddlex/ppdet/engine/tracker.py +0 -425
- paddlex/ppdet/engine/trainer.py +0 -535
- paddlex/ppdet/metrics/__init__.py +0 -23
- paddlex/ppdet/metrics/coco_utils.py +0 -184
- paddlex/ppdet/metrics/json_results.py +0 -151
- paddlex/ppdet/metrics/keypoint_metrics.py +0 -202
- paddlex/ppdet/metrics/map_utils.py +0 -396
- paddlex/ppdet/metrics/metrics.py +0 -300
- paddlex/ppdet/metrics/mot_eval_utils.py +0 -192
- paddlex/ppdet/metrics/mot_metrics.py +0 -184
- paddlex/ppdet/metrics/widerface_utils.py +0 -393
- paddlex/ppdet/model_zoo/__init__.py +0 -18
- paddlex/ppdet/model_zoo/model_zoo.py +0 -86
- paddlex/ppdet/model_zoo/tests/__init__.py +0 -13
- paddlex/ppdet/model_zoo/tests/test_get_model.py +0 -48
- paddlex/ppdet/model_zoo/tests/test_list_model.py +0 -68
- paddlex/ppdet/modeling/__init__.py +0 -41
- paddlex/ppdet/modeling/architectures/__init__.py +0 -40
- paddlex/ppdet/modeling/architectures/cascade_rcnn.py +0 -144
- paddlex/ppdet/modeling/architectures/centernet.py +0 -103
- paddlex/ppdet/modeling/architectures/deepsort.py +0 -111
- paddlex/ppdet/modeling/architectures/fairmot.py +0 -107
- paddlex/ppdet/modeling/architectures/faster_rcnn.py +0 -106
- paddlex/ppdet/modeling/architectures/fcos.py +0 -105
- paddlex/ppdet/modeling/architectures/jde.py +0 -125
- paddlex/ppdet/modeling/architectures/keypoint_hrhrnet.py +0 -286
- paddlex/ppdet/modeling/architectures/keypoint_hrnet.py +0 -203
- paddlex/ppdet/modeling/architectures/mask_rcnn.py +0 -135
- paddlex/ppdet/modeling/architectures/meta_arch.py +0 -45
- paddlex/ppdet/modeling/architectures/s2anet.py +0 -103
- paddlex/ppdet/modeling/architectures/solov2.py +0 -110
- paddlex/ppdet/modeling/architectures/ssd.py +0 -84
- paddlex/ppdet/modeling/architectures/ttfnet.py +0 -98
- paddlex/ppdet/modeling/architectures/yolo.py +0 -104
- paddlex/ppdet/modeling/backbones/__init__.py +0 -37
- paddlex/ppdet/modeling/backbones/blazenet.py +0 -322
- paddlex/ppdet/modeling/backbones/darknet.py +0 -341
- paddlex/ppdet/modeling/backbones/dla.py +0 -244
- paddlex/ppdet/modeling/backbones/ghostnet.py +0 -476
- paddlex/ppdet/modeling/backbones/hrnet.py +0 -724
- paddlex/ppdet/modeling/backbones/mobilenet_v1.py +0 -410
- paddlex/ppdet/modeling/backbones/mobilenet_v3.py +0 -497
- paddlex/ppdet/modeling/backbones/name_adapter.py +0 -69
- paddlex/ppdet/modeling/backbones/res2net.py +0 -358
- paddlex/ppdet/modeling/backbones/resnet.py +0 -606
- paddlex/ppdet/modeling/backbones/senet.py +0 -140
- paddlex/ppdet/modeling/backbones/vgg.py +0 -216
- paddlex/ppdet/modeling/bbox_utils.py +0 -464
- paddlex/ppdet/modeling/heads/__init__.py +0 -41
- paddlex/ppdet/modeling/heads/bbox_head.py +0 -379
- paddlex/ppdet/modeling/heads/cascade_head.py +0 -285
- paddlex/ppdet/modeling/heads/centernet_head.py +0 -194
- paddlex/ppdet/modeling/heads/face_head.py +0 -113
- paddlex/ppdet/modeling/heads/fcos_head.py +0 -270
- paddlex/ppdet/modeling/heads/keypoint_hrhrnet_head.py +0 -108
- paddlex/ppdet/modeling/heads/mask_head.py +0 -253
- paddlex/ppdet/modeling/heads/roi_extractor.py +0 -111
- paddlex/ppdet/modeling/heads/s2anet_head.py +0 -845
- paddlex/ppdet/modeling/heads/solov2_head.py +0 -537
- paddlex/ppdet/modeling/heads/ssd_head.py +0 -175
- paddlex/ppdet/modeling/heads/ttf_head.py +0 -314
- paddlex/ppdet/modeling/heads/yolo_head.py +0 -124
- paddlex/ppdet/modeling/keypoint_utils.py +0 -302
- paddlex/ppdet/modeling/layers.py +0 -1142
- paddlex/ppdet/modeling/losses/__init__.py +0 -35
- paddlex/ppdet/modeling/losses/ctfocal_loss.py +0 -67
- paddlex/ppdet/modeling/losses/fairmot_loss.py +0 -41
- paddlex/ppdet/modeling/losses/fcos_loss.py +0 -225
- paddlex/ppdet/modeling/losses/iou_aware_loss.py +0 -48
- paddlex/ppdet/modeling/losses/iou_loss.py +0 -210
- paddlex/ppdet/modeling/losses/jde_loss.py +0 -182
- paddlex/ppdet/modeling/losses/keypoint_loss.py +0 -228
- paddlex/ppdet/modeling/losses/solov2_loss.py +0 -101
- paddlex/ppdet/modeling/losses/ssd_loss.py +0 -163
- paddlex/ppdet/modeling/losses/yolo_loss.py +0 -212
- paddlex/ppdet/modeling/mot/__init__.py +0 -25
- paddlex/ppdet/modeling/mot/matching/__init__.py +0 -19
- paddlex/ppdet/modeling/mot/matching/deepsort_matching.py +0 -382
- paddlex/ppdet/modeling/mot/matching/jde_matching.py +0 -145
- paddlex/ppdet/modeling/mot/motion/__init__.py +0 -17
- paddlex/ppdet/modeling/mot/motion/kalman_filter.py +0 -270
- paddlex/ppdet/modeling/mot/tracker/__init__.py +0 -23
- paddlex/ppdet/modeling/mot/tracker/base_jde_tracker.py +0 -267
- paddlex/ppdet/modeling/mot/tracker/base_sde_tracker.py +0 -145
- paddlex/ppdet/modeling/mot/tracker/deepsort_tracker.py +0 -165
- paddlex/ppdet/modeling/mot/tracker/jde_tracker.py +0 -262
- paddlex/ppdet/modeling/mot/utils.py +0 -181
- paddlex/ppdet/modeling/mot/visualization.py +0 -130
- paddlex/ppdet/modeling/necks/__init__.py +0 -25
- paddlex/ppdet/modeling/necks/centernet_fpn.py +0 -185
- paddlex/ppdet/modeling/necks/fpn.py +0 -233
- paddlex/ppdet/modeling/necks/hrfpn.py +0 -131
- paddlex/ppdet/modeling/necks/ttf_fpn.py +0 -243
- paddlex/ppdet/modeling/necks/yolo_fpn.py +0 -1034
- paddlex/ppdet/modeling/ops.py +0 -1599
- paddlex/ppdet/modeling/post_process.py +0 -449
- paddlex/ppdet/modeling/proposal_generator/__init__.py +0 -2
- paddlex/ppdet/modeling/proposal_generator/anchor_generator.py +0 -135
- paddlex/ppdet/modeling/proposal_generator/proposal_generator.py +0 -81
- paddlex/ppdet/modeling/proposal_generator/rpn_head.py +0 -269
- paddlex/ppdet/modeling/proposal_generator/target.py +0 -671
- paddlex/ppdet/modeling/proposal_generator/target_layer.py +0 -476
- paddlex/ppdet/modeling/reid/__init__.py +0 -23
- paddlex/ppdet/modeling/reid/fairmot_embedding_head.py +0 -117
- paddlex/ppdet/modeling/reid/jde_embedding_head.py +0 -189
- paddlex/ppdet/modeling/reid/pyramidal_embedding.py +0 -151
- paddlex/ppdet/modeling/reid/resnet.py +0 -320
- paddlex/ppdet/modeling/shape_spec.py +0 -33
- paddlex/ppdet/modeling/tests/__init__.py +0 -13
- paddlex/ppdet/modeling/tests/test_architectures.py +0 -59
- paddlex/ppdet/modeling/tests/test_base.py +0 -75
- paddlex/ppdet/modeling/tests/test_ops.py +0 -839
- paddlex/ppdet/modeling/tests/test_yolov3_loss.py +0 -420
- paddlex/ppdet/optimizer.py +0 -285
- paddlex/ppdet/slim/__init__.py +0 -62
- paddlex/ppdet/slim/distill.py +0 -111
- paddlex/ppdet/slim/prune.py +0 -85
- paddlex/ppdet/slim/quant.py +0 -52
- paddlex/ppdet/utils/__init__.py +0 -13
- paddlex/ppdet/utils/check.py +0 -93
- paddlex/ppdet/utils/checkpoint.py +0 -216
- paddlex/ppdet/utils/cli.py +0 -151
- paddlex/ppdet/utils/colormap.py +0 -56
- paddlex/ppdet/utils/download.py +0 -477
- paddlex/ppdet/utils/logger.py +0 -71
- paddlex/ppdet/utils/stats.py +0 -95
- paddlex/ppdet/utils/visualizer.py +0 -292
- paddlex/ppdet/utils/voc_utils.py +0 -87
- paddlex/seg.py +0 -38
- paddlex/tools/__init__.py +0 -16
- paddlex/tools/convert.py +0 -52
- paddlex/tools/dataset_conversion/__init__.py +0 -24
- paddlex/tools/dataset_conversion/x2coco.py +0 -379
- paddlex/tools/dataset_conversion/x2imagenet.py +0 -82
- paddlex/tools/dataset_conversion/x2seg.py +0 -343
- paddlex/tools/dataset_conversion/x2voc.py +0 -230
- paddlex/tools/dataset_split/__init__.py +0 -23
- paddlex/tools/dataset_split/coco_split.py +0 -69
- paddlex/tools/dataset_split/imagenet_split.py +0 -75
- paddlex/tools/dataset_split/seg_split.py +0 -96
- paddlex/tools/dataset_split/utils.py +0 -75
- paddlex/tools/dataset_split/voc_split.py +0 -91
- paddlex/tools/split.py +0 -41
- paddlex/utils/checkpoint.py +0 -439
- paddlex/utils/env.py +0 -71
- paddlex/utils/shm.py +0 -67
- paddlex/utils/stats.py +0 -68
- paddlex/utils/utils.py +0 -140
- paddlex-2.0.0rc4.dist-info/LICENSE +0 -201
- paddlex-2.0.0rc4.dist-info/METADATA +0 -29
- paddlex-2.0.0rc4.dist-info/RECORD +0 -445
- paddlex-2.0.0rc4.dist-info/WHEEL +0 -5
- paddlex-2.0.0rc4.dist-info/entry_points.txt +0 -3
- paddlex-2.0.0rc4.dist-info/top_level.txt +0 -2
paddlex/cv/models/segmenter.py
DELETED
@@ -1,673 +0,0 @@
|
|
1
|
-
# Copyright (c) 2021 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
|
-
import math
|
16
|
-
import os.path as osp
|
17
|
-
import numpy as np
|
18
|
-
from collections import OrderedDict
|
19
|
-
import paddle
|
20
|
-
import paddle.nn.functional as F
|
21
|
-
from paddle.static import InputSpec
|
22
|
-
import paddlex.paddleseg as paddleseg
|
23
|
-
import paddlex
|
24
|
-
from paddlex.cv.transforms import arrange_transforms
|
25
|
-
from paddlex.utils import get_single_card_bs, DisablePrint
|
26
|
-
import paddlex.utils.logging as logging
|
27
|
-
from .base import BaseModel
|
28
|
-
from .utils import seg_metrics as metrics
|
29
|
-
from paddlex.utils.checkpoint import seg_pretrain_weights_dict
|
30
|
-
from paddlex.cv.transforms import Decode, Resize
|
31
|
-
|
32
|
-
__all__ = ["UNet", "DeepLabV3P", "FastSCNN", "HRNet", "BiSeNetV2"]
|
33
|
-
|
34
|
-
|
35
|
-
class BaseSegmenter(BaseModel):
|
36
|
-
def __init__(self,
|
37
|
-
model_name,
|
38
|
-
num_classes=2,
|
39
|
-
use_mixed_loss=False,
|
40
|
-
**params):
|
41
|
-
self.init_params = locals()
|
42
|
-
super(BaseSegmenter, self).__init__('segmenter')
|
43
|
-
if not hasattr(paddleseg.models, model_name):
|
44
|
-
raise Exception("ERROR: There's no model named {}.".format(
|
45
|
-
model_name))
|
46
|
-
self.model_name = model_name
|
47
|
-
self.num_classes = num_classes
|
48
|
-
self.use_mixed_loss = use_mixed_loss
|
49
|
-
self.losses = None
|
50
|
-
self.labels = None
|
51
|
-
self.net = self.build_net(**params)
|
52
|
-
self.find_unused_parameters = True
|
53
|
-
|
54
|
-
def build_net(self, **params):
|
55
|
-
# TODO: when using paddle.utils.unique_name.guard,
|
56
|
-
# DeepLabv3p and HRNet will raise a error
|
57
|
-
net = paddleseg.models.__dict__[self.model_name](
|
58
|
-
num_classes=self.num_classes, **params)
|
59
|
-
return net
|
60
|
-
|
61
|
-
def _fix_transforms_shape(self, image_shape):
|
62
|
-
if hasattr(self, 'test_transforms'):
|
63
|
-
if self.test_transforms is not None:
|
64
|
-
has_resize_op = False
|
65
|
-
resize_op_idx = -1
|
66
|
-
normalize_op_idx = len(self.test_transforms.transforms)
|
67
|
-
for idx, op in enumerate(self.test_transforms.transforms):
|
68
|
-
name = op.__class__.__name__
|
69
|
-
if name == 'Normalize':
|
70
|
-
normalize_op_idx = idx
|
71
|
-
if 'Resize' in name:
|
72
|
-
has_resize_op = True
|
73
|
-
resize_op_idx = idx
|
74
|
-
|
75
|
-
if not has_resize_op:
|
76
|
-
self.test_transforms.transforms.insert(
|
77
|
-
normalize_op_idx, Resize(target_size=image_shape))
|
78
|
-
else:
|
79
|
-
self.test_transforms.transforms[resize_op_idx] = Resize(
|
80
|
-
target_size=image_shape)
|
81
|
-
|
82
|
-
def _get_test_inputs(self, image_shape):
|
83
|
-
if image_shape is not None:
|
84
|
-
if len(image_shape) == 2:
|
85
|
-
image_shape = [1, 3] + image_shape
|
86
|
-
self._fix_transforms_shape(image_shape[-2:])
|
87
|
-
else:
|
88
|
-
image_shape = [None, 3, -1, -1]
|
89
|
-
self.fixed_input_shape = image_shape
|
90
|
-
input_spec = [
|
91
|
-
InputSpec(
|
92
|
-
shape=image_shape, name='image', dtype='float32')
|
93
|
-
]
|
94
|
-
return input_spec
|
95
|
-
|
96
|
-
def run(self, net, inputs, mode):
|
97
|
-
net_out = net(inputs[0])
|
98
|
-
logit = net_out[0]
|
99
|
-
outputs = OrderedDict()
|
100
|
-
if mode == 'test':
|
101
|
-
origin_shape = inputs[1]
|
102
|
-
score_map = self._postprocess(
|
103
|
-
logit, origin_shape, transforms=inputs[2])
|
104
|
-
label_map = paddle.argmax(
|
105
|
-
score_map, axis=1, keepdim=True, dtype='int32')
|
106
|
-
score_map = paddle.max(score_map, axis=1, keepdim=True)
|
107
|
-
score_map = paddle.squeeze(score_map)
|
108
|
-
label_map = paddle.squeeze(label_map)
|
109
|
-
outputs = {'label_map': label_map, 'score_map': score_map}
|
110
|
-
if mode == 'eval':
|
111
|
-
pred = paddle.argmax(logit, axis=1, keepdim=True, dtype='int32')
|
112
|
-
label = inputs[1]
|
113
|
-
origin_shape = [label.shape[-2:]]
|
114
|
-
# TODO: 替换cv2后postprocess移出run
|
115
|
-
pred = self._postprocess(pred, origin_shape, transforms=inputs[2])
|
116
|
-
intersect_area, pred_area, label_area = paddleseg.utils.metrics.calculate_area(
|
117
|
-
pred, label, self.num_classes)
|
118
|
-
outputs['intersect_area'] = intersect_area
|
119
|
-
outputs['pred_area'] = pred_area
|
120
|
-
outputs['label_area'] = label_area
|
121
|
-
outputs['conf_mat'] = metrics.confusion_matrix(pred, label,
|
122
|
-
self.num_classes)
|
123
|
-
if mode == 'train':
|
124
|
-
loss_list = metrics.loss_computation(
|
125
|
-
logits_list=net_out, labels=inputs[1], losses=self.losses)
|
126
|
-
loss = sum(loss_list)
|
127
|
-
outputs['loss'] = loss
|
128
|
-
return outputs
|
129
|
-
|
130
|
-
def default_loss(self):
|
131
|
-
if isinstance(self.use_mixed_loss, bool):
|
132
|
-
if self.use_mixed_loss:
|
133
|
-
losses = [
|
134
|
-
paddleseg.models.CrossEntropyLoss(),
|
135
|
-
paddleseg.models.LovaszSoftmaxLoss()
|
136
|
-
]
|
137
|
-
coef = [.8, .2]
|
138
|
-
loss_type = [
|
139
|
-
paddleseg.models.MixedLoss(
|
140
|
-
losses=losses, coef=coef),
|
141
|
-
]
|
142
|
-
else:
|
143
|
-
loss_type = [paddleseg.models.CrossEntropyLoss()]
|
144
|
-
else:
|
145
|
-
losses, coef = list(zip(*self.use_mixed_loss))
|
146
|
-
if not set(losses).issubset(
|
147
|
-
['CrossEntropyLoss', 'DiceLoss', 'LovaszSoftmaxLoss']):
|
148
|
-
raise ValueError(
|
149
|
-
"Only 'CrossEntropyLoss', 'DiceLoss', 'LovaszSoftmaxLoss' are supported."
|
150
|
-
)
|
151
|
-
losses = [getattr(paddleseg.models, loss)() for loss in losses]
|
152
|
-
loss_type = [
|
153
|
-
paddleseg.models.MixedLoss(
|
154
|
-
losses=losses, coef=list(coef))
|
155
|
-
]
|
156
|
-
if self.model_name == 'FastSCNN':
|
157
|
-
loss_type *= 2
|
158
|
-
loss_coef = [1.0, 0.4]
|
159
|
-
elif self.model_name == 'BiSeNetV2':
|
160
|
-
loss_type *= 5
|
161
|
-
loss_coef = [1.0] * 5
|
162
|
-
else:
|
163
|
-
loss_coef = [1.0]
|
164
|
-
losses = {'types': loss_type, 'coef': loss_coef}
|
165
|
-
return losses
|
166
|
-
|
167
|
-
def default_optimizer(self,
|
168
|
-
parameters,
|
169
|
-
learning_rate,
|
170
|
-
num_epochs,
|
171
|
-
num_steps_each_epoch,
|
172
|
-
lr_decay_power=0.9):
|
173
|
-
decay_step = num_epochs * num_steps_each_epoch
|
174
|
-
lr_scheduler = paddle.optimizer.lr.PolynomialDecay(
|
175
|
-
learning_rate, decay_step, end_lr=0, power=lr_decay_power)
|
176
|
-
optimizer = paddle.optimizer.Momentum(
|
177
|
-
learning_rate=lr_scheduler,
|
178
|
-
parameters=parameters,
|
179
|
-
momentum=0.9,
|
180
|
-
weight_decay=4e-5)
|
181
|
-
return optimizer
|
182
|
-
|
183
|
-
def train(self,
|
184
|
-
num_epochs,
|
185
|
-
train_dataset,
|
186
|
-
train_batch_size=2,
|
187
|
-
eval_dataset=None,
|
188
|
-
optimizer=None,
|
189
|
-
save_interval_epochs=1,
|
190
|
-
log_interval_steps=2,
|
191
|
-
save_dir='output',
|
192
|
-
pretrain_weights='CITYSCAPES',
|
193
|
-
learning_rate=0.01,
|
194
|
-
lr_decay_power=0.9,
|
195
|
-
early_stop=False,
|
196
|
-
early_stop_patience=5,
|
197
|
-
use_vdl=True,
|
198
|
-
resume_checkpoint=None):
|
199
|
-
"""
|
200
|
-
Train the model.
|
201
|
-
Args:
|
202
|
-
num_epochs(int): The number of epochs.
|
203
|
-
train_dataset(paddlex.dataset): Training dataset.
|
204
|
-
train_batch_size(int, optional): Total batch size among all cards used in training. Defaults to 2.
|
205
|
-
eval_dataset(paddlex.dataset, optional):
|
206
|
-
Evaluation dataset. If None, the model will not be evaluated furing training process. Defaults to None.
|
207
|
-
optimizer(paddle.optimizer.Optimizer or None, optional):
|
208
|
-
Optimizer used in training. If None, a default optimizer is used. Defaults to None.
|
209
|
-
save_interval_epochs(int, optional): Epoch interval for saving the model. Defaults to 1.
|
210
|
-
log_interval_steps(int, optional): Step interval for printing training information. Defaults to 10.
|
211
|
-
save_dir(str, optional): Directory to save the model. Defaults to 'output'.
|
212
|
-
pretrain_weights(str or None, optional):
|
213
|
-
None or name/path of pretrained weights. If None, no pretrained weights will be loaded. Defaults to 'CITYSCAPES'.
|
214
|
-
learning_rate(float, optional): Learning rate for training. Defaults to .025.
|
215
|
-
lr_decay_power(float, optional): Learning decay power. Defaults to .9.
|
216
|
-
early_stop(bool, optional): Whether to adopt early stop strategy. Defaults to False.
|
217
|
-
early_stop_patience(int, optional): Early stop patience. Defaults to 5.
|
218
|
-
use_vdl(bool, optional): Whether to use VisualDL to monitor the training process. Defaults to True.
|
219
|
-
resume_checkpoint(str or None, optional): The path of the checkpoint to resume training from.
|
220
|
-
If None, no training checkpoint will be resumed. At most one of `resume_checkpoint` and
|
221
|
-
`pretrain_weights` can be set simultaneously. Defaults to None.
|
222
|
-
|
223
|
-
"""
|
224
|
-
if pretrain_weights is not None and resume_checkpoint is not None:
|
225
|
-
logging.error(
|
226
|
-
"pretrain_weights and resume_checkpoint cannot be set simultaneously.",
|
227
|
-
exit=True)
|
228
|
-
self.labels = train_dataset.labels
|
229
|
-
if self.losses is None:
|
230
|
-
self.losses = self.default_loss()
|
231
|
-
|
232
|
-
if optimizer is None:
|
233
|
-
num_steps_each_epoch = train_dataset.num_samples // train_batch_size
|
234
|
-
self.optimizer = self.default_optimizer(
|
235
|
-
self.net.parameters(), learning_rate, num_epochs,
|
236
|
-
num_steps_each_epoch, lr_decay_power)
|
237
|
-
else:
|
238
|
-
self.optimizer = optimizer
|
239
|
-
|
240
|
-
if pretrain_weights is not None and not osp.exists(pretrain_weights):
|
241
|
-
if pretrain_weights not in seg_pretrain_weights_dict[
|
242
|
-
self.model_name]:
|
243
|
-
logging.warning(
|
244
|
-
"Path of pretrain_weights('{}') does not exist!".format(
|
245
|
-
pretrain_weights))
|
246
|
-
logging.warning("Pretrain_weights is forcibly set to '{}'. "
|
247
|
-
"If don't want to use pretrain weights, "
|
248
|
-
"set pretrain_weights to be None.".format(
|
249
|
-
seg_pretrain_weights_dict[self.model_name][
|
250
|
-
0]))
|
251
|
-
pretrain_weights = seg_pretrain_weights_dict[self.model_name][
|
252
|
-
0]
|
253
|
-
elif pretrain_weights is not None and osp.exists(pretrain_weights):
|
254
|
-
if osp.splitext(pretrain_weights)[-1] != '.pdparams':
|
255
|
-
logging.error(
|
256
|
-
"Invalid pretrain weights. Please specify a '.pdparams' file.",
|
257
|
-
exit=True)
|
258
|
-
pretrained_dir = osp.join(save_dir, 'pretrain')
|
259
|
-
is_backbone_weights = pretrain_weights == 'IMAGENET'
|
260
|
-
self.net_initialize(
|
261
|
-
pretrain_weights=pretrain_weights,
|
262
|
-
save_dir=pretrained_dir,
|
263
|
-
resume_checkpoint=resume_checkpoint,
|
264
|
-
is_backbone_weights=is_backbone_weights)
|
265
|
-
|
266
|
-
self.train_loop(
|
267
|
-
num_epochs=num_epochs,
|
268
|
-
train_dataset=train_dataset,
|
269
|
-
train_batch_size=train_batch_size,
|
270
|
-
eval_dataset=eval_dataset,
|
271
|
-
save_interval_epochs=save_interval_epochs,
|
272
|
-
log_interval_steps=log_interval_steps,
|
273
|
-
save_dir=save_dir,
|
274
|
-
early_stop=early_stop,
|
275
|
-
early_stop_patience=early_stop_patience,
|
276
|
-
use_vdl=use_vdl)
|
277
|
-
|
278
|
-
def quant_aware_train(self,
|
279
|
-
num_epochs,
|
280
|
-
train_dataset,
|
281
|
-
train_batch_size=2,
|
282
|
-
eval_dataset=None,
|
283
|
-
optimizer=None,
|
284
|
-
save_interval_epochs=1,
|
285
|
-
log_interval_steps=2,
|
286
|
-
save_dir='output',
|
287
|
-
learning_rate=0.0001,
|
288
|
-
lr_decay_power=0.9,
|
289
|
-
early_stop=False,
|
290
|
-
early_stop_patience=5,
|
291
|
-
use_vdl=True,
|
292
|
-
resume_checkpoint=None,
|
293
|
-
quant_config=None):
|
294
|
-
"""
|
295
|
-
Quantization-aware training.
|
296
|
-
Args:
|
297
|
-
num_epochs(int): The number of epochs.
|
298
|
-
train_dataset(paddlex.dataset): Training dataset.
|
299
|
-
train_batch_size(int, optional): Total batch size among all cards used in training. Defaults to 2.
|
300
|
-
eval_dataset(paddlex.dataset, optional):
|
301
|
-
Evaluation dataset. If None, the model will not be evaluated furing training process. Defaults to None.
|
302
|
-
optimizer(paddle.optimizer.Optimizer or None, optional):
|
303
|
-
Optimizer used in training. If None, a default optimizer is used. Defaults to None.
|
304
|
-
save_interval_epochs(int, optional): Epoch interval for saving the model. Defaults to 1.
|
305
|
-
log_interval_steps(int, optional): Step interval for printing training information. Defaults to 10.
|
306
|
-
save_dir(str, optional): Directory to save the model. Defaults to 'output'.
|
307
|
-
learning_rate(float, optional): Learning rate for training. Defaults to .025.
|
308
|
-
lr_decay_power(float, optional): Learning decay power. Defaults to .9.
|
309
|
-
early_stop(bool, optional): Whether to adopt early stop strategy. Defaults to False.
|
310
|
-
early_stop_patience(int, optional): Early stop patience. Defaults to 5.
|
311
|
-
use_vdl(bool, optional): Whether to use VisualDL to monitor the training process. Defaults to True.
|
312
|
-
quant_config(dict or None, optional): Quantization configuration. If None, a default rule of thumb
|
313
|
-
configuration will be used. Defaults to None.
|
314
|
-
resume_checkpoint(str or None, optional): The path of the checkpoint to resume quantization-aware training
|
315
|
-
from. If None, no training checkpoint will be resumed. Defaults to None.
|
316
|
-
|
317
|
-
"""
|
318
|
-
self._prepare_qat(quant_config)
|
319
|
-
self.train(
|
320
|
-
num_epochs=num_epochs,
|
321
|
-
train_dataset=train_dataset,
|
322
|
-
train_batch_size=train_batch_size,
|
323
|
-
eval_dataset=eval_dataset,
|
324
|
-
optimizer=optimizer,
|
325
|
-
save_interval_epochs=save_interval_epochs,
|
326
|
-
log_interval_steps=log_interval_steps,
|
327
|
-
save_dir=save_dir,
|
328
|
-
pretrain_weights=None,
|
329
|
-
learning_rate=learning_rate,
|
330
|
-
lr_decay_power=lr_decay_power,
|
331
|
-
early_stop=early_stop,
|
332
|
-
early_stop_patience=early_stop_patience,
|
333
|
-
use_vdl=use_vdl,
|
334
|
-
resume_checkpoint=resume_checkpoint)
|
335
|
-
|
336
|
-
def evaluate(self, eval_dataset, batch_size=1, return_details=False):
|
337
|
-
"""
|
338
|
-
Evaluate the model.
|
339
|
-
Args:
|
340
|
-
eval_dataset(paddlex.dataset): Evaluation dataset.
|
341
|
-
batch_size(int, optional): Total batch size among all cards used for evaluation. Defaults to 1.
|
342
|
-
return_details(bool, optional): Whether to return evaluation details. Defaults to False.
|
343
|
-
|
344
|
-
Returns:
|
345
|
-
collections.OrderedDict with key-value pairs:
|
346
|
-
{"miou": `mean intersection over union`,
|
347
|
-
"category_iou": `category-wise mean intersection over union`,
|
348
|
-
"oacc": `overall accuracy`,
|
349
|
-
"category_acc": `category-wise accuracy`,
|
350
|
-
"kappa": ` kappa coefficient`,
|
351
|
-
"category_F1-score": `F1 score`}.
|
352
|
-
|
353
|
-
"""
|
354
|
-
arrange_transforms(
|
355
|
-
model_type=self.model_type,
|
356
|
-
transforms=eval_dataset.transforms,
|
357
|
-
mode='eval')
|
358
|
-
|
359
|
-
self.net.eval()
|
360
|
-
nranks = paddle.distributed.get_world_size()
|
361
|
-
local_rank = paddle.distributed.get_rank()
|
362
|
-
if nranks > 1:
|
363
|
-
# Initialize parallel environment if not done.
|
364
|
-
if not paddle.distributed.parallel.parallel_helper._is_parallel_ctx_initialized(
|
365
|
-
):
|
366
|
-
paddle.distributed.init_parallel_env()
|
367
|
-
|
368
|
-
batch_size_each_card = get_single_card_bs(batch_size)
|
369
|
-
if batch_size_each_card > 1:
|
370
|
-
batch_size_each_card = 1
|
371
|
-
batch_size = batch_size_each_card * paddlex.env_info['num']
|
372
|
-
logging.warning(
|
373
|
-
"Segmenter only supports batch_size=1 for each gpu/cpu card " \
|
374
|
-
"during evaluation, so batch_size " \
|
375
|
-
"is forcibly set to {}.".format(batch_size))
|
376
|
-
self.eval_data_loader = self.build_data_loader(
|
377
|
-
eval_dataset, batch_size=batch_size, mode='eval')
|
378
|
-
|
379
|
-
intersect_area_all = 0
|
380
|
-
pred_area_all = 0
|
381
|
-
label_area_all = 0
|
382
|
-
conf_mat_all = []
|
383
|
-
logging.info(
|
384
|
-
"Start to evaluate(total_samples={}, total_steps={})...".format(
|
385
|
-
eval_dataset.num_samples,
|
386
|
-
math.ceil(eval_dataset.num_samples * 1.0 / batch_size)))
|
387
|
-
with paddle.no_grad():
|
388
|
-
for step, data in enumerate(self.eval_data_loader):
|
389
|
-
data.append(eval_dataset.transforms.transforms)
|
390
|
-
outputs = self.run(self.net, data, 'eval')
|
391
|
-
pred_area = outputs['pred_area']
|
392
|
-
label_area = outputs['label_area']
|
393
|
-
intersect_area = outputs['intersect_area']
|
394
|
-
conf_mat = outputs['conf_mat']
|
395
|
-
|
396
|
-
# Gather from all ranks
|
397
|
-
if nranks > 1:
|
398
|
-
intersect_area_list = []
|
399
|
-
pred_area_list = []
|
400
|
-
label_area_list = []
|
401
|
-
conf_mat_list = []
|
402
|
-
paddle.distributed.all_gather(intersect_area_list,
|
403
|
-
intersect_area)
|
404
|
-
paddle.distributed.all_gather(pred_area_list, pred_area)
|
405
|
-
paddle.distributed.all_gather(label_area_list, label_area)
|
406
|
-
paddle.distributed.all_gather(conf_mat_list, conf_mat)
|
407
|
-
|
408
|
-
# Some image has been evaluated and should be eliminated in last iter
|
409
|
-
if (step + 1) * nranks > len(eval_dataset):
|
410
|
-
valid = len(eval_dataset) - step * nranks
|
411
|
-
intersect_area_list = intersect_area_list[:valid]
|
412
|
-
pred_area_list = pred_area_list[:valid]
|
413
|
-
label_area_list = label_area_list[:valid]
|
414
|
-
conf_mat_list = conf_mat_list[:valid]
|
415
|
-
|
416
|
-
intersect_area_all += sum(intersect_area_list)
|
417
|
-
pred_area_all += sum(pred_area_list)
|
418
|
-
label_area_all += sum(label_area_list)
|
419
|
-
conf_mat_all.extend(conf_mat_list)
|
420
|
-
|
421
|
-
else:
|
422
|
-
intersect_area_all = intersect_area_all + intersect_area
|
423
|
-
pred_area_all = pred_area_all + pred_area
|
424
|
-
label_area_all = label_area_all + label_area
|
425
|
-
conf_mat_all.append(conf_mat)
|
426
|
-
class_iou, miou = paddleseg.utils.metrics.mean_iou(
|
427
|
-
intersect_area_all, pred_area_all, label_area_all)
|
428
|
-
# TODO 确认是按oacc还是macc
|
429
|
-
class_acc, oacc = paddleseg.utils.metrics.accuracy(intersect_area_all,
|
430
|
-
pred_area_all)
|
431
|
-
kappa = paddleseg.utils.metrics.kappa(intersect_area_all,
|
432
|
-
pred_area_all, label_area_all)
|
433
|
-
category_f1score = metrics.f1_score(intersect_area_all, pred_area_all,
|
434
|
-
label_area_all)
|
435
|
-
eval_metrics = OrderedDict(
|
436
|
-
zip([
|
437
|
-
'miou', 'category_iou', 'oacc', 'category_acc', 'kappa',
|
438
|
-
'category_F1-score'
|
439
|
-
], [miou, class_iou, oacc, class_acc, kappa, category_f1score]))
|
440
|
-
|
441
|
-
if return_details:
|
442
|
-
conf_mat = sum(conf_mat_all)
|
443
|
-
eval_details = {'confusion_matrix': conf_mat.tolist()}
|
444
|
-
return eval_metrics, eval_details
|
445
|
-
return eval_metrics
|
446
|
-
|
447
|
-
def predict(self, img_file, transforms=None):
|
448
|
-
"""
|
449
|
-
Do inference.
|
450
|
-
Args:
|
451
|
-
Args:
|
452
|
-
img_file(List[np.ndarray or str], str or np.ndarray): img_file(list or str or np.array):
|
453
|
-
Image path or decoded image data in a BGR format, which also could constitute a list,
|
454
|
-
meaning all images to be predicted as a mini-batch.
|
455
|
-
transforms(paddlex.transforms.Compose or None, optional):
|
456
|
-
Transforms for inputs. If None, the transforms for evaluation process will be used. Defaults to None.
|
457
|
-
|
458
|
-
Returns:
|
459
|
-
If img_file is a string or np.array, the result is a dict with key-value pairs:
|
460
|
-
{"label map": `label map`, "score_map": `score map`}.
|
461
|
-
If img_file is a list, the result is a list composed of dicts with the corresponding fields:
|
462
|
-
label_map(np.ndarray): the predicted label map
|
463
|
-
score_map(np.ndarray): the prediction score map
|
464
|
-
|
465
|
-
"""
|
466
|
-
if transforms is None and not hasattr(self, 'test_transforms'):
|
467
|
-
raise Exception("transforms need to be defined, now is None.")
|
468
|
-
if transforms is None:
|
469
|
-
transforms = self.test_transforms
|
470
|
-
if isinstance(img_file, (str, np.ndarray)):
|
471
|
-
images = [img_file]
|
472
|
-
else:
|
473
|
-
images = img_file
|
474
|
-
batch_im, batch_origin_shape = self._preprocess(images, transforms,
|
475
|
-
self.model_type)
|
476
|
-
self.net.eval()
|
477
|
-
data = (batch_im, batch_origin_shape, transforms.transforms)
|
478
|
-
outputs = self.run(self.net, data, 'test')
|
479
|
-
label_map = outputs['label_map']
|
480
|
-
label_map = label_map.numpy().astype('uint8')
|
481
|
-
score_map = outputs['score_map']
|
482
|
-
score_map = score_map.numpy().astype('float32')
|
483
|
-
if isinstance(img_file, list) and len(img_file) > 1:
|
484
|
-
prediction = [{
|
485
|
-
'label_map': l,
|
486
|
-
'score_map': s
|
487
|
-
} for l, s in zip(label_map, score_map)]
|
488
|
-
elif isinstance(img_file, list):
|
489
|
-
prediction = [{'label_map': label_map, 'score_map': score_map}]
|
490
|
-
else:
|
491
|
-
prediction = {'label_map': label_map, 'score_map': score_map}
|
492
|
-
return prediction
|
493
|
-
|
494
|
-
def _preprocess(self, images, transforms, model_type):
|
495
|
-
arrange_transforms(
|
496
|
-
model_type=model_type, transforms=transforms, mode='test')
|
497
|
-
batch_im = list()
|
498
|
-
batch_ori_shape = list()
|
499
|
-
for im in images:
|
500
|
-
sample = {'image': im}
|
501
|
-
if isinstance(sample['image'], str):
|
502
|
-
sample = Decode(to_rgb=False)(sample)
|
503
|
-
ori_shape = sample['image'].shape[:2]
|
504
|
-
im = transforms(sample)[0]
|
505
|
-
batch_im.append(im)
|
506
|
-
batch_ori_shape.append(ori_shape)
|
507
|
-
batch_im = paddle.to_tensor(batch_im)
|
508
|
-
|
509
|
-
return batch_im, batch_ori_shape
|
510
|
-
|
511
|
-
@staticmethod
|
512
|
-
def get_transforms_shape_info(batch_ori_shape, transforms):
|
513
|
-
batch_restore_list = list()
|
514
|
-
for ori_shape in batch_ori_shape:
|
515
|
-
restore_list = list()
|
516
|
-
h, w = ori_shape[0], ori_shape[1]
|
517
|
-
for op in transforms:
|
518
|
-
if op.__class__.__name__ == 'Resize':
|
519
|
-
restore_list.append(('resize', (h, w)))
|
520
|
-
h, w = op.target_size
|
521
|
-
elif op.__class__.__name__ == 'ResizeByShort':
|
522
|
-
restore_list.append(('resize', (h, w)))
|
523
|
-
im_short_size = min(h, w)
|
524
|
-
im_long_size = max(h, w)
|
525
|
-
scale = float(op.short_size) / float(im_short_size)
|
526
|
-
if 0 < op.max_size < np.round(scale * im_long_size):
|
527
|
-
scale = float(op.max_size) / float(im_long_size)
|
528
|
-
h = int(round(h * scale))
|
529
|
-
w = int(round(w * scale))
|
530
|
-
elif op.__class__.__name__ == 'ResizeByLong':
|
531
|
-
restore_list.append(('resize', (h, w)))
|
532
|
-
im_long_size = max(h, w)
|
533
|
-
scale = float(op.long_size) / float(im_long_size)
|
534
|
-
h = int(round(h * scale))
|
535
|
-
w = int(round(w * scale))
|
536
|
-
elif op.__class__.__name__ == 'Padding':
|
537
|
-
if op.target_size:
|
538
|
-
target_h, target_w = op.target_size
|
539
|
-
else:
|
540
|
-
target_h = int(
|
541
|
-
(np.ceil(h / op.size_divisor) * op.size_divisor))
|
542
|
-
target_w = int(
|
543
|
-
(np.ceil(w / op.size_divisor) * op.size_divisor))
|
544
|
-
|
545
|
-
if op.pad_mode == -1:
|
546
|
-
offsets = op.offsets
|
547
|
-
elif op.pad_mode == 0:
|
548
|
-
offsets = [0, 0]
|
549
|
-
elif op.pad_mode == 1:
|
550
|
-
offsets = [(target_h - h) // 2, (target_w - w) // 2]
|
551
|
-
else:
|
552
|
-
offsets = [target_h - h, target_w - w]
|
553
|
-
restore_list.append(('padding', (h, w), offsets))
|
554
|
-
h, w = target_h, target_w
|
555
|
-
|
556
|
-
batch_restore_list.append(restore_list)
|
557
|
-
return batch_restore_list
|
558
|
-
|
559
|
-
def _postprocess(self, batch_pred, batch_origin_shape, transforms):
|
560
|
-
batch_restore_list = BaseSegmenter.get_transforms_shape_info(
|
561
|
-
batch_origin_shape, transforms)
|
562
|
-
results = list()
|
563
|
-
for pred, restore_list in zip(batch_pred, batch_restore_list):
|
564
|
-
pred = paddle.unsqueeze(pred, axis=0)
|
565
|
-
for item in restore_list[::-1]:
|
566
|
-
# TODO: 替换成cv2的interpolate(部署阶段无法使用paddle op)
|
567
|
-
h, w = item[1][0], item[1][1]
|
568
|
-
if item[0] == 'resize':
|
569
|
-
pred = F.interpolate(pred, (h, w), mode='nearest')
|
570
|
-
elif item[0] == 'padding':
|
571
|
-
x, y = item[2]
|
572
|
-
pred = pred[:, :, y:y + h, x:x + w]
|
573
|
-
else:
|
574
|
-
pass
|
575
|
-
results.append(pred)
|
576
|
-
batch_pred = paddle.concat(results, axis=0)
|
577
|
-
return batch_pred
|
578
|
-
|
579
|
-
|
580
|
-
class UNet(BaseSegmenter):
|
581
|
-
def __init__(self,
|
582
|
-
num_classes=2,
|
583
|
-
use_mixed_loss=False,
|
584
|
-
use_deconv=False,
|
585
|
-
align_corners=False):
|
586
|
-
params = {'use_deconv': use_deconv, 'align_corners': align_corners}
|
587
|
-
super(UNet, self).__init__(
|
588
|
-
model_name='UNet',
|
589
|
-
num_classes=num_classes,
|
590
|
-
use_mixed_loss=use_mixed_loss,
|
591
|
-
**params)
|
592
|
-
|
593
|
-
|
594
|
-
class DeepLabV3P(BaseSegmenter):
|
595
|
-
def __init__(self,
|
596
|
-
num_classes=2,
|
597
|
-
backbone='ResNet50_vd',
|
598
|
-
use_mixed_loss=False,
|
599
|
-
output_stride=8,
|
600
|
-
backbone_indices=(0, 3),
|
601
|
-
aspp_ratios=(1, 12, 24, 36),
|
602
|
-
aspp_out_channels=256,
|
603
|
-
align_corners=False):
|
604
|
-
self.backbone_name = backbone
|
605
|
-
if backbone not in ['ResNet50_vd', 'ResNet101_vd']:
|
606
|
-
raise ValueError(
|
607
|
-
"backbone: {} is not supported. Please choose one of "
|
608
|
-
"('ResNet50_vd', 'ResNet101_vd')".format(backbone))
|
609
|
-
with DisablePrint():
|
610
|
-
backbone = getattr(paddleseg.models, backbone)(
|
611
|
-
output_stride=output_stride)
|
612
|
-
params = {
|
613
|
-
'backbone': backbone,
|
614
|
-
'backbone_indices': backbone_indices,
|
615
|
-
'aspp_ratios': aspp_ratios,
|
616
|
-
'aspp_out_channels': aspp_out_channels,
|
617
|
-
'align_corners': align_corners
|
618
|
-
}
|
619
|
-
super(DeepLabV3P, self).__init__(
|
620
|
-
model_name='DeepLabV3P',
|
621
|
-
num_classes=num_classes,
|
622
|
-
use_mixed_loss=use_mixed_loss,
|
623
|
-
**params)
|
624
|
-
|
625
|
-
|
626
|
-
class FastSCNN(BaseSegmenter):
|
627
|
-
def __init__(self,
|
628
|
-
num_classes=2,
|
629
|
-
use_mixed_loss=False,
|
630
|
-
align_corners=False):
|
631
|
-
params = {'align_corners': align_corners}
|
632
|
-
super(FastSCNN, self).__init__(
|
633
|
-
model_name='FastSCNN',
|
634
|
-
num_classes=num_classes,
|
635
|
-
use_mixed_loss=use_mixed_loss,
|
636
|
-
**params)
|
637
|
-
|
638
|
-
|
639
|
-
class HRNet(BaseSegmenter):
|
640
|
-
def __init__(self,
|
641
|
-
num_classes=2,
|
642
|
-
width=48,
|
643
|
-
use_mixed_loss=False,
|
644
|
-
align_corners=False):
|
645
|
-
if width not in (18, 48):
|
646
|
-
raise ValueError(
|
647
|
-
"width={} is not supported, please choose from [18, 48]".
|
648
|
-
format(width))
|
649
|
-
self.backbone_name = 'HRNet_W{}'.format(width)
|
650
|
-
with DisablePrint():
|
651
|
-
backbone = getattr(paddleseg.models, self.backbone_name)(
|
652
|
-
align_corners=align_corners)
|
653
|
-
|
654
|
-
params = {'backbone': backbone, 'align_corners': align_corners}
|
655
|
-
super(HRNet, self).__init__(
|
656
|
-
model_name='FCN',
|
657
|
-
num_classes=num_classes,
|
658
|
-
use_mixed_loss=use_mixed_loss,
|
659
|
-
**params)
|
660
|
-
self.model_name = 'HRNet'
|
661
|
-
|
662
|
-
|
663
|
-
class BiSeNetV2(BaseSegmenter):
|
664
|
-
def __init__(self,
|
665
|
-
num_classes=2,
|
666
|
-
use_mixed_loss=False,
|
667
|
-
align_corners=False):
|
668
|
-
params = {'align_corners': align_corners}
|
669
|
-
super(BiSeNetV2, self).__init__(
|
670
|
-
model_name='BiSeNetV2',
|
671
|
-
num_classes=num_classes,
|
672
|
-
use_mixed_loss=use_mixed_loss,
|
673
|
-
**params)
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# Copyright (c) 2021 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.
|