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
@@ -1,343 +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 cv2
|
16
|
-
import uuid
|
17
|
-
import json
|
18
|
-
import os
|
19
|
-
import os.path as osp
|
20
|
-
import shutil
|
21
|
-
import numpy as np
|
22
|
-
import PIL.Image
|
23
|
-
from paddlex.utils import is_pic, get_encoding
|
24
|
-
import math
|
25
|
-
|
26
|
-
|
27
|
-
class X2Seg(object):
|
28
|
-
def __init__(self):
|
29
|
-
self.labels2ids = {'_background_': 0}
|
30
|
-
|
31
|
-
def shapes_to_label(self, img_shape, shapes, label_name_to_value):
|
32
|
-
# 该函数基于https://github.com/wkentaro/labelme/blob/master/labelme/utils/shape.py实现。
|
33
|
-
def shape_to_mask(img_shape,
|
34
|
-
points,
|
35
|
-
shape_type=None,
|
36
|
-
line_width=10,
|
37
|
-
point_size=5):
|
38
|
-
mask = np.zeros(img_shape[:2], dtype=np.uint8)
|
39
|
-
mask = PIL.Image.fromarray(mask)
|
40
|
-
draw = PIL.ImageDraw.Draw(mask)
|
41
|
-
xy = [tuple(point) for point in points]
|
42
|
-
if shape_type == 'circle':
|
43
|
-
assert len(
|
44
|
-
xy) == 2, 'Shape of shape_type=circle must have 2 points'
|
45
|
-
(cx, cy), (px, py) = xy
|
46
|
-
d = math.sqrt((cx - px)**2 + (cy - py)**2)
|
47
|
-
draw.ellipse(
|
48
|
-
[cx - d, cy - d, cx + d, cy + d], outline=1, fill=1)
|
49
|
-
elif shape_type == 'rectangle':
|
50
|
-
assert len(
|
51
|
-
xy) == 2, 'Shape of shape_type=rectangle must have 2 points'
|
52
|
-
draw.rectangle(xy, outline=1, fill=1)
|
53
|
-
elif shape_type == 'line':
|
54
|
-
assert len(
|
55
|
-
xy) == 2, 'Shape of shape_type=line must have 2 points'
|
56
|
-
draw.line(xy=xy, fill=1, width=line_width)
|
57
|
-
elif shape_type == 'linestrip':
|
58
|
-
draw.line(xy=xy, fill=1, width=line_width)
|
59
|
-
elif shape_type == 'point':
|
60
|
-
assert len(
|
61
|
-
xy) == 1, 'Shape of shape_type=point must have 1 points'
|
62
|
-
cx, cy = xy[0]
|
63
|
-
r = point_size
|
64
|
-
draw.ellipse(
|
65
|
-
[cx - r, cy - r, cx + r, cy + r], outline=1, fill=1)
|
66
|
-
else:
|
67
|
-
assert len(xy) > 2, 'Polygon must have points more than 2'
|
68
|
-
draw.polygon(xy=xy, outline=1, fill=1)
|
69
|
-
mask = np.array(mask, dtype=bool)
|
70
|
-
return mask
|
71
|
-
|
72
|
-
cls = np.zeros(img_shape[:2], dtype=np.int32)
|
73
|
-
ins = np.zeros_like(cls)
|
74
|
-
instances = []
|
75
|
-
for shape in shapes:
|
76
|
-
points = shape['points']
|
77
|
-
label = shape['label']
|
78
|
-
group_id = shape.get('group_id')
|
79
|
-
if group_id is None:
|
80
|
-
group_id = uuid.uuid1()
|
81
|
-
shape_type = shape.get('shape_type', None)
|
82
|
-
|
83
|
-
cls_name = label
|
84
|
-
instance = (cls_name, group_id)
|
85
|
-
|
86
|
-
if instance not in instances:
|
87
|
-
instances.append(instance)
|
88
|
-
ins_id = instances.index(instance) + 1
|
89
|
-
cls_id = label_name_to_value[cls_name]
|
90
|
-
mask = shape_to_mask(img_shape[:2], points, shape_type)
|
91
|
-
cls[mask] = cls_id
|
92
|
-
ins[mask] = ins_id
|
93
|
-
return cls, ins
|
94
|
-
|
95
|
-
def get_color_map_list(self, num_classes):
|
96
|
-
color_map = num_classes * [0, 0, 0]
|
97
|
-
for i in range(0, num_classes):
|
98
|
-
j = 0
|
99
|
-
lab = i
|
100
|
-
while lab:
|
101
|
-
color_map[i * 3] |= (((lab >> 0) & 1) << (7 - j))
|
102
|
-
color_map[i * 3 + 1] |= (((lab >> 1) & 1) << (7 - j))
|
103
|
-
color_map[i * 3 + 2] |= (((lab >> 2) & 1) << (7 - j))
|
104
|
-
j += 1
|
105
|
-
lab >>= 3
|
106
|
-
return color_map
|
107
|
-
|
108
|
-
def convert(self, image_dir, json_dir, dataset_save_dir):
|
109
|
-
"""转换。
|
110
|
-
Args:
|
111
|
-
image_dir (str): 图像文件存放的路径。
|
112
|
-
json_dir (str): 与每张图像对应的json文件的存放路径。
|
113
|
-
dataset_save_dir (str): 转换后数据集存放路径。
|
114
|
-
"""
|
115
|
-
assert osp.exists(image_dir), "The image folder does not exist!"
|
116
|
-
assert osp.exists(json_dir), "The json folder does not exist!"
|
117
|
-
if not osp.exists(dataset_save_dir):
|
118
|
-
os.makedirs(dataset_save_dir)
|
119
|
-
# Convert the image files.
|
120
|
-
new_image_dir = osp.join(dataset_save_dir, "JPEGImages")
|
121
|
-
if osp.exists(new_image_dir):
|
122
|
-
raise Exception(
|
123
|
-
"The directory {} is already exist, please remove the directory first".
|
124
|
-
format(new_image_dir))
|
125
|
-
os.makedirs(new_image_dir)
|
126
|
-
for img_name in os.listdir(image_dir):
|
127
|
-
if is_pic(img_name):
|
128
|
-
shutil.copyfile(
|
129
|
-
osp.join(image_dir, img_name),
|
130
|
-
osp.join(new_image_dir, img_name))
|
131
|
-
# Convert the json files.
|
132
|
-
png_dir = osp.join(dataset_save_dir, "Annotations")
|
133
|
-
if osp.exists(png_dir):
|
134
|
-
shutil.rmtree(png_dir)
|
135
|
-
os.makedirs(png_dir)
|
136
|
-
self.get_labels2ids(new_image_dir, json_dir)
|
137
|
-
self.json2png(new_image_dir, json_dir, png_dir)
|
138
|
-
# Generate the labels.txt
|
139
|
-
ids2labels = {v: k for k, v in self.labels2ids.items()}
|
140
|
-
with open(osp.join(dataset_save_dir, 'labels.txt'), 'w') as fw:
|
141
|
-
for i in range(len(ids2labels)):
|
142
|
-
fw.write(ids2labels[i] + '\n')
|
143
|
-
|
144
|
-
|
145
|
-
class JingLing2Seg(X2Seg):
|
146
|
-
"""将使用标注精灵标注的数据集转换为Seg数据集。
|
147
|
-
"""
|
148
|
-
|
149
|
-
def __init__(self):
|
150
|
-
super(JingLing2Seg, self).__init__()
|
151
|
-
|
152
|
-
def get_labels2ids(self, image_dir, json_dir):
|
153
|
-
for img_name in os.listdir(image_dir):
|
154
|
-
img_name_part = osp.splitext(img_name)[0]
|
155
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
156
|
-
if not osp.exists(json_file):
|
157
|
-
os.remove(osp.join(image_dir, img_name))
|
158
|
-
continue
|
159
|
-
with open(json_file, mode="r", \
|
160
|
-
encoding=get_encoding(json_file)) as j:
|
161
|
-
json_info = json.load(j)
|
162
|
-
if 'outputs' in json_info:
|
163
|
-
for output in json_info['outputs']['object']:
|
164
|
-
cls_name = output['name']
|
165
|
-
if cls_name not in self.labels2ids:
|
166
|
-
self.labels2ids[cls_name] = len(self.labels2ids)
|
167
|
-
|
168
|
-
def json2png(self, image_dir, json_dir, png_dir):
|
169
|
-
color_map = self.get_color_map_list(256)
|
170
|
-
for img_name in os.listdir(image_dir):
|
171
|
-
img_name_part = osp.splitext(img_name)[0]
|
172
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
173
|
-
if not osp.exists(json_file):
|
174
|
-
os.remove(osp.join(image_dir, img_name))
|
175
|
-
continue
|
176
|
-
with open(json_file, mode="r", \
|
177
|
-
encoding=get_encoding(json_file)) as j:
|
178
|
-
json_info = json.load(j)
|
179
|
-
data_shapes = []
|
180
|
-
if 'outputs' in json_info:
|
181
|
-
for output in json_info['outputs']['object']:
|
182
|
-
if 'polygon' in output.keys():
|
183
|
-
polygon = output['polygon']
|
184
|
-
name = output['name']
|
185
|
-
points = []
|
186
|
-
for i in range(1, int(len(polygon) / 2) + 1):
|
187
|
-
points.append([
|
188
|
-
polygon['x' + str(i)],
|
189
|
-
polygon['y' + str(i)]
|
190
|
-
])
|
191
|
-
shape = {
|
192
|
-
'label': name,
|
193
|
-
'points': points,
|
194
|
-
'shape_type': 'polygon'
|
195
|
-
}
|
196
|
-
data_shapes.append(shape)
|
197
|
-
if 'size' not in json_info:
|
198
|
-
continue
|
199
|
-
img_shape = (json_info['size']['height'],
|
200
|
-
json_info['size']['width'],
|
201
|
-
json_info['size']['depth'])
|
202
|
-
lbl, _ = self.shapes_to_label(
|
203
|
-
img_shape=img_shape,
|
204
|
-
shapes=data_shapes,
|
205
|
-
label_name_to_value=self.labels2ids, )
|
206
|
-
out_png_file = osp.join(png_dir, img_name_part + '.png')
|
207
|
-
if lbl.min() >= 0 and lbl.max() <= 255:
|
208
|
-
lbl_pil = PIL.Image.fromarray(lbl.astype(np.uint8), mode='P')
|
209
|
-
lbl_pil.putpalette(color_map)
|
210
|
-
lbl_pil.save(out_png_file)
|
211
|
-
else:
|
212
|
-
raise ValueError(
|
213
|
-
'[%s] Cannot save the pixel-wise class label as PNG. '
|
214
|
-
'Please consider using the .npy format.' % out_png_file)
|
215
|
-
|
216
|
-
|
217
|
-
class LabelMe2Seg(X2Seg):
|
218
|
-
"""将使用LabelMe标注的数据集转换为Seg数据集。
|
219
|
-
"""
|
220
|
-
|
221
|
-
def __init__(self):
|
222
|
-
super(LabelMe2Seg, self).__init__()
|
223
|
-
|
224
|
-
def get_labels2ids(self, image_dir, json_dir):
|
225
|
-
for img_name in os.listdir(image_dir):
|
226
|
-
img_name_part = osp.splitext(img_name)[0]
|
227
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
228
|
-
if not osp.exists(json_file):
|
229
|
-
os.remove(osp.join(image_dir, img_name))
|
230
|
-
continue
|
231
|
-
with open(json_file, mode="r", \
|
232
|
-
encoding=get_encoding(json_file)) as j:
|
233
|
-
json_info = json.load(j)
|
234
|
-
for shape in json_info['shapes']:
|
235
|
-
cls_name = shape['label']
|
236
|
-
if cls_name not in self.labels2ids:
|
237
|
-
self.labels2ids[cls_name] = len(self.labels2ids)
|
238
|
-
|
239
|
-
def json2png(self, image_dir, json_dir, png_dir):
|
240
|
-
color_map = self.get_color_map_list(256)
|
241
|
-
for img_name in os.listdir(image_dir):
|
242
|
-
img_name_part = osp.splitext(img_name)[0]
|
243
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
244
|
-
if not osp.exists(json_file):
|
245
|
-
os.remove(osp.join(image_dir, img_name))
|
246
|
-
continue
|
247
|
-
img_file = osp.join(image_dir, img_name)
|
248
|
-
img = np.asarray(PIL.Image.open(img_file))
|
249
|
-
with open(json_file, mode="r", \
|
250
|
-
encoding=get_encoding(json_file)) as j:
|
251
|
-
json_info = json.load(j)
|
252
|
-
lbl, _ = self.shapes_to_label(
|
253
|
-
img_shape=img.shape,
|
254
|
-
shapes=json_info['shapes'],
|
255
|
-
label_name_to_value=self.labels2ids, )
|
256
|
-
out_png_file = osp.join(png_dir, img_name_part + '.png')
|
257
|
-
if lbl.min() >= 0 and lbl.max() <= 255:
|
258
|
-
lbl_pil = PIL.Image.fromarray(lbl.astype(np.uint8), mode='P')
|
259
|
-
lbl_pil.putpalette(color_map)
|
260
|
-
lbl_pil.save(out_png_file)
|
261
|
-
else:
|
262
|
-
raise ValueError(
|
263
|
-
'[%s] Cannot save the pixel-wise class label as PNG. '
|
264
|
-
'Please consider using the .npy format.' % out_png_file)
|
265
|
-
|
266
|
-
|
267
|
-
class EasyData2Seg(X2Seg):
|
268
|
-
"""将使用EasyData标注的分割数据集转换为Seg数据集。
|
269
|
-
"""
|
270
|
-
|
271
|
-
def __init__(self):
|
272
|
-
super(EasyData2Seg, self).__init__()
|
273
|
-
|
274
|
-
def get_labels2ids(self, image_dir, json_dir):
|
275
|
-
for img_name in os.listdir(image_dir):
|
276
|
-
img_name_part = osp.splitext(img_name)[0]
|
277
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
278
|
-
if not osp.exists(json_file):
|
279
|
-
os.remove(osp.join(image_dir, img_name))
|
280
|
-
continue
|
281
|
-
with open(json_file, mode="r", \
|
282
|
-
encoding=get_encoding(json_file)) as j:
|
283
|
-
json_info = json.load(j)
|
284
|
-
for shape in json_info["labels"]:
|
285
|
-
cls_name = shape['name']
|
286
|
-
if cls_name not in self.labels2ids:
|
287
|
-
self.labels2ids[cls_name] = len(self.labels2ids)
|
288
|
-
|
289
|
-
def mask2polygon(self, mask, label):
|
290
|
-
contours, hierarchy = cv2.findContours(
|
291
|
-
(mask).astype(np.uint8), cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
|
292
|
-
segmentation = []
|
293
|
-
for contour in contours:
|
294
|
-
contour_list = contour.flatten().tolist()
|
295
|
-
if len(contour_list) > 4:
|
296
|
-
points = []
|
297
|
-
for i in range(0, len(contour_list), 2):
|
298
|
-
points.append([contour_list[i], contour_list[i + 1]])
|
299
|
-
shape = {
|
300
|
-
'label': label,
|
301
|
-
'points': points,
|
302
|
-
'shape_type': 'polygon'
|
303
|
-
}
|
304
|
-
segmentation.append(shape)
|
305
|
-
return segmentation
|
306
|
-
|
307
|
-
def json2png(self, image_dir, json_dir, png_dir):
|
308
|
-
from pycocotools.mask import decode
|
309
|
-
color_map = self.get_color_map_list(256)
|
310
|
-
for img_name in os.listdir(image_dir):
|
311
|
-
img_name_part = osp.splitext(img_name)[0]
|
312
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
313
|
-
if not osp.exists(json_file):
|
314
|
-
os.remove(osp.join(image_dir, img_name))
|
315
|
-
continue
|
316
|
-
img_file = osp.join(image_dir, img_name)
|
317
|
-
img = np.asarray(PIL.Image.open(img_file))
|
318
|
-
img_h = img.shape[0]
|
319
|
-
img_w = img.shape[1]
|
320
|
-
with open(json_file, mode="r", \
|
321
|
-
encoding=get_encoding(json_file)) as j:
|
322
|
-
json_info = json.load(j)
|
323
|
-
data_shapes = []
|
324
|
-
for shape in json_info['labels']:
|
325
|
-
mask_dict = {}
|
326
|
-
mask_dict['size'] = [img_h, img_w]
|
327
|
-
mask_dict['counts'] = shape['mask'].encode()
|
328
|
-
mask = decode(mask_dict)
|
329
|
-
polygon = self.mask2polygon(mask, shape["name"])
|
330
|
-
data_shapes.extend(polygon)
|
331
|
-
lbl, _ = self.shapes_to_label(
|
332
|
-
img_shape=img.shape,
|
333
|
-
shapes=data_shapes,
|
334
|
-
label_name_to_value=self.labels2ids, )
|
335
|
-
out_png_file = osp.join(png_dir, img_name_part + '.png')
|
336
|
-
if lbl.min() >= 0 and lbl.max() <= 255:
|
337
|
-
lbl_pil = PIL.Image.fromarray(lbl.astype(np.uint8), mode='P')
|
338
|
-
lbl_pil.putpalette(color_map)
|
339
|
-
lbl_pil.save(out_png_file)
|
340
|
-
else:
|
341
|
-
raise ValueError(
|
342
|
-
'[%s] Cannot save the pixel-wise class label as PNG. '
|
343
|
-
'Please consider using the .npy format.' % out_png_file)
|
@@ -1,230 +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 cv2
|
16
|
-
import json
|
17
|
-
import os
|
18
|
-
import os.path as osp
|
19
|
-
import shutil
|
20
|
-
from paddlex.utils import is_pic, get_encoding
|
21
|
-
|
22
|
-
|
23
|
-
class X2VOC(object):
|
24
|
-
def __init__(self):
|
25
|
-
pass
|
26
|
-
|
27
|
-
def convert(self, image_dir, json_dir, dataset_save_dir):
|
28
|
-
"""转换。
|
29
|
-
Args:
|
30
|
-
image_dir (str): 图像文件存放的路径。
|
31
|
-
json_dir (str): 与每张图像对应的json文件的存放路径。
|
32
|
-
dataset_save_dir (str): 转换后数据集存放路径。
|
33
|
-
"""
|
34
|
-
assert osp.exists(image_dir), "The image folder does not exist!"
|
35
|
-
assert osp.exists(json_dir), "The json folder does not exist!"
|
36
|
-
if not osp.exists(dataset_save_dir):
|
37
|
-
os.makedirs(dataset_save_dir)
|
38
|
-
# Convert the image files.
|
39
|
-
new_image_dir = osp.join(dataset_save_dir, "JPEGImages")
|
40
|
-
if osp.exists(new_image_dir):
|
41
|
-
raise Exception(
|
42
|
-
"The directory {} is already exist, please remove the directory first".
|
43
|
-
format(new_image_dir))
|
44
|
-
os.makedirs(new_image_dir)
|
45
|
-
for img_name in os.listdir(image_dir):
|
46
|
-
if is_pic(img_name):
|
47
|
-
shutil.copyfile(
|
48
|
-
osp.join(image_dir, img_name),
|
49
|
-
osp.join(new_image_dir, img_name))
|
50
|
-
# Convert the json files.
|
51
|
-
xml_dir = osp.join(dataset_save_dir, "Annotations")
|
52
|
-
if osp.exists(xml_dir):
|
53
|
-
raise Exception(
|
54
|
-
"The directory {} is already exist, please remove the directory first".
|
55
|
-
format(xml_dir))
|
56
|
-
os.makedirs(xml_dir)
|
57
|
-
self.json2xml(new_image_dir, json_dir, xml_dir)
|
58
|
-
|
59
|
-
|
60
|
-
class LabelMe2VOC(X2VOC):
|
61
|
-
"""将使用LabelMe标注的数据集转换为VOC数据集。
|
62
|
-
"""
|
63
|
-
|
64
|
-
def __init__(self):
|
65
|
-
pass
|
66
|
-
|
67
|
-
def json2xml(self, image_dir, json_dir, xml_dir):
|
68
|
-
import xml.dom.minidom as minidom
|
69
|
-
i = 0
|
70
|
-
for img_name in os.listdir(image_dir):
|
71
|
-
img_name_part = osp.splitext(img_name)[0]
|
72
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
73
|
-
i += 1
|
74
|
-
if not osp.exists(json_file):
|
75
|
-
os.remove(osp.join(image_dir, img_name))
|
76
|
-
continue
|
77
|
-
xml_doc = minidom.Document()
|
78
|
-
root = xml_doc.createElement("annotation")
|
79
|
-
xml_doc.appendChild(root)
|
80
|
-
node_folder = xml_doc.createElement("folder")
|
81
|
-
node_folder.appendChild(xml_doc.createTextNode("JPEGImages"))
|
82
|
-
root.appendChild(node_folder)
|
83
|
-
node_filename = xml_doc.createElement("filename")
|
84
|
-
node_filename.appendChild(xml_doc.createTextNode(img_name))
|
85
|
-
root.appendChild(node_filename)
|
86
|
-
with open(json_file, mode="r", \
|
87
|
-
encoding=get_encoding(json_file)) as j:
|
88
|
-
json_info = json.load(j)
|
89
|
-
if 'imageHeight' in json_info and 'imageWidth' in json_info:
|
90
|
-
h = json_info["imageHeight"]
|
91
|
-
w = json_info["imageWidth"]
|
92
|
-
else:
|
93
|
-
img_file = osp.join(image_dir, img_name)
|
94
|
-
im_data = cv2.imread(img_file)
|
95
|
-
h, w, c = im_data.shape
|
96
|
-
node_size = xml_doc.createElement("size")
|
97
|
-
node_width = xml_doc.createElement("width")
|
98
|
-
node_width.appendChild(xml_doc.createTextNode(str(w)))
|
99
|
-
node_size.appendChild(node_width)
|
100
|
-
node_height = xml_doc.createElement("height")
|
101
|
-
node_height.appendChild(xml_doc.createTextNode(str(h)))
|
102
|
-
node_size.appendChild(node_height)
|
103
|
-
node_depth = xml_doc.createElement("depth")
|
104
|
-
node_depth.appendChild(xml_doc.createTextNode(str(3)))
|
105
|
-
node_size.appendChild(node_depth)
|
106
|
-
root.appendChild(node_size)
|
107
|
-
for shape in json_info["shapes"]:
|
108
|
-
if 'shape_type' in shape:
|
109
|
-
if shape["shape_type"] != "rectangle":
|
110
|
-
continue
|
111
|
-
(xmin, ymin), (xmax, ymax) = shape["points"]
|
112
|
-
xmin, xmax = sorted([xmin, xmax])
|
113
|
-
ymin, ymax = sorted([ymin, ymax])
|
114
|
-
else:
|
115
|
-
points = shape["points"]
|
116
|
-
points_num = len(points)
|
117
|
-
x = [points[i][0] for i in range(points_num)]
|
118
|
-
y = [points[i][1] for i in range(points_num)]
|
119
|
-
xmin = min(x)
|
120
|
-
xmax = max(x)
|
121
|
-
ymin = min(y)
|
122
|
-
ymax = max(y)
|
123
|
-
label = shape["label"]
|
124
|
-
node_obj = xml_doc.createElement("object")
|
125
|
-
node_name = xml_doc.createElement("name")
|
126
|
-
node_name.appendChild(xml_doc.createTextNode(label))
|
127
|
-
node_obj.appendChild(node_name)
|
128
|
-
node_diff = xml_doc.createElement("difficult")
|
129
|
-
node_diff.appendChild(xml_doc.createTextNode(str(0)))
|
130
|
-
node_obj.appendChild(node_diff)
|
131
|
-
node_box = xml_doc.createElement("bndbox")
|
132
|
-
node_xmin = xml_doc.createElement("xmin")
|
133
|
-
node_xmin.appendChild(xml_doc.createTextNode(str(xmin)))
|
134
|
-
node_box.appendChild(node_xmin)
|
135
|
-
node_ymin = xml_doc.createElement("ymin")
|
136
|
-
node_ymin.appendChild(xml_doc.createTextNode(str(ymin)))
|
137
|
-
node_box.appendChild(node_ymin)
|
138
|
-
node_xmax = xml_doc.createElement("xmax")
|
139
|
-
node_xmax.appendChild(xml_doc.createTextNode(str(xmax)))
|
140
|
-
node_box.appendChild(node_xmax)
|
141
|
-
node_ymax = xml_doc.createElement("ymax")
|
142
|
-
node_ymax.appendChild(xml_doc.createTextNode(str(ymax)))
|
143
|
-
node_box.appendChild(node_ymax)
|
144
|
-
node_obj.appendChild(node_box)
|
145
|
-
root.appendChild(node_obj)
|
146
|
-
with open(osp.join(xml_dir, img_name_part + ".xml"), 'w') as fxml:
|
147
|
-
xml_doc.writexml(
|
148
|
-
fxml,
|
149
|
-
indent='\t',
|
150
|
-
addindent='\t',
|
151
|
-
newl='\n',
|
152
|
-
encoding="utf-8")
|
153
|
-
|
154
|
-
|
155
|
-
class EasyData2VOC(X2VOC):
|
156
|
-
"""将使用EasyData标注的分割数据集转换为VOC数据集。
|
157
|
-
"""
|
158
|
-
|
159
|
-
def __init__(self):
|
160
|
-
pass
|
161
|
-
|
162
|
-
def json2xml(self, image_dir, json_dir, xml_dir):
|
163
|
-
import xml.dom.minidom as minidom
|
164
|
-
for img_name in os.listdir(image_dir):
|
165
|
-
img_name_part = osp.splitext(img_name)[0]
|
166
|
-
json_file = osp.join(json_dir, img_name_part + ".json")
|
167
|
-
if not osp.exists(json_file):
|
168
|
-
os.remove(osp.join(image_dir, img_name))
|
169
|
-
continue
|
170
|
-
xml_doc = minidom.Document()
|
171
|
-
root = xml_doc.createElement("annotation")
|
172
|
-
xml_doc.appendChild(root)
|
173
|
-
node_folder = xml_doc.createElement("folder")
|
174
|
-
node_folder.appendChild(xml_doc.createTextNode("JPEGImages"))
|
175
|
-
root.appendChild(node_folder)
|
176
|
-
node_filename = xml_doc.createElement("filename")
|
177
|
-
node_filename.appendChild(xml_doc.createTextNode(img_name))
|
178
|
-
root.appendChild(node_filename)
|
179
|
-
img = cv2.imread(osp.join(image_dir, img_name))
|
180
|
-
h = img.shape[0]
|
181
|
-
w = img.shape[1]
|
182
|
-
node_size = xml_doc.createElement("size")
|
183
|
-
node_width = xml_doc.createElement("width")
|
184
|
-
node_width.appendChild(xml_doc.createTextNode(str(w)))
|
185
|
-
node_size.appendChild(node_width)
|
186
|
-
node_height = xml_doc.createElement("height")
|
187
|
-
node_height.appendChild(xml_doc.createTextNode(str(h)))
|
188
|
-
node_size.appendChild(node_height)
|
189
|
-
node_depth = xml_doc.createElement("depth")
|
190
|
-
node_depth.appendChild(xml_doc.createTextNode(str(3)))
|
191
|
-
node_size.appendChild(node_depth)
|
192
|
-
root.appendChild(node_size)
|
193
|
-
with open(json_file, mode="r", \
|
194
|
-
encoding=get_encoding(json_file)) as j:
|
195
|
-
json_info = json.load(j)
|
196
|
-
for shape in json_info["labels"]:
|
197
|
-
label = shape["name"]
|
198
|
-
xmin = shape["x1"]
|
199
|
-
ymin = shape["y1"]
|
200
|
-
xmax = shape["x2"]
|
201
|
-
ymax = shape["y2"]
|
202
|
-
node_obj = xml_doc.createElement("object")
|
203
|
-
node_name = xml_doc.createElement("name")
|
204
|
-
node_name.appendChild(xml_doc.createTextNode(label))
|
205
|
-
node_obj.appendChild(node_name)
|
206
|
-
node_diff = xml_doc.createElement("difficult")
|
207
|
-
node_diff.appendChild(xml_doc.createTextNode(str(0)))
|
208
|
-
node_obj.appendChild(node_diff)
|
209
|
-
node_box = xml_doc.createElement("bndbox")
|
210
|
-
node_xmin = xml_doc.createElement("xmin")
|
211
|
-
node_xmin.appendChild(xml_doc.createTextNode(str(xmin)))
|
212
|
-
node_box.appendChild(node_xmin)
|
213
|
-
node_ymin = xml_doc.createElement("ymin")
|
214
|
-
node_ymin.appendChild(xml_doc.createTextNode(str(ymin)))
|
215
|
-
node_box.appendChild(node_ymin)
|
216
|
-
node_xmax = xml_doc.createElement("xmax")
|
217
|
-
node_xmax.appendChild(xml_doc.createTextNode(str(xmax)))
|
218
|
-
node_box.appendChild(node_xmax)
|
219
|
-
node_ymax = xml_doc.createElement("ymax")
|
220
|
-
node_ymax.appendChild(xml_doc.createTextNode(str(ymax)))
|
221
|
-
node_box.appendChild(node_ymax)
|
222
|
-
node_obj.appendChild(node_box)
|
223
|
-
root.appendChild(node_obj)
|
224
|
-
with open(osp.join(xml_dir, img_name_part + ".xml"), 'w') as fxml:
|
225
|
-
xml_doc.writexml(
|
226
|
-
fxml,
|
227
|
-
indent='\t',
|
228
|
-
addindent='\t',
|
229
|
-
newl='\n',
|
230
|
-
encoding="utf-8")
|
@@ -1,23 +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
|
-
from .imagenet_split import split_imagenet_dataset
|
16
|
-
from .seg_split import split_seg_dataset
|
17
|
-
from .voc_split import split_voc_dataset
|
18
|
-
from .coco_split import split_coco_dataset
|
19
|
-
|
20
|
-
__all__ = [
|
21
|
-
'split_imagenet_dataset', 'split_seg_dataset', 'split_voc_dataset',
|
22
|
-
'split_coco_dataset'
|
23
|
-
]
|
@@ -1,69 +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 os.path as osp
|
16
|
-
import random
|
17
|
-
import json
|
18
|
-
|
19
|
-
from paddlex.utils import MyEncoder, logging
|
20
|
-
|
21
|
-
|
22
|
-
def split_coco_dataset(dataset_dir, val_percent, test_percent, save_dir):
|
23
|
-
# matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
|
24
|
-
# or matplotlib.backends is imported for the first time
|
25
|
-
# pycocotools import matplotlib
|
26
|
-
import matplotlib
|
27
|
-
matplotlib.use('Agg')
|
28
|
-
from pycocotools.coco import COCO
|
29
|
-
if not osp.exists(osp.join(dataset_dir, "annotations.json")):
|
30
|
-
logging.error("\'annotations.json\' is not found in {}!".format(
|
31
|
-
dataset_dir))
|
32
|
-
|
33
|
-
annotation_file = osp.join(dataset_dir, "annotations.json")
|
34
|
-
coco = COCO(annotation_file)
|
35
|
-
img_ids = coco.getImgIds()
|
36
|
-
cat_ids = coco.getCatIds()
|
37
|
-
anno_ids = coco.getAnnIds()
|
38
|
-
|
39
|
-
val_num = int(len(img_ids) * val_percent)
|
40
|
-
test_num = int(len(img_ids) * test_percent)
|
41
|
-
train_num = len(img_ids) - val_num - test_num
|
42
|
-
|
43
|
-
random.shuffle(img_ids)
|
44
|
-
train_files_ids = img_ids[:train_num]
|
45
|
-
val_files_ids = img_ids[train_num:train_num + val_num]
|
46
|
-
test_files_ids = img_ids[train_num + val_num:]
|
47
|
-
|
48
|
-
for img_id_list in [train_files_ids, val_files_ids, test_files_ids]:
|
49
|
-
img_anno_ids = coco.getAnnIds(imgIds=img_id_list, iscrowd=0)
|
50
|
-
imgs = coco.loadImgs(img_id_list)
|
51
|
-
instances = coco.loadAnns(img_anno_ids)
|
52
|
-
categories = coco.loadCats(cat_ids)
|
53
|
-
img_dict = {
|
54
|
-
"annotations": instances,
|
55
|
-
"images": imgs,
|
56
|
-
"categories": categories
|
57
|
-
}
|
58
|
-
|
59
|
-
if img_id_list == train_files_ids:
|
60
|
-
json_file = open(osp.join(save_dir, 'train.json'), 'w+')
|
61
|
-
json.dump(img_dict, json_file, cls=MyEncoder)
|
62
|
-
elif img_id_list == val_files_ids:
|
63
|
-
json_file = open(osp.join(save_dir, 'val.json'), 'w+')
|
64
|
-
json.dump(img_dict, json_file, cls=MyEncoder)
|
65
|
-
elif img_id_list == test_files_ids and len(test_files_ids):
|
66
|
-
json_file = open(osp.join(save_dir, 'test.json'), 'w+')
|
67
|
-
json.dump(img_dict, json_file, cls=MyEncoder)
|
68
|
-
|
69
|
-
return train_num, val_num, test_num
|