o
    !i                     @   sH   d dl mZmZmZ ddlmZmZ G dd deZG dd deZdS )	   )add_simple_inference_argsget_subcommand_argsperform_simple_inference   )PaddleXPredictorWrapperPredictorCLISubcommandExecutorc                       sB   e Zd Zdd fdd
Zedd Zedd Zd	d
 Z  Z	S )TextRecognitionN)input_shapec                   s    d|i| _ t jdi | d S )Nr	    )_extra_init_argssuper__init__)selfr	   kwargs	__class__r
   n/home/app/PaddleOCR-VL-test/.venv_paddleocr/lib/python3.10/site-packages/paddleocr/_models/text_recognition.pyr      s   zTextRecognition.__init__c                 C      dS )NzPP-OCRv5_server_recr
   r   r
   r
   r   default_model_name#      z"TextRecognition.default_model_namec                 C   s   t  S N)!TextRecognitionSubcommandExecutor)clsr
   r
   r   get_cli_subcommand_executor'   s   z+TextRecognition.get_cli_subcommand_executorc                 C   s   | j S r   )r   r   r
   r
   r   &_get_extra_paddlex_predictor_init_args+   s   z6TextRecognition._get_extra_paddlex_predictor_init_args)
__name__
__module____qualname__r   propertyr   classmethodr   r   __classcell__r
   r
   r   r   r      s    

r   c                   @   s(   e Zd Zedd Zdd Zdd ZdS )r   c                 C   r   )NZtext_recognitionr
   r   r
   r
   r   subparser_name0   r   z0TextRecognitionSubcommandExecutor.subparser_namec                 C   s    t | |jddtddd d S )Nz--input_shape   )CHWzInput shape of the model.)nargstypemetavarhelp)r   add_argumentint)r   Z	subparserr
   r
   r   _update_subparser4   s   
z3TextRecognitionSubcommandExecutor._update_subparserc                 C   s   t |}tt| d S r   )r   r   r   )r   argsparamsr
   r
   r   execute_with_args>   s   z3TextRecognitionSubcommandExecutor.execute_with_argsN)r   r   r   r   r"   r-   r0   r
   r
   r
   r   r   /   s
    

r   N)	Z
_utils.clir   r   r   baser   r   r   r   r
   r
   r
   r   <module>   s   