
    Ցix              	      \   S SK Jr  S SKrS SKJr  S SKrS SKJrJ	r	  SSK
Jr  SSKJrJr  SSKJr  S	S
KJrJrJrJrJrJr  SSKJrJrJrJrJrJrJrJ r   SSK!J"r"J#r#  / SQr$\" S5      (       a  S SK%r% " S S\&5      r'S r(S r)S r*S r+\" S5       " S S\\\\5      5       r, " S S\,5      r-g)    )annotationsN)partial)Image	ImageDraw   )logging)class_requires_depsis_dep_available)SIMFANG_FONT   )BaseCVResult
BaseResult	HtmlMixin	JsonMixinMarkdownMixin	XlsxMixin   )format_centered_by_htmlformat_first_line_funcformat_image_plain_func format_image_scaled_by_html_funcformat_para_title_funcformat_text_plain_funcformat_title_funcsimplify_table_func)draw_box_txt_fineget_minarea_rect)figure_titlevision_footnoteimagecharttableheaderheader_imagefooterfooter_imagefootnote
aside_textzopencv-contrib-pythonc                  F    \ rS rSrSr     S S	S jjrS
S jrS
S jrSrg)PaddleOCRVLBlock@   zPaddleOCRVL Block ClassNc                    Xl         [        [        [        U5      5      U l        X0l        SU l        XPl        X@l        X`l	        Xpl
        g)z
Initialize a PaddleOCRVLBlock object.

Args:
    label (str): Label assigned to the block.
    bbox (list): Bounding box coordinates of the block.
    content (str, optional): Content of the block. Defaults to an empty string.
N)labellistmapintbboxcontentr    polygon_pointsgroup_idglobal_block_idglobal_group_id)selfr-   r1   r2   r4   r3   r5   r6   s           o/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/paddlex/inference/pipelines/paddleocr_vl/result.py__init__PaddleOCRVLBlock.__init__C   s>    $ 
S$(	
, ..    c                Z    SU R                    SU R                   SU R                   S3nU$ z.
Return a string representation of the block.
z

#################
label:	z
bbox:	z

content:	z
#################r-   r1   r2   r7   _strs     r8   __str__PaddleOCRVLBlock.__str__^   5     1Idii[P\]a]i]i\jj}~r;   c                Z    SU R                    SU R                   SU R                   S3nU$ r=   r>   r?   s     r8   __repr__PaddleOCRVLBlock.__repr__e   rC   r;   )r1   r2   r5   r6   r4   r    r-   r3   ) NNNNreturnNone)rI   str)	__name__
__module____qualname____firstlineno____doc__r9   rA   rE   __static_attributes__ r;   r8   r*   r*   @   s/    ! / 
/6r;   r*   c                T    U R                  SS5      n SR                  X5      nSU S3$ )z
Merge a formula and its formula number for display.

Args:
    formula (str): The formula string.
    formula_number (str): The formula number string.

Returns:
    str: The merged formula with tag.
z$$rG   z{} \tag*{{{}}})replaceformat)formulaformula_numbermerge_formulas      r8   merge_formula_and_numberrY   m   s3     oodB'G%,,WEMb!!r;   c                l   U R                   R                  S5      nUS   R                  S5      nUSS   Vs/ s H  o3R                  S5      PM     nnSnUSSR                  S U 5       5      -   S	-   -  nUS
-  nU H$  nUSSR                  S U 5       5      -   S-   -  nM&     US-  nUS-  nU$ s  snf )N
r   |   z;<table border=1 style='margin: auto; width: max-content;'>
z  <thead><tr>rG   c              3  J   #    U  H  nS UR                  5        S3v   M     g7f)z <th style='text-align: center;'>z</th>Nstrip.0cells     r8   	<genexpr>*format_chart2table_func.<locals>.<genexpr>   s#      
OUt.tzz|nEBv   !#z</tr></thead>
z
  <tbody>
z    <tr>c              3  J   #    U  H  nS UR                  5        S3v   M     g7f)z <td style='text-align: center;'>z</td>Nr_   ra   s     r8   rd   re      s$      SV424::<.FSVrf   z</tr>
z  </tbody>
z</table>)r2   splitjoin)block
lines_listr#   linerowshtmlrows          r8   format_chart2table_funcrp   }   s    $$T*J]  %F(2127JJsOD7ID
'' 
OU
 
	
 		D 	MDgg SV  		
  	NDJDK+ 8s   B1c                    U R                   nUR                  SS5      nUR                  SS5      nUR                  SS5      nU$ )Nz<table>z=<table border=1 style='margin: auto; word-wrap: break-word;'>z<th>z7<th style='text-align: center; word-wrap: break-word;'>z<td>z7<td style='text-align: center; word-wrap: break-word;'>r2   rT   )rj   tabel_contents     r8   format_table_center_funcrt      sY    MMM!))RM "))IM "))IM r;   c                .   0 S[         _S[        _S[        _S[        _SS _SU _SU _S	U _S
S _SS _SS _SS _SS _S[        [        SS/S SS9_SS _SU_SU_UUUU[        [        SS/S S S9S! US" [        [        [        U[        U[        S#.E$ )$a  
Build a dictionary mapping block labels to their formatting functions.

Args:
    text_func: Function to format text blocks.
    image_func: Function to format image blocks.
    chart_func: Function to format chart blocks.
    table_func: Function to format table blocks.
    formula_func: Function to format formula blocks.
    seal_func: Function to format seal blocks.

Returns:
    dict: A mapping from block label to handler function.
paragraph_titleabstract_titlereference_titlecontent_title	doc_titlec                `    SU R                    3R                  SS5      R                  SS5      $ )Nz# -
rG   r[    rr   rj   s    r8   <lambda>)build_handle_funcs_dict.<locals>.<lambda>   s,    R#7#?#?r#J#R#R#$
r;   table_titler   chart_titler   c                Z    U R                   R                  SS5      R                  SS5      $ N

r[   rr   r~   s    r8   r   r      s%    )>)>vt)L)T)T&*
r;   textc                Z    U R                   R                  SS5      R                  SS5      $ r   rr   r~   s    r8   r   r      s#    emm33FDAII$PVWr;   ocrc                Z    U R                   R                  SS5      R                  SS5      $ r   rr   r~   s    r8   r   r      s"    U]]2264@HHvVr;   vertical_textc                Z    U R                   R                  SS5      R                  SS5      $ r   rr   r~   s    r8   r   r      s%    u}}'<'<VT'J'R'R&(
r;   reference_contentc                Z    U R                   R                  SS5      R                  SS5      $ r   rr   r~   s    r8   r   r      s%    5==+@+@+N+V+V&,
r;   abstractu   摘要c                    SU  S3$ )N## r[   rR   ls    r8   r   r      s    Cs"+r;   r}   )	templatesformat_funcspliterr2   c                Z    U R                   R                  SS5      R                  SS5      $ )Nr|   z  
r[   rr   r~   s    r8   r   r      s%    !6!6uf!E!M!M&"
r;   r    r!   u   参考文献
referencesc                    SU  3$ )Nr   rR   r   s    r8   r   r      s
    Cs)r;   r[   c                8    U R                   R                  S5      $ Nr[   )r2   r`   r~   s    r8   r   r      s    5==#6#6t#<r;   c                    U R                   $ Nr2   r~   s    r8   r   r      s    %--r;   )rV   display_formulainline_formular"   	reference	algorithmsealspottingnumberr'   r#   r$   r%   r&   r(   )r   r   r   r   r   	text_func
image_func
chart_func
table_funcformula_func	seal_funcs         r8   build_handle_funcs_dictr      sO   .515+5 	,5 	*	5
 	 
5 	y5 		5 	y5 	 
5 	W5 	V5  	 
!5& 	 
'5, 	G",-	
-58 	 
95> 	?5@ 	A5B  '&"%|4+	
 =/(*("(",i5 5r;   c                  p   ^  \ rS rSrSrSU 4S jjrSS jrSS jrSS jrSS jr	SS jr
SSS	 jjrS
rU =r$ )PaddleOCRVLResult   zL
PaddleOCRVLResult class for holding and formatting OCR/VL parsing results.
c                `  > [         TU ]  U5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [
        R                  " U 5        U S   R                  S/ 5      n[        R                  5       U-    Vs/ s H  o3PM     snU l	        gs  snf )zz
Initializes a new instance of the class with the specified data.

Args:
    data: The input data for the parsing result.
model_settingsmarkdown_ignore_labelsN)
superr9   r   r   r   r   getSKIP_ORDER_LABELScopyskip_order_labels)r7   datar   r-   	__class__s       r8   r9   PaddleOCRVLResult.__init__   s     	4 4 t$4 !%&6!7!;!;$b"
  1557:PP"
PeEP"
 "
s   B+c           
     R
   0 nU S   nUS   (       a  [        U S   [        5      (       a*  U S   R                  R                  5        H	  u  p4XAU'   M     [        U S   [        5      (       aZ  [        U S   5       HH  u  pV[        U[        5      (       d  M  UR                  R                  5        H  u  p4XAU SU 3'   M     MJ     U S   S   (       a  [        U S   [        5      (       a  U S   R                  S   US'   [        U S   [        5      (       aC  [        U S   5       H1  u  pW[        U[        5      (       d  M  UR                  S   USU 3'   M3     U R                  S	5      (       Ga  [        U S	   [        5      (       Gd  U R                  S5      (       Gap  U S	   S
   nU S	   S   n	U S   S   SS2SS2SSS24   n
U
R                  SS u  p[        R                  " U
5      n[        R                  " XS4[        R                  S9S-  n[        R                  " S5        [        R                   " U5      n["        n[        [%        X5      5       GH!  u  nu  nn [        R&                  " SS5      [        R&                  " SS5      [        R&                  " SS5      4n[        R(                  " U5      n[+        U5      S:  a  UR-                  5        VVs/ s H
  u  nnUU4PM     nnnUR/                  UUSUS9  [1        U5      n[3        S[5        USS2S4   5      [7        USS2S4   5      -
  -  5      n[        R8                  " USS2S4   5      USS2S4'   [        R8                  " USS2S4   5      [7        SU5      -   USS2S4'   OIUR-                  5        VVs/ s H  u  nn[3        U5      [3        U5      4PM     nnnUR/                  UUS9  [        U[:        5      (       a  US   n[=        X4UUUR>                  5      n[        R(                  " U[        R@                  5      RC                  S5      n[D        RF                  " UU/SUS5        [D        RH                  " UU5      nGM$     [        RJ                  " [        R                  " U
5      US5      n[        RL                  " SUS-  U4S5      nURO                  USSX45        URO                  [        R                  " U5      USUS-  U45        UUS'   U$ s  snnf s  snnf !    GM  = f) z}
Convert the parsing result to a dictionary of images.

Returns:
    dict: Keys are names, values are numpy arrays (images).
r   use_doc_preprocessordoc_preprocessor_res_use_layout_detectionlayout_det_resreslayout_det_res_spotting_res	rec_polys	rec_texts
output_imgNr   r   r   )dtype   r      )outlinewidthfillg      ?r]      )r   )r   r]   r   TRGB)r   r   r   spotting_res_img)(
isinstancer   imgitemsr.   	enumerater   shaper   	fromarraynponesuint8randomseedr   Drawr   ziprandintarraylentolistpolygonr   r0   maxminmeantupler   pathint32reshapecv2	polylinesbitwise_andblendnewpaste)r7   res_img_dictr   keyvalueidxr   
layout_resboxestxtsr    hwimg_left	img_right	draw_leftvis_fontboxtxtcolorxyptsheightbox_ptsimg_right_textimg_shows                              r8   _to_imgPaddleOCRVLResult._to_img  s    ./01$56
CC"&'=">"B"B"H"H"JJC(-% #K$56==1:/02-C ""6
CC*>*B*B*H*H*JJC;@C5#8 +K	2  !"89$/0*==156F1G1K1KE1R-.$/0$77'06F1G'HOC!*j99@Ju@Use%<= (I
 HH^$$tN3T::/00(5E'4D/0>q!TrTzJE;;q#DAu-Hq	:S@IKKN!x0I#H#,S-=#>Zc3q#.q#.q#.E
 ((3-C3x!|25**,?,$!Q1v,?!))#uAE)R.s3!$SCAqD	NSQT^,K%L!M%'WWSAY%7BQBE
%'WWSAY%7#b&/%IABE
@C

"M1CFCF#3"M!))')>!#u--!!f%6vsC%WN((3199*ECMM.3%uaH #	> JI/ $?6 {{5??5#98SIHyyQ
ODHNN8aA\2NN5??951a!eQ7GH/7L+,3 @ #Ns-   'A<T #T4B:T .#TB,T T  T&c                    0 nU R                  S5      (       aS  [        U S   5      S:  aA  [        [        U S   5      5       H&  nU S   U   nUS   nSU 3nUR                  S   X'   M(     U$ )z
Converts the prediction to its corresponding HTML representation.

Returns:
    dict: The str type HTML representation result.
table_res_listr   table_region_idtable_pred)r   r   rangern   )r7   res_html_dictsno	table_resr  r   s         r8   _to_htmlPaddleOCRVLResult._to_htmla       88$%%#d3C.D*E*IS&6!789 !1237	"+,=">/0%.^^F%;"	 :
 r;   c                    0 nU R                  S5      (       aS  [        U S   5      S:  aA  [        [        U S   5      5       H&  nU S   U   nUS   nSU 3nUR                  S   X'   M(     U$ )zq
Converts the prediction HTML to an XLSX file path.

Returns:
    dict: The str type XLSX representation result.
r
  r   r  r  r  )r   r   r  xlsx)r7   res_xlsx_dictr  r  r  r   s         r8   _to_xlsxPaddleOCRVLResult._to_xlsxq  r  r;   c                ,   0 nU S   US'   U S   US'   U S   US'   U S   US'   U S   US'   U S   nXCS'   U S   S   (       a6  [        U S   [        5      (       a  U S   R                  S	   US'   OU S   US'   U S   S
   (       a6  [        U S   [        5      (       a  U S   R                  S	   US'   OU S   US'   U S   nU Vs/ s H'  nUR                  UR                  UR
                  S.PM)     nnXSS'   [        R                  " U/UQ70 UD6$ s  snf )a?  
Converts the instance's attributes to a dictionary and then to a string.

Args:
    *args: Additional positional arguments passed to the base class method.
    **kwargs: Additional keyword arguments passed to the base class method.

Returns:
    dict: A dictionary with the instance's attributes converted to strings.

input_path
page_index
page_countr   r  r   r   r   r   r   r   parsing_res_list)block_labelblock_content
block_bbox)r   r   rK   r-   r2   r1   r   _to_str)r7   argskwargsr   r   r  parsing_ress          r8   r"  PaddleOCRVLResult._to_str  s}    !,/\!,/\!,/\WWhX./!/ !"89$56
CC/34J/K/O/OPU/V+,/34J/K+, !"89$/0*==)-.>)?)C)CE)J%&)-.>)?%& 23  0
  0	  +00!,!4!4)..
  0 	 
 $4   7777
s   .Dc           	       ^^^ UR                  SS5      n0 nU S   US'   U S   US'   U S   US'   U S   US'   U S   US'   U S   nXTS'   U S   R                  S	S5      mU S   R                  S
S5      (       a~  U S   mU S   R                  SS5      mS nUU4S jnUU4S jnU S   R                  SS5      (       a  [        n	OUn	U S   R                  SS5      (       d  UnS n
S n[        UUU	U
UUS9nU S   n/ nSn[	        U5       GHy  u  nnUR
                  nUU R                  ;  a  UnUS-  nOSnUR
                  UR                  UR                  UUUR                  b  UR                  OUS.n[        US5      (       a  UR                  b  UR                  US'   [        US5      (       a  UR                  b  UR                  US'   UR                  b  UR                  US'   U(       a  UR                  b  UR                  US'   U S   R                  S
S5      (       aH  WR                  UR
                  5      (       a  UUR
                     " U5      US'   OUR                  US'   UR                  U5        GM|     XS'   U R                  S5      (       a:  [!        U S   ["        5      (       a  U S    Vs/ s H  nUPM     snUS'   OU S   US'   U S   S   (       a  [!        U S   [$        5      (       a  U S   R&                  S    US'   Oz[!        U S   ["        5      (       aZ  / nU S    HI  n[!        U[$        5      (       a   UR                  UR&                  S    5        M8  UR                  U5        MK     UUS'   OU S   US'   U S   S   (       a  [!        U S!   [$        5      (       a  U S!   R&                  S    US!'   Oz[!        U S!   ["        5      (       aZ  / nU S!    HI  n[!        U[$        5      (       a   UR                  UR&                  S    5        M8  UR                  U5        MK     UUS!'   OU S!   US!'   [(        R*                  " U/UQ70 UD6$ s  snf )"a  
Converts the object's data to a JSON dictionary.

Args:
    *args: Positional arguments passed to the JsonMixin._to_json method.
    **kwargs: Keyword arguments passed to the JsonMixin._to_json method.

Returns:
    dict: A dictionary containing the object's data in JSON format.
keep_imgFr  r  r  r   r  r   use_seal_recognitionformat_block_contentuse_ocr_for_image_blockc                *    [        [        U 5      5      $ r   r   r   r~   s    r8   r   ,PaddleOCRVLResult._to_json.<locals>.<lambda>      -D&u-.r;   c                4   > [        [        U TTS9T(       + S9$ Noriginal_image_widthshow_ocr_contentremove_symbolr   r   rj   r3  r+  s    r8   r   r.    $    .E0)=%<
 #:9/r;   c                4   > [        [        U TSS9T(       + S9$ )NTr2  r5  r7  rj   r3  r)  s    r8   r   r.    s$    -D0)=%)
 #76.r;   use_chart_recognitionr   c                    S[        U 5      -   $ r   rt   r~   s    r8   r   r.        d5Me5T.Tr;   c                    U R                   $ r   r   r~   s    r8   r   r.    s    r;   r   r  r]   N)r  r   r!  block_idblock_orderr4   r5   r6   block_polygon_pointsr    r   r   r   r   r   r   )popr   rp   r   r   r-   r   r2   r1   r4   hasattrr5   r6   r3   r    appendr   r.   r   jsonr   _to_json)r7   r#  r$  	_keep_imgr   r   format_text_funcformat_image_funcformat_seal_funcformat_chart_funcformat_table_funcformat_formula_funchandle_funcs_dictr  parsing_res_list_jsonorder_indexr   r%  r-   orderres_dictr   r   r   r3  r+  r)  s                           @@@r8   rH  PaddleOCRVLResult._to_json  s    JJz51	!,/\!,/\!,/\WWhX./!/#$4599:PRWX !%%&<eDD#'= &*+;&<&@&@)5'# !  $%))*A5II$;!$5!()--.DeLL#3  T"= 7*,,,0*!   23 " )*: ;C%%ED222#q *00!,!4!4)..$,7,@,@,LK((RU	H %677//;.9.I.I*+%677//;.9.I.I*+))53>3M3M/0[..:$/$5$5!$%))*@%HH$(():):;;0A+BSBS0T#1H_- 1<0C0CH_-!((2S !<T $9 88N##$~.557;N7K'L7K7K'L^$'+N';^$ !"89$56
CC/34J/K/P/PQV/W+,D!78$??')$ 67C!#z22,33CHHUOD,33C8	 8
 0D+,/34J/K+, !"89$/0*==)-.>)?)D)DU)K%&D!12D99!# 01C!#z22&--chhuo>&--c2	 2
 *8%&)-.>)?%&!!$8888= (Ms   Q c           	     N  ^^^ U S   R                  SS5      mU S   R                  SS5      m[        U S   [        5      (       a	  U S   S   mOU S   mU(       a  S nUU4S jnUU4S	 jnOS
 nU4S jnU4S jnU S   S   (       a  [        OUnU S   R                  SS5      (       d  UnU(       a  S nOS nS n[	        UUUUUUS9n	U S   R                  S/ 5       H  n
U	R                  U
S5        M     Sn0 n0 US'   [        U S   5       H  u  pUR                  n
UR                  b"  UR                  S   US   UR                  S   '   U	R                  U
S5      nU(       ac  U
S:X  d  U
S:X  aW  U[        U S   5      S-
  :w  aB  U S   US-      nUR                  nUS:X  a%  [        UR                  UR                  5      Ul        U(       d  M  UU(       a  SU" U5      -   OU" U5      -  nM     U S   US'   U S    US '   XS!'   U S"    H  nUS   US   US   '   M     U$ )#  
Save the parsing result to a Markdown file.

Args:
    pretty (Optional[bool]): whether to pretty markdown by HTML, default by True.
    show_formula_number (bool): whether to show formula numbers.

Returns:
    dict: Markdown information with text and images.
r   r+  Fr)  r   r   c                *    [        [        U 5      5      $ r   r-  r~   s    r8   r   0PaddleOCRVLResult._to_markdown.<locals>.<lambda>T  r/  r;   c                4   > [        [        U TTS9T(       + S9$ r1  r7  r8  s    r8   r   rY  W  r9  r;   c                *   > [        [        U TTS9SS9$ Nr2  Fr5  r7  r;  s    r8   r   rY  _  !    -D0)=%9
 $.r;   c                    U R                   $ r   r   r~   s    r8   r   rY  h      U]]r;   c                   > [        U T5      $ r   r   rj   r+  s    r8   r   rY  i      .E./r;   c                   > [        U T5      $ r   ra  rj   r)  s    r8   r   rY  l      -D+.r;   r<  r   c                    S[        U 5      -   $ r   r>  r~   s    r8   r   rY  z  r?  r;   c                2    [        SU R                  -   5      $ r   r   r2   r~   s    r8   r   rY  |      .A$BV.Wr;   c                    U R                   $ r   r   r~   s    r8   r   rY  ~      EMMr;   r   r   NrG   markdown_imagesr  r   r   r   rV   r]   rW   r   r  r  markdown_textsimgs_in_docr   r   r.   rp   r   rD  r   r-   r    r   rY   r2   r7   prettyshow_formula_numberrJ  rK  rL  rM  rN  rO  rP  r-   markdown_contentmarkdown_infor   rj   handle_func
next_blocknext_block_labelr   r3  r+  r)  s                      @@@r8   _to_markdownPaddleOCRVLResult._to_markdown>  s    #''7"8"<"<%u#
  $$4599:PRWXd7mT**#'=#3 #'=  !   ;!  $%&=> $" 	 $%))*@%HH/ T W93&(((,&
 *+//0H"ME!!%. N +-'(#D);$<=JCKKE{{&HMI/0V1DE ,//t<K#//5I3E3t$6781<<!"45cAg>
#-#3#3 #'77$<z'9'9%EM { ' [//$U+ ' >2 '+<&8l#&*<&8l#*:&'&C<?JM+,S[9 ' r;   )r   rH   )rI   zdict[str, np.ndarray])rI   zdict[str, str]TFrI   dict)rL   rM   rN   rO   rP   r9   r  r  r  r"  rH  ry  rQ   __classcell__)r   s   @r8   r   r      s7    
&M^  '8RR9ho or;   r   c                  4    \ rS rSrS rS rS rSS	S jjrSrg)
PaddleOCRVLPagesResulti  c                0    [         R                  " S5        g )Nz@The result of multi-pages don't support to save as image format!r   warningr7   r#  r$  s      r8   save_to_img"PaddleOCRVLPagesResult.save_to_img  s    N	
 r;   c                0    [         R                  " S5        g )Nz?The result of multi-pages don't support to save as html format!r  r  s      r8   save_to_html#PaddleOCRVLPagesResult.save_to_html      M	
 r;   c                0    [         R                  " S5        g )Nz?The result of multi-pages don't support to save as xlsx format!r  r  s      r8   save_to_xlsx#PaddleOCRVLPagesResult.save_to_xlsx  r  r;   c           	       ^^^ U S   R                  SS5      mU S   R                  SS5      m[        U S   [        5      (       a	  U S   S   mOU S   mU(       a  S nUU4S jnUU4S	 jnOS
 nU4S jnU4S jnU S   S   (       a  [        OUnU(       a  S nOS nS n[	        UUUUUUS9n	U S   R                  S/ 5       H  n
U	R                  U
S5        M     Sn0 n0 US'   [        U S   5       H  u  pUR                  n
UR                  b"  UR                  S   US   UR                  S   '   U	R                  U
S5      nU(       ac  U
S:X  d  U
S:X  aW  U[        U S   5      S-
  :w  aB  U S   US-      nUR                  nUS:X  a%  [        UR                  UR                  5      Ul        U(       d  M  UU(       a  SU" U5      -   OU" U5      -  nM     U S   US'   U S   US'   XS '   U S!    H  nUS   US   US   '   M     U$ )"rW  r   r+  Fr)  r   r   c                *    [        [        U 5      5      $ r   r-  r~   s    r8   r   5PaddleOCRVLPagesResult._to_markdown.<locals>.<lambda>  r/  r;   c                4   > [        [        U TTS9T(       + S9$ r1  r7  r8  s    r8   r   r    r9  r;   c                *   > [        [        U TTS9SS9$ r\  r7  r;  s    r8   r   r    r]  r;   c                    U R                   $ r   r   r~   s    r8   r   r    r_  r;   c                   > [        U T5      $ r   ra  rb  s    r8   r   r    rc  r;   c                   > [        U T5      $ r   ra  re  s    r8   r   r    rf  r;   r<  c                    S[        U 5      -   $ r   r>  r~   s    r8   r   r    r?  r;   c                2    [        SU R                  -   5      $ r   ri  r~   s    r8   r   r    rj  r;   c                    U R                   $ r   r   r~   s    r8   r   r     rl  r;   r   r   NrG   rm  r  r   r   r   rV   r]   rW   r   r  r  rn  ro  rp  rq  s                      @@@r8   ry  #PaddleOCRVLPagesResult._to_markdown  s    #''7"8"<"<%u#
  $$4599:PRWXd7mT**#'=#3 #'=  !   ;!  $%&=> $" 	  T W93&(((,&
 *+//0H"ME!!%. N +-'(#D);$<=JCKKE{{&HMI/0V1DE ,//t<K#//5I3E3t$6781<<!"45cAg>
#-#3#3 #'77$<z'9'9%EM { ' [//$U+ ' >2 '+<&8l#&*<&8l#*:&'&C<?JM+,S[9 ' r;   rR   Nr{  r|  )	rL   rM   rN   rO   r  r  r  ry  rQ   rR   r;   r8   r  r    s    l lr;   r  ).
__future__r   r   	functoolsr   numpyr   PILr   r   utilsr   
utils.depsr	   r
   utils.fontsr   common.resultr   r   r   r   r   r   layout_parsing.result_v2r   r   r   r   r   r   r   r   
ocr.resultr   r   r   r   objectr*   rY   rp   rt   r   r   r  rR   r;   r8   <module>r     s    #       @ ( 	 	 	 =  +,,*v *Z" 8"L^ ,-siM s .sl. r;   