
    ?pj                         S SK r SSKJrJrJrJr  SSKJrJr  SSK	J
r
  SSKJr  \" 5         / SQr " S	 S
\5      r " S S\5      rg)    N   )add_simple_inference_argsget_subcommand_argsperform_simple_inferencestr2bool   )PaddleXPipelineWrapperPipelineCLISubcommandExecutor)create_config_from_structure)apply_patches)PP-OCRv3PP-OCRv4PP-OCRv5c            !       |  ^  \ rS rSr                                                                   SU 4S jjr\S 5       rSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS. S jrSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS. S	 jrS
 r	\
S 5       rS rS rSrU =r$ )PPStructureV3   NcD           	      
  > WCb   WC[         ;  a  [        SWC S[          S35      e[        [        S UUUU45      5      (       aJ  WBc  WCbC  U R	                  WBWC5      u  nEnFUEb  WFc$  [        S[        WB5       S[        WC5       S35      eWEnWFnOWBc  WCb  [        R                  " SSS	9  [        5       R                  5       nGUUGS
'   UUGS'   UGR                  S5        UGR                  S5        UGU l        [        THU ]4  " S0 WDD6  g )NzInvalid OCR version: z. Supported values are .c                 
    U S L $ N )ps    _/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/paddleocr/_pipelines/pp_structurev3.py<lambda>(PPStructureV3.__init__.<locals>.<lambda>n   s    !t)    z)No models are available for the language z and OCR version z^`lang` and `ocr_version` will be ignored when model names or model directories are not `None`.r   )
stackleveltext_detection_model_nametext_recognition_model_nameselfkwargsr   )_SUPPORTED_OCR_VERSIONS
ValueErrorallmap_get_ocr_model_namesreprwarningswarnlocalscopypop_paramssuper__init__)Ir    layout_detection_model_namelayout_detection_model_dirlayout_threshold
layout_nmslayout_unclip_ratiolayout_merge_bboxes_modechart_recognition_model_namechart_recognition_model_dirchart_recognition_batch_sizeregion_detection_model_nameregion_detection_model_dir#doc_orientation_classify_model_name"doc_orientation_classify_model_dirdoc_unwarping_model_namedoc_unwarping_model_dirr   text_detection_model_dirtext_det_limit_side_lentext_det_limit_typetext_det_threshtext_det_box_threshtext_det_unclip_ratiotextline_orientation_model_nametextline_orientation_model_dirtextline_orientation_batch_sizer   text_recognition_model_dirtext_recognition_batch_sizetext_rec_score_threshtable_classification_model_nametable_classification_model_dir,wired_table_structure_recognition_model_name+wired_table_structure_recognition_model_dir/wireless_table_structure_recognition_model_name.wireless_table_structure_recognition_model_dir&wired_table_cells_detection_model_name%wired_table_cells_detection_model_dir)wireless_table_cells_detection_model_name(wireless_table_cells_detection_model_dir%table_orientation_classify_model_name$table_orientation_classify_model_dirseal_text_detection_model_nameseal_text_detection_model_dirseal_det_limit_side_lenseal_det_limit_typeseal_det_threshseal_det_box_threshseal_det_unclip_ratio seal_text_recognition_model_nameseal_text_recognition_model_dir seal_text_recognition_batch_sizeseal_rec_score_threshformula_recognition_model_nameformula_recognition_model_dirformula_recognition_batch_sizeuse_doc_orientation_classifyuse_doc_unwarpinguse_textline_orientationuse_seal_recognitionuse_table_recognitionuse_formula_recognitionuse_chart_recognitionuse_region_detectionformat_block_contentmarkdown_ignore_labelslangocr_versionr!   det_model_namerec_model_nameparams	__class__sI                                                                           r   r/   PPStructureV3.__init__    sC   N "{:Q'Q'}4KLcKddef  #-,/.	

 

 ;#:151J1J+2. ")^-C$CDJ<O`aefqar`sstu  -;).<+;#:t  .G*+0K,-

6

8"6"r   c                     g)NzPP-StructureV3r   r    s    r   _paddlex_pipeline_name$PPStructureV3._paddlex_pipeline_name       r   FT) re   rf   rg   rh   ri   rj   rk   rl   rm   r2   r3   r4   r5   r@   rA   rB   rC   rD   rJ   rY   rZ   r[   r\   r]   ra   #use_wired_table_cells_trans_to_html&use_wireless_table_cells_trans_to_htmluse_table_orientation_classify use_ocr_results_with_table_cellsuse_e2e_wired_table_rec_model use_e2e_wireless_table_rec_modelrn   c                     U R                   R                  " U40 SU_SU_SU_SU_SU_SU_SU_SU	_S	U
_S
U_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU _S U!_U"D6$ !Nre   rf   rg   rh   ri   rj   rk   rl   rm   r2   r3   r4   r5   r@   rA   rB   rC   rD   rJ   rY   rZ   r[   r\   r]   ra   r{   r|   r}   r~   r   r   rn   )paddlex_pipelinepredict#r    inputre   rf   rg   rh   ri   rj   rk   rl   rm   r2   r3   r4   r5   r@   rA   rB   rC   rD   rJ   rY   rZ   r[   r\   r]   ra   r{   r|   r}   r~   r   r   rn   r!   s#                                      r   predict_iterPPStructureV3.predict_iter   sl   L $$,,#
)E#
 0#
 &>	#

 "6#
 #8#
 %<#
 #8#
 "6#
 "6#
 .#
 "#
 !4#
 &>#
 %<#
  !4!#
" ,##
$ !4%#
& #8'#
( #8)#
* %<+#
, !4-#
. ,/#
0 !41#
2 #83#
4 #85#
6 1T7#
8 4Z9#
: ,J;#
< .N=#
> +H?#
@ .NA#
B $:E#
 #	
r   c                     [        U R                  " U40 SU_SU_SU_SU_SU_SU_SU_SU	_S	U
_S
U_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU_SU _S U!_U"D65      $ r   )listr   r   s#                                      r   r   PPStructureV3.predict   ss   L #-I# #4# *B	#
 &:# '<# )@# '<# &:# &:# "2# &# %8# *B# )@#  %8!#" !0##$ %8%#& '<'#( '<)#* )@+#, %8-#. !0/#0 %81#2 '<3#4 '<5#6 5X7#8 8^9#: 0N;#< 2R=#> /L?#@ 2RA#B (>E#%
 %	
r   c                 8    U R                   R                  U5      $ r   )r   concatenate_markdown_pages)r    markdown_lists     r   r   (PPStructureV3.concatenate_markdown_pages,  s    $$??NNr   c                     [        5       $ r   )"PPStructureV3CLISubcommandExecutor)clss    r   get_cli_subcommand_executor)PPStructureV3.get_cli_subcommand_executor/  s    133r   c                 
   0 SU R                   S   _SU R                   S   _SU R                   S   =(       d    U R                   S   _SU R                   S   _SU R                   S   _S	U R                   S	   _S
U R                   S
   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _SU R                   S   _0 SU R                   S   _SU R                   S   _SU R                   S    _S!U R                   S"   _S#U R                   S$   _S%U R                   S&   _S'U R                   S(   _S)U R                   S*   _S+U R                   S,   _S-U R                   S.   _S/U R                   S0   _S1U R                   S2   _S3U R                   S4   _S5U R                   S6   _S7U R                   S8   _S9U R                   S:   _S;U R                   S<   _E0 S=U R                   S>   _S?U R                   S@   _SAU R                   SB   _SCU R                   SD   _SEU R                   SF   _SGU R                   SH   _SIU R                   SJ   _SKU R                   SL   _SMU R                   SN   _SOU R                   SP   _SQU R                   SR   _SSU R                   ST   _SUU R                   SV   _SWU R                   SX   _SYU R                   SZ   _S[U R                   S\   _S]U R                   S^   _E0 S_U R                   S`   _SaU R                   S.   _SbU R                   S0   _ScU R                   S2   _SdU R                   S4   _SeU R                   S6   _SfU R                   S8   _SgU R                   S:   _ShU R                   S<   _SiU R                   S>   _SjU R                   S@   _SkU R                   SB   _SlU R                   SD   _SmU R                   SF   _SnU R                   SH   _SoU R                   Sp   _SqU R                   Sr   _EU R                   S2   U R                   Ss   U R                   St   U R                   Su   U R                   Sv   U R                   Sw   U R                   Sx   U R                   Sy   U R                   Sz   U R                   S{   U R                   S|   S}.En[        U5      $ )~Nz9SubPipelines.DocPreprocessor.use_doc_orientation_classifyre   z.SubPipelines.DocPreprocessor.use_doc_unwarpingrf   use_doc_preprocessorz0SubPipelines.GeneralOCR.use_textline_orientationrg   rh   ri   rj   rk   rl   rm   rn   z%SubModules.LayoutDetection.model_namer0   z$SubModules.LayoutDetection.model_dirr1   z$SubModules.LayoutDetection.thresholdr2   z%SubModules.LayoutDetection.layout_nmsr3   z.SubModules.LayoutDetection.layout_unclip_ratior4   z3SubModules.LayoutDetection.layout_merge_bboxes_moder5   z&SubModules.ChartRecognition.model_namer6   z%SubModules.ChartRecognition.model_dirr7   z&SubModules.ChartRecognition.batch_sizer8   z%SubModules.RegionDetection.model_namer9   z$SubModules.RegionDetection.model_dirr:   zISubPipelines.DocPreprocessor.SubModules.DocOrientationClassify.model_namer;   zHSubPipelines.DocPreprocessor.SubModules.DocOrientationClassify.model_dirr<   z?SubPipelines.DocPreprocessor.SubModules.DocUnwarping.model_namer=   z>SubPipelines.DocPreprocessor.SubModules.DocUnwarping.model_dirr>   z;SubPipelines.GeneralOCR.SubModules.TextDetection.model_namer   z:SubPipelines.GeneralOCR.SubModules.TextDetection.model_dirr?   z?SubPipelines.GeneralOCR.SubModules.TextDetection.limit_side_lenr@   z;SubPipelines.GeneralOCR.SubModules.TextDetection.limit_typerA   z7SubPipelines.GeneralOCR.SubModules.TextDetection.threshrB   z;SubPipelines.GeneralOCR.SubModules.TextDetection.box_threshrC   z=SubPipelines.GeneralOCR.SubModules.TextDetection.unclip_ratiorD   zASubPipelines.GeneralOCR.SubModules.TextLineOrientation.model_namerE   z@SubPipelines.GeneralOCR.SubModules.TextLineOrientation.model_dirrF   zASubPipelines.GeneralOCR.SubModules.TextLineOrientation.batch_sizerG   z=SubPipelines.GeneralOCR.SubModules.TextRecognition.model_namer   z<SubPipelines.GeneralOCR.SubModules.TextRecognition.model_dirrH   z=SubPipelines.GeneralOCR.SubModules.TextRecognition.batch_sizerI   z?SubPipelines.GeneralOCR.SubModules.TextRecognition.score_threshrJ   zGSubPipelines.TableRecognition.SubModules.TableClassification.model_namerK   zFSubPipelines.TableRecognition.SubModules.TableClassification.model_dirrL   zRSubPipelines.TableRecognition.SubModules.WiredTableStructureRecognition.model_namerM   zQSubPipelines.TableRecognition.SubModules.WiredTableStructureRecognition.model_dirrN   zUSubPipelines.TableRecognition.SubModules.WirelessTableStructureRecognition.model_namerO   zTSubPipelines.TableRecognition.SubModules.WirelessTableStructureRecognition.model_dirrP   zLSubPipelines.TableRecognition.SubModules.WiredTableCellsDetection.model_namerQ   zKSubPipelines.TableRecognition.SubModules.WiredTableCellsDetection.model_dirrR   zOSubPipelines.TableRecognition.SubModules.WirelessTableCellsDetection.model_namerS   zNSubPipelines.TableRecognition.SubModules.WirelessTableCellsDetection.model_dirrT   zLSubPipelines.TableRecognition.SubModules.TableOrientationClassify.model_namerU   zKSubPipelines.TableRecognition.SubModules.TableOrientationClassify.model_dirrV   zYSubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.model_namezXSubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.model_dirz]SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.limit_side_lenzYSubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.limit_typezUSubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.threshzYSubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.box_threshz[SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextDetection.unclip_ratioz_SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextLineOrientation.model_namez^SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextLineOrientation.model_dirz_SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextLineOrientation.batch_sizez[SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextRecognition.model_namezZSubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextRecognition.model_dirz[SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextRecognition.batch_sizez]SubPipelines.TableRecognition.SubPipelines.GeneralOCR.SubModules.TextRecognition.score_threshzUSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.model_namerW   zTSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.model_dirrX   rZ   r[   r\   r]   r^   r_   r`   rb   rc   rd   )zYSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.limit_side_lenzUSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.limit_typezQSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.threshzUSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.box_threshzWSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextDetection.unclip_ratiozWSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextRecognition.model_namezVSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextRecognition.model_dirzWSubPipelines.SealRecognition.SubPipelines.SealOCR.SubModules.TextRecognition.batch_sizezHSubPipelines.FormulaRecognition.SubModules.FormulaRecognition.model_namezGSubPipelines.FormulaRecognition.SubModules.FormulaRecognition.model_dirzHSubPipelines.FormulaRecognition.SubModules.FormulaRecognition.batch_size)r-   r   )r    	STRUCTUREs     r   _get_paddlex_config_overrides+PPStructureV3._get_paddlex_config_overrides3  s   [
G.J[
 =dll#?	[
 #DLL1O$P %1||/0[
 ?*A[
 #DLL1G$H[
 $T\\2I%J[
 &t||4M'N[
 $T\\2I%J[
  #DLL1G$H![
" #DLL1G$H#[
$ %dll3K&L%[
& 4T\\-6'[
, 3DLL,5-[
2 3DLLAS4T3[
4 4T\\,5O5[
6 =dll%?7[
< B4<<*D=[
B 5dll.7C[
H 4T\\-6I[
N 5dll.7O[
T 4T\\-6U[
Z 3DLL,5[[
` XY]YeYe5Za[
f WX\XdXd4Yg[
l Nt||*Pm[
r Mdll)Os[
x J4<<+Ly[
~ I$,,*K[
D Nt||)PE[
J J4<<%LK[
P Ft||!HQ[
V J4<<%LW[
\ LT\\'N][
b PQUQ]Q]1Rc[
h OPTP\P\0Qi[
n PQUQ]Q]1Ro[
t LT\\-Nu[
z KDLL,M{[
@ LT\\-NA[
F Nt||'PG[
L VW[WcWc1XM[
R UVZVbVb0WS[
X abfbnbn>cY[
^ `aeamam=b_[
d deieqeqAfe[
j cdhdpdp@ek[
p [\`\h\h8]q[
v Z[_[g[g7\w[
| ^_c_k_k;`}[
B ]^b^j^j:_C[
H [\`\h\h7]I[
N Z[_[g[g6\O[
T himiuiu+jU[
Z ghlhtht*i[[
` lmqmymy)na[
f himiuiu%jg[
l deieqeq!fm[
r himiuiu%js[
x jkokwkw'ly[
~ noso{o{1p[
D mnrnznz0oE[
J noso{o{1pK[
P jkokwkw-lQ[
V ijnjvjv,kW[
\ jkokwkw-l][
b lmqmymy'nc[
h deieqeq0fi[
n cdhdpdp/eo[
t jniuiu)j fjeqeq%f bfamam!b fjeqeq%f hlgsgs'h hlgsgs2h gkfrfr1g hlgsgs2h Y]XdXd0Y X\WcWc/X Y]XdXd0Yq[
	x ,I66r   c                    / SQn/ SQn/ SQn/ SQn/ SQn/ SQnUc  SnUc'  U/ SQU-   U-   ;   a  S	nOUUU-   U-   U-   U-   ;   a  S
nOgUS	:X  aC  Su  pUS;   a  Sn
O*X;   a  Sn	O"X;   a  Sn	OUS:X  a  Sn	OUS:X  a  Sn	OUS:X  a  Sn	U	b  U	 S3n
SU
4$ US:X  a  US:X  a  gUS:X  a  ggS n	X;   a  Sn	OX;   a  Sn	OX;   a  Sn	OX;   a  Sn	OX;   a  Un	S n
U	S:X  a  Sn
SU
4$ U	b  U	 S3n
SU
4$ )N)*afazbscscydadeesetfrgahrhuidisitkulaltlvmimsmtnlnoocpiplptrors_latinskslsqsvswtltruzvifrenchgerman)arfaugur)rubeuk)r   rs_cyrillicr   bgr   mnabqadykbdavadarinhchelbeleztab)himrnebhmaiangbhomahscknewgomsabgc)chenkoreanjapanchinese_chttekatar   )r   r   r   r   r   thelr   r   )NN)r   r   r   r   zPP-OCRv5_server_reclatineslavr   r   r   z_PP-OCRv5_mobile_reczPP-OCRv5_server_detr   )PP-OCRv4_mobile_detzPP-OCRv4_mobile_recr   )r   zen_PP-OCRv4_mobile_recarabiccyrillic
devanagarizPP-OCRv3_mobile_recz_PP-OCRv3_mobile_reczPP-OCRv3_mobile_detr   )r    ro   ppocr_versionLATIN_LANGSARABIC_LANGSESLAV_LANGSCYRILLIC_LANGSDEVANAGARI_LANGSSPECIFIC_LANGSrec_langrr   s              r   r&   "PPStructureV3._get_ocr_model_names  s   +
X 0(
$
	
 <D M
 !+ ! ## !	! !+ "J&'1$H;;!6$"$"!##$,:-A!B(.88j(t|CF! H""%#'%)')#H!N4!6 ).88 %$,:-A!B(.88r   )r-   )CNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)__name__
__module____qualname____firstlineno__r/   propertyrx   r   r   r   classmethodr   r   r&   __static_attributes____classcell__)rt   s   @r   r   r      s    %)#' !%%)$(%)$(#',0+/!% $"&!% $  "(,'+(,$(#'$("(,'+59488<7;/3.22615.2-1'+&* $  ")-(,)-"'+&*'+%)!%!" $"!!#In#`     &*!%!" $"!! !% $  "" $  "",1/4'+)-&+)-#GI
^ &*!%!" $"!! !% $  "" $  "",1/4'+)-&+)-#GK
ZO 4 4]7~`9 `9r   r   c                   0    \ rS rSr\S 5       rS rS rSrg)r   i  c                     g)Npp_structurev3r   rw   s    r   subparser_name1PPStructureV3CLISubcommandExecutor.subparser_name  rz   r   c                 r
   [        U5        UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        S	S9  UR                  S
[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[
        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S [        S!S9  UR                  S"[        S#S9  UR                  S$[
        S%S9  UR                  S&[        S'S9  UR                  S([        S)S9  UR                  S*[        S+S9  UR                  S,[        S-S9  UR                  S.[        S/S9  UR                  S0[        S1S9  UR                  S2[
        S3S9  UR                  S4[        S5S9  UR                  S6[        S7S9  UR                  S8[
        S9S9  UR                  S:[        S;S9  UR                  S<[        S=S9  UR                  S>[        S?S9  UR                  S@[        SAS9  UR                  SB[        SCS9  UR                  SD[        SES9  UR                  SF[        SCS9  UR                  SG[        SHS9  UR                  SI[        SJS9  UR                  SK[        SLS9  UR                  SM[        SNS9  UR                  SO[        SPS9  UR                  SQ[        SRS9  UR                  SS[
        STS9  UR                  SU[        SVS9  UR                  SW[        SXS9  UR                  SY[        SZS9  UR                  S[[        S\S9  UR                  S][        S^S9  UR                  S_[        S`S9  UR                  Sa[
        SbS9  UR                  Sc[        SdS9  UR                  Se[        SfS9  UR                  Sg[        ShS9  UR                  Si[
        SjS9  UR                  Sk[        SlS9  UR                  Sm[        SnS9  UR                  So[        SpS9  UR                  Sq[        SrS9  UR                  Ss[        StS9  UR                  Su[        SvS9  UR                  Sw[        SxS9  UR                  Sy[        SzS9  UR                  S{[        S|S9  UR                  S}[        S~SS9  g )Nz--layout_detection_model_namez#Name of the layout detection model.)typehelpz--layout_detection_model_dirz-Path to the layout detection model directory.z--layout_thresholdz/Score threshold for the layout detection model.z--layout_nmsz'Whether to use NMS in layout detection.z--layout_unclip_ratioz+Expansion coefficient for layout detection.z--layout_merge_bboxes_modez!Overlapping box filtering method.z--chart_recognition_model_namez$Name of the chart recognition model.z--chart_recognition_model_dirz.Path to the chart recognition model directory.z--chart_recognition_batch_sizez+Batch size for the chart recognition model.z--region_detection_model_namez#Name of the region detection model.z--region_detection_model_dirz-Path to the region detection model directory.z%--doc_orientation_classify_model_namez<Name of the document image orientation classification model.z$--doc_orientation_classify_model_dirzFPath to the document image orientation classification model directory.z--doc_unwarping_model_namez'Name of the text image unwarping model.z--doc_unwarping_model_dirz,Path to the image unwarping model directory.z--text_detection_model_namez!Name of the text detection model.z--text_detection_model_dirz+Path to the text detection model directory.z--text_det_limit_side_lenzUThis sets a limit on the side length of the input image for the text detection model.z--text_det_limit_typezxThis determines how the side length limit is applied to the input image before feeding it into the text deteciton model.z--text_det_threshzDetection pixel threshold for the text detection model. Pixels with scores greater than this threshold in the output probability map are considered text pixels.z--text_det_box_threshzDetection box threshold for the text detection model. A detection result is considered a text region if the average score of all pixels within the border of the result is greater than this threshold.z--text_det_unclip_ratiozText detection expansion coefficient, which expands the text region using this method. The larger the value, the larger the expansion area.z!--textline_orientation_model_namez7Name of the text line orientation classification model.z --textline_orientation_model_dirz;Path to the text line orientation classification directory.z!--textline_orientation_batch_sizez>Batch size for the text line orientation classification model.z--text_recognition_model_namez#Name of the text recognition model.z--text_recognition_model_dirz-Path to the text recognition model directory.z--text_recognition_batch_sizez*Batch size for the text recognition model.z--text_rec_score_threshzrText recognition threshold used in general OCR. Text results with scores greater than this threshold are retained.z!--table_classification_model_namez'Name of the table classification model.z --table_classification_model_dirz1Path to the table classification model directory.z.--wired_table_structure_recognition_model_namez4Name of the wired table structure recognition model.z---wired_table_structure_recognition_model_dirz>Path to the wired table structure recognition model directory.z1--wireless_table_structure_recognition_model_namez7Name of the wireless table structure recognition model.z0--wireless_table_structure_recognition_model_dirz(--wired_table_cells_detection_model_namez.Name of the wired table cells detection model.z'--wired_table_cells_detection_model_dirz8Path to the wired table cells detection model directory.z+--wireless_table_cells_detection_model_namez1Name of the wireless table cells detection model.z*--wireless_table_cells_detection_model_dirz;Path to the wireless table cells detection model directory.z --seal_text_detection_model_namez&Name of the seal text detection model.z--seal_text_detection_model_dirz0Path to the seal text detection model directory.z--seal_det_limit_side_lenzZThis sets a limit on the side length of the input image for the seal text detection model.z--seal_det_limit_typez}This determines how the side length limit is applied to the input image before feeding it into the seal text deteciton model.z--seal_det_threshzDetection pixel threshold for the seal text detection model. Pixels with scores greater than this threshold in the output probability map are considered text pixels.z--seal_det_box_threshzDetection box threshold for the seal text detection model. A detection result is considered a text region if the average score of all pixels within the border of the result is greater than this threshold.z--seal_det_unclip_ratiozSeal text detection expansion coefficient, which expands the text region using this method. The larger the value, the larger the expansion area.z"--seal_text_recognition_model_namez(Name of the seal text recognition model.z!--seal_text_recognition_model_dirz2Path to the seal text recognition model directory.z"--seal_text_recognition_batch_sizez/Batch size for the seal text recognition model.z--seal_rec_score_threshzcSeal text recognition threshold. Text results with scores greater than this threshold are retained.z --formula_recognition_model_namez&Name of the formula recognition model.z--formula_recognition_model_dirz0Path to the formula recognition model directory.z --formula_recognition_batch_sizez-Batch size for the formula recognition model.z--use_doc_orientation_classifyz9Whether to use document image orientation classification.z--use_doc_unwarpingz$Whether to use text image unwarping.z--use_textline_orientationz4Whether to use text line orientation classification.z--use_seal_recognitionz Whether to use seal recognition.z--use_table_recognitionz!Whether to use table recognition.z--use_formula_recognitionz#Whether to use formula recognition.z--use_chart_recognitionz!Whether to use chart recognition.z--use_region_detectionz Whether to use region detection.z--format_block_contentz,Whether to format block content to Markdown.z--markdown_ignore_labels+z3List of layout labels to ignore in Markdown output.)r  nargsr  )r   add_argumentstrfloatr   int)r    	subparsers     r   _update_subparser4PPStructureV3CLISubcommandExecutor._update_subparser  s   !),+6 	 	

 	*@ 	 	

 	 B 	 	

 	: 	 	

 	#> 	 	

 	(4 	 	
 	,7 	 	

 	+A 	 	

 	,> 	 	
 	+6 	 	

 	*@ 	 	
 	3O 	 	

 	2Y 	 	

 	(: 	 	

 	'? 	 	
 	)4 	 	

 	(> 	 	

 	'h 	 	

 	# L 	 	

 	 t 	 	

 	# [ 	 	

 	% _ 	 	

 	/J 	 	

 	.N 	 	

 	/Q 	 	

 	+6 	 	

 	*@ 	 	

 	+= 	 	

 	% F 	 	
 	/: 	 	

 	.D 	 	

 	<G 	 	

 	;Q 	 	

 	?J 	 	

 	>Q 	 	

 	6A 	 	

 	5K 	 	

 	9D 	 	

 	8N 	 	
 	.9 	 	

 	-C 	 	

 	'm 	 	

 	# Q 	 	

 	 y 	 	

 	# ` 	 	

 	% d 	 	

 	0; 	 	

 	/E 	 	

 	0B 	 	

 	%v 	 	
 	.9 	 	

 	-C 	 	

 	.@ 	 	
 	,L 	 	

 	!7 	 	

 	(G 	 	

 	$3 	 	

 	%4 	 	

 	'6 	 	

 	%4 	 	

 	$3 	 	
 	$? 	 	

 	&F	 	 	
r   c                 :    [        U5      n[        [        U5        g r   )r   r   r   )r    argsrs   s      r   execute_with_args4PPStructureV3CLISubcommandExecutor.execute_with_args  s    $T* 	
r   r   N)	r   r   r  r  r  r
  r  r  r  r   r   r   r   r     s        G
R

r   r   )r(   
_utils.clir   r   r   r   baser	   r
   utilsr   _patch_layout_parsingr   _apply_layout_parsing_patchesr"   r   r   r   r   r   <module>r!     sK      H / Q  > S
9* S
9lS
)F S
r   