o
    1Îj]
  ã                   @   s,   d dl mZ ddlmZ G dd„ deƒZdS )é   )ÚBaseTraineré   )ÚMODELSc                   @   s*   e Zd ZdZeZdd„ Zdefdd„ZdS )ÚTextDetTrainerzText Detection Model Trainerc                 C   s  | j jr| j | j j¡ | j jr| j | j j¡ | j jr$| j | j j¡ | j | j	j
d¡ | j jr9| j | j j¡ | j jdurG| j | j j¡ | j jdurU| j | j j¡ | j jdurc| j | j j¡ | j jdurw| j jdkrw| j | j j¡ | j	jdur‡| j | j	j¡ dS dS )zupdate training configZTextDetDatasetNÚ )Útrain_configZlog_intervalZ
pdx_configZupdate_log_intervalZeval_intervalZ_update_eval_interval_by_epochZsave_intervalZupdate_save_intervalZupdate_datasetZglobal_configZdataset_dirZpretrain_weight_pathZupdate_pretrained_weightsZ
batch_sizeZupdate_batch_sizeZlearning_rateZupdate_learning_rateZepochs_itersZ_update_epochsZresume_pathZ_update_checkpointsÚoutputZ_update_output_dir©Úself© r   úg/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/modules/text_detection/trainer.pyÚupdate_config   s2   ÿÿÿzTextDetTrainer.update_configÚreturnc                 C   s$   |   ¡ | j dd¡| j dd¡dœS )zƒget key-value arguments of model training function

        Returns:
            dict: the arguments of training function.
        Údy2stFÚampZOFF)Zdevicer   r   )Z
get_devicer   Úgetr	   r   r   r   Úget_train_kwargs7   s   ýzTextDetTrainer.get_train_kwargsN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úentitiesr   Údictr   r   r   r   r   r      s
    r   N)Úbaser   Z
model_listr   r   r   r   r   r   Ú<module>   s   