o
    1Îjð  ã                   @   s8   d dl mZ ddlmZ ddlmZ G dd„ deƒZdS )	é    )ÚPathé   )ÚBaseEvaluatoré   )ÚMODELSc                   @   s*   e Zd ZdZeZdd„ Zdefdd„ZdS )ÚTextRecEvaluatorz Text Recognition Model Evaluatorc                 C   sÂ   | j jr| j | j j¡ | jd dkr| j | jjd¡ nd| jd v r.| j | jjd¡ n	| j | jjd¡ d}| j  d¡rD| j j}nt	| j j
ƒjd	 }| ¡ sSd}|dur_| j |¡ dS dS )
zupdate evaluation configÚmodelZLaTeX_OCR_recZLaTeXOCRDataSetzPP-OCRv3ZSimpleDataSetZMSTextRecDatasetNÚlabel_dict_pathzlabel_dict.txt)Úeval_configZlog_intervalZ
pdx_configZupdate_log_intervalZglobal_configZupdate_datasetZdataset_dirÚgetr	   r   Úweight_pathÚparentÚexistsZupdate_label_dict_path)Úselfr	   © r   úk/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/modules/text_recognition/evaluator.pyÚupdate_config   s.   ÿÿÿ
ÿÿzTextRecEvaluator.update_configÚreturnc                 C   s   | j j|  ¡ dœS )z‡get key-value arguments of model evaluation function

        Returns:
            dict: the arguments of evaluation function.
        )r   Zdevice)r
   r   Z
get_device)r   r   r   r   Úget_eval_kwargs7   s   þz TextRecEvaluator.get_eval_kwargsN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úentitiesr   Údictr   r   r   r   r   r      s
    r   N)Úpathlibr   Úbaser   Z
model_listr   r   r   r   r   r   Ú<module>   s   