Ë
    \;j~  ã                   óB   — d dl Z d dlmZ d adada G d„ de«      Zdd„Zy)é    Nc                   ó"   — e Zd ZdZd„ Zd„ Zd„ Zy)ÚProfilerOptionsaµ  
    Use a string to initialize a ProfilerOptions.
    The string should be in the format: "key1=value1;key2=value;key3=value3".
    For example:
      "profile_path=model.profile"
      "batch_range=[50, 60]; profile_path=model.profile"
      "batch_range=[50, 60]; tracer_option=OpDetail; profile_path=model.profile"

    ProfilerOptions supports following key-value pair:
      batch_range      - a integer list, e.g. [100, 110].
      state            - a string, the optional values are 'CPU', 'GPU' or 'All'.
      sorted_key       - a string, the optional values are 'calls', 'total',
                         'max', 'min' or 'ave.
      tracer_option    - a string, the optional values are 'Default', 'OpDetail',
                         'AllOpDetail'.
      profile_path     - a string, the path to save the serialized profile data,
                         which can be used to generate a timeline.
      exit_on_finished - a boolean.
    c                 ól   — t        |t        «      sJ ‚ddgdddddddœ| _        | j                  |«       y )	Né
   é   ÚAllÚtotalÚDefaultz/tmp/profileT)Úbatch_rangeÚstateÚ
sorted_keyÚtracer_optionÚprofile_pathÚexit_on_finishedÚ
timer_only)Ú
isinstanceÚstrÚ_optionsÚ_parse_from_string)ÚselfÚoptions_strs     úgG:\00. PROJECTS\API\Inventory\templateJSON\kerjaOCR\Lib\site-packages\paddleocr/ppocr/utils/profiler.pyÚ__init__zProfilerOptions.__init__0   sF   € Ü˜+¤sÔ+Ð+Ð+ð  ˜8ØØ!Ø&Ø*Ø $Øñ
ˆŒð 	×Ñ Õ,ó    c                 ó  — |j                  dd«      j                  d«      D ]ç  }|j                  d«      \  }}|dk(  r~|j                  dd«      j                  dd«      j                  d«      }t        t        t        |«      «      }t        |«      d	k\  sŒu|d
   d
k\  sŒ~|d   |d
   kD  sŒŠ|| j                  |<   Œš|dk(  r |j                  «       dv | j                  |<   Œ¿|dv r|| j                  |<   ŒÓ|dk(  sŒÙ|| j                  |<   Œé y )NÚ Ú Ú;Ú=r   Ú[Ú]Ú,é   r   é   r   )ÚyesÚtrueÚtÚ1)r   r   r   r   r   )ÚreplaceÚsplitÚlistÚmapÚintÚlenr   Úlower)r   r   ÚkvÚkeyÚvalueÚ
value_lists         r   r   z"ProfilerOptions._parse_from_string>   sü   € Ø×%Ñ% c¨2Ó.×4Ñ4°SÖ9ˆBØŸ™ #›‰JˆC�Ø�mÒ#Ø"Ÿ]™]¨3°Ó3×;Ñ;¸CÀÓD×JÑJÈ3ÓO�
Ü!¤#¤c¨:Ó"6Ó7�
ä˜
“O qÓ(Ø" 1™¨Ó*Ø" 1™¨
°1©Ó5à)3�D—M‘M #Ò&ØÐ*Ò*Ø%*§[¡[£]Ð6OÐ%O�—‘˜cÒ"ØÐPÑPØ%*�—‘˜cÒ"Ø˜Ó$Ø%*�—‘˜cÒ"ñ! :r   c                 ót   — | j                   j                  |d «      €t        d|z  «      ‚| j                   |   S )Nz1ProfilerOptions does not have an option named %s.)r   ÚgetÚ
ValueError)r   Únames     r   Ú__getitem__zProfilerOptions.__getitem__Q   s:   € Ø�=‰=×Ñ˜T 4Ó(Ð0ÜÐPÐSWÑWÓXÐXØ�}‰}˜TÑ"Ð"r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r8   © r   r   r   r      s   „ ñò(-ò+ó&#r   r   c                 ó  — | €yt         €t        | «      a t        €tt        t         d   «      t        d«      k(  }t	        j
                  t         d   d   t         d   d   ft	        j                  d«      |¬«      at        j                  «        nt        j                  «        t        t         d   d   k(  rLt        j                  «        t        j                  dd	d
¬«       dat         d   rt        j                  d«       t        dz  a	y)ag  
    Enable the operator-level timing using PaddlePaddle's profiler.
    The profiler uses a independent variable to count the profiler steps.
    One call of this function is treated as a profiler step.
    Args:
      profiler_options - a string to initialize the ProfilerOptions.
                         Default is None, and the profiler is disabled.
    Nr   Tr   r   r$   z./profiler_log)Ú	schedulerÚon_trace_readyr   FÚms)Ú	op_detailÚ
thread_sepÚ	time_unitr   )Ú_profiler_optionsr   Ú_profr   ÚprofilerÚProfilerÚexport_chrome_tracingÚstartÚstepÚ_profiler_step_idÚstopÚsummaryÚsysÚexit)r   Ú_timer_onlys     r   Úadd_profiler_steprR   W   sé   € ð ÐØô Ð Ü+¨KÓ8Ðô
 €}ÜÔ+¨LÑ9Ó:¼cÀ$»iÑGˆÜ×!Ñ!ä! -Ñ0°Ñ3Ü! -Ñ0°Ñ3ðô $×9Ñ9Ð:JÓKØ"ô
ˆô 	�‰�ä�
‰
ŒäÔ-¨mÑ<¸QÑ?Ò?Ü�
‰
ŒÜ�‰ °À$ˆÔGØˆÜÐ/Ò0Ü�H‰H�QŒKä˜ÑÑr   )N)	rO   Úpaddle.profilerrG   rL   rE   rF   Úobjectr   rR   r=   r   r   Ú<module>rU      s4   ðó Ý "ð Ð ð Ð Ø€ô9#�fô 9#ôx+r   