Instructions to use pdomain/PP-DocLayout_plus-L with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PaddleOCR
How to use pdomain/PP-DocLayout_plus-L with PaddleOCR:
# 1. See https://www.paddlepaddle.org.cn/en/install to install paddlepaddle # 2. pip install paddleocr from paddleocr import LayoutDetection model = LayoutDetection(model_name="PP-DocLayout_plus-L") output = model.predict(input="path/to/image.png", batch_size=1) for res in output: res.print() res.save_to_img(save_path="./output/") res.save_to_json(save_path="./output/res.json") - Notebooks
- Google Colab
- Kaggle
| { | |
| "activation_dropout": 0.0, | |
| "activation_function": "silu", | |
| "anchor_image_size": null, | |
| "attention_dropout": 0.0, | |
| "auxiliary_loss": true, | |
| "backbone_config": { | |
| "arch": "L", | |
| "depths": [ | |
| 3, | |
| 4, | |
| 6, | |
| 3 | |
| ], | |
| "embedding_size": 64, | |
| "hidden_act": "relu", | |
| "hidden_sizes": [ | |
| 256, | |
| 512, | |
| 1024, | |
| 2048 | |
| ], | |
| "initializer_range": 0.02, | |
| "model_type": "hgnet_v2", | |
| "num_channels": 3, | |
| "out_features": [ | |
| "stage2", | |
| "stage3", | |
| "stage4" | |
| ], | |
| "out_indices": [ | |
| 2, | |
| 3, | |
| 4 | |
| ], | |
| "stage_downsample": [ | |
| false, | |
| true, | |
| true, | |
| true | |
| ], | |
| "stage_downsample_strides": [ | |
| 2, | |
| 2, | |
| 2, | |
| 2 | |
| ], | |
| "stage_in_channels": [ | |
| 48, | |
| 128, | |
| 512, | |
| 1024 | |
| ], | |
| "stage_kernel_size": [ | |
| 3, | |
| 3, | |
| 5, | |
| 5 | |
| ], | |
| "stage_light_block": [ | |
| false, | |
| false, | |
| true, | |
| true | |
| ], | |
| "stage_mid_channels": [ | |
| 48, | |
| 96, | |
| 192, | |
| 384 | |
| ], | |
| "stage_names": [ | |
| "stem", | |
| "stage1", | |
| "stage2", | |
| "stage3", | |
| "stage4" | |
| ], | |
| "stage_num_blocks": [ | |
| 1, | |
| 1, | |
| 3, | |
| 1 | |
| ], | |
| "stage_numb_of_layers": [ | |
| 6, | |
| 6, | |
| 6, | |
| 6 | |
| ], | |
| "stage_out_channels": [ | |
| 128, | |
| 512, | |
| 1024, | |
| 2048 | |
| ], | |
| "stem_channels": [ | |
| 3, | |
| 32, | |
| 48 | |
| ], | |
| "stem_strides": [ | |
| 2, | |
| 1, | |
| 1, | |
| 2, | |
| 1 | |
| ], | |
| "use_learnable_affine_block": false, | |
| "return_idx": [ | |
| 1, | |
| 2, | |
| 3 | |
| ], | |
| "freeze_stem_only": true, | |
| "freeze_at": 0, | |
| "freeze_norm": false, | |
| "lr_mult_list": [ | |
| 0.05, | |
| 0.05, | |
| 0.1, | |
| 0.15, | |
| 0.2 | |
| ] | |
| }, | |
| "batch_norm_eps": 1e-05, | |
| "box_noise_scale": 1.0, | |
| "d_model": 256, | |
| "decoder_activation_function": "relu", | |
| "decoder_attention_heads": 8, | |
| "decoder_ffn_dim": 1024, | |
| "decoder_in_channels": [ | |
| 256, | |
| 256, | |
| 256 | |
| ], | |
| "decoder_layers": 6, | |
| "decoder_n_points": 4, | |
| "disable_custom_kernels": true, | |
| "dropout": 0.0, | |
| "encode_proj_layers": [ | |
| 2 | |
| ], | |
| "encoder_activation_function": "gelu", | |
| "encoder_attention_heads": 8, | |
| "encoder_ffn_dim": 1024, | |
| "encoder_hidden_dim": 256, | |
| "encoder_in_channels": [ | |
| 512, | |
| 1024, | |
| 2048 | |
| ], | |
| "encoder_layers": 1, | |
| "eos_coefficient": 0.0001, | |
| "eval_size": null, | |
| "feat_strides": [ | |
| 8, | |
| 16, | |
| 32 | |
| ], | |
| "focal_loss_alpha": 0.75, | |
| "focal_loss_gamma": 2.0, | |
| "freeze_backbone_batch_norms": true, | |
| "hidden_expansion": 1.0, | |
| "id2label": { | |
| "0": "paragraph_title", | |
| "1": "image", | |
| "10": "doc_title", | |
| "11": "footnote", | |
| "12": "header", | |
| "13": "algorithm", | |
| "14": "footer", | |
| "15": "seal", | |
| "16": "chart", | |
| "17": "formula_number", | |
| "18": "aside_text", | |
| "19": "reference_content", | |
| "2": "text", | |
| "3": "number", | |
| "4": "abstract", | |
| "5": "content", | |
| "6": "figure_title", | |
| "7": "formula", | |
| "8": "table", | |
| "9": "reference" | |
| }, | |
| "initializer_bias_prior_prob": null, | |
| "initializer_range": 0.01, | |
| "is_encoder_decoder": true, | |
| "label2id": { | |
| "abstract": 4, | |
| "algorithm": 13, | |
| "aside_text": 18, | |
| "chart": 16, | |
| "content": 5, | |
| "doc_title": 10, | |
| "figure_title": 6, | |
| "footer": 14, | |
| "footnote": 11, | |
| "formula": 7, | |
| "formula_number": 17, | |
| "header": 12, | |
| "image": 1, | |
| "number": 3, | |
| "paragraph_title": 0, | |
| "reference": 9, | |
| "reference_content": 19, | |
| "seal": 15, | |
| "table": 8, | |
| "text": 2 | |
| }, | |
| "label_noise_ratio": 0.5, | |
| "layer_norm_eps": 1e-05, | |
| "learn_initial_query": false, | |
| "matcher_alpha": 0.25, | |
| "matcher_bbox_cost": 5.0, | |
| "matcher_class_cost": 2.0, | |
| "matcher_gamma": 2.0, | |
| "matcher_giou_cost": 2.0, | |
| "model_type": "rt_detr", | |
| "normalize_before": false, | |
| "num_denoising": 100, | |
| "num_feature_levels": 3, | |
| "num_queries": 300, | |
| "positional_encoding_temperature": 10000, | |
| "transformers_version": "5.3.0.dev0", | |
| "use_focal_loss": true, | |
| "weight_loss_bbox": 5.0, | |
| "weight_loss_giou": 2.0, | |
| "weight_loss_vfl": 1.0, | |
| "with_box_refine": true | |
| } |