
    9i                     >    S SK Jr  S SKrSSKJrJr   " S S\5      rg)    )DictN   )BaseCVResult	JsonMixinc                   t    \ rS rSrSrS\\\R                  4   4S jr	S\\\4   4S jr
S\\\4   4S jrSrg)	SealRecognitionResult   zSeal Recognition Resultreturnc                 8   0 nU S   n[        U5      S:  a  UR                  S   US'   U S   nUS   (       a  UR                  " S0 U S   R                  D6  [        [        U S   5      5       H(  nU S   U   nUS   nUR                  nS	U 3nUS
   X'   M*     U$ )Nlayout_det_resr   resmodel_settingsuse_doc_preprocessordoc_preprocessor_resseal_res_listseal_region_idseal_res_regionocr_res_img )lenimgupdaterange)	selfres_img_dictr   r   snoseal_resr   sub_seal_res_dictkeys	            s/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/paddlex/inference/pipelines/seal_recognition/result.py_to_imgSealRecognitionResult._to_img   s    ./~"-;-?-?-FL)*./01C$'=">"B"BCT/234CO,S1H%&67N (#N#34C 1- @L 5     c                    0 nU S   US'   U S   US'   U S   S   (       a  U S   R                   S   US'   [        U S   5      S:  a  U S   R                   S   US'   / US'   [        [        U S   5      5       H,  nU S   U   nUS   R                  UR                   S   5        M.     [        R
                  " U/UQ70 UD6$ )	aH  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[str, str]: A dictionary with the instance's attributes converted to strings.

input_pathr   r   r   r   r   r   r   )strr   r   appendr   _to_strr   argskwargsdatar   r   s         r    r(   SealRecognitionResult._to_str+   s     !,/\!%&6!7 !"89+/0F+G+K+KE+RD'(t$%&*%)*:%;%?%?%FD!" "_T/234CO,S1H!((e)<= 5   7777r#   c                    0 nU S   US'   U S   US'   U S   US'   U S   S   (       a  U S   R                   S   US'   [        U S   5      S:  a  U S   R                   S   US'   / US	'   [        [        U S	   5      5       H,  nU S	   U   nUS	   R                  UR                   S   5        M.     [        R
                  " U/UQ70 UD6$ )
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[str, str]: A dictionary containing the object's data in JSON format.
r%   
page_indexr   r   r   r   r   r   r   )jsonr   r   r'   r   _to_jsonr)   s         r    r1   SealRecognitionResult._to_jsonB   s     !,/\!,/\!%&6!7 !"89+/0F+G+L+LU+SD'(t$%&*%)*:%;%@%@%GD!" "_T/234CO,S1H!((u)=> 5 !!$8888r#   r   N)__name__
__module____qualname____firstlineno____doc__r   r&   npndarrayr!   r(   r1   __static_attributes__r   r#   r    r   r      sF    !c2::o. $8$sCx. 8.94S> 9r#   r   )typingr   numpyr8   common.resultr   r   r   r   r#   r    <module>r>      s      4C9L C9r#   