o
    0Îjœ  ã                   @   sT   d dl mZmZmZmZ ddlmZ ddlmZm	Z	 ddl
mZ G dd	„ d	eƒZd
S )é    )ÚAnyÚDictÚOptionalÚUnioné   )Úloggingé   )Ú	HPIConfigÚPaddlePredictorOptioné   )ÚBasePipelinec                       s¼   e Zd ZdZdddddddœdee dee deeeef  dee d	e	d
ee
eeef ef  ddf‡ fdd„Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zddd„Z‡  ZS )ÚPP_ChatOCR_PipelinezPP-ChatOCR PipelineNF©ÚdeviceÚengineÚengine_configÚ	pp_optionÚuse_hpipÚ
hpi_configr   r   r   r   r   r   Úreturnc             	      s$   t ƒ jd||||||dœ|¤Ž dS )a¹  Initializes the PP-ChatOCR pipeline.

        Args:
            device (Optional[str], optional): The device to use for prediction. Defaults to `None`.
            engine (Optional[str], optional): Inference engine. Defaults to `None`.
            engine_config (Optional[Dict[str, Any]], optional): Engine-specific config. Defaults to `None`.
            pp_option (Optional[PaddlePredictorOption], optional): Paddle predictor options.
                Defaults to `None`.
            use_hpip (bool, optional): Whether to use HPIP. Defaults to `False`.
            hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
                HPIP configuration. Defaults to `None`.
        r   N© )ÚsuperÚ__init__)Úselfr   r   r   r   r   r   Úkwargs©Ú	__class__r   úu/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/inference/pipelines/pp_chatocr/pipeline_base.pyr      s   ú
ùzPP_ChatOCR_Pipeline.__init__c                 C   ó   t dƒ‚)a  
        This function takes an input image or a list of images and performs various visual
        prediction tasks such as document orientation classification, document unwarping,
        general OCR, seal recognition, and table recognition based on the provided flags.
        z9The method `visual_predict` has not been implemented yet.©ÚNotImplementedError©r   r   r   r   Úvisual_predict:   s   ÿz"PP_ChatOCR_Pipeline.visual_predictc                 C   r   )zG
        Save the visual info list to the specified file path.
        z@The method `save_visual_info_list` has not been implemented yet.r   r!   r   r   r   Úsave_visual_info_listE   ó   ÿz)PP_ChatOCR_Pipeline.save_visual_info_listc                 C   r   )z5
        Loads visual info list from a file.
        z@The method `load_visual_info_list` has not been implemented yet.r   r!   r   r   r   Úload_visual_info_listM   r$   z)PP_ChatOCR_Pipeline.load_visual_info_listc                 C   r   )zH
        Build a vector representation from visual information.
        z7The method `build_vector` has not been implemented yet.r   r!   r   r   r   Úbuild_vectorU   r$   z PP_ChatOCR_Pipeline.build_vectorc                 C   r   )zB
        Save the vector information to a specified path.
        z6The method `save_vector` has not been implemented yet.r   r!   r   r   r   Úsave_vector]   r$   zPP_ChatOCR_Pipeline.save_vectorc                 C   r   )z7
        Loads vector information from a file.
        z6The method `load_vector` has not been implemented yet.r   r!   r   r   r   Úload_vectore   r$   zPP_ChatOCR_Pipeline.load_vectorc                 C   r   )z_
        Generates chat results based on the provided key list and visual information.
        z/The method `chat` has not been implemented yet.r   r!   r   r   r   Úchatm   s   zPP_ChatOCR_Pipeline.chatc                 O   s   t  d¡ d S )NzšPP-ChatOCR Pipeline do not support to call `predict()` directly! Please invoke `visual_predict`, `build_vector`, `chat` sequentially to obtain the result.)r   Úerror)r   Úargsr   r   r   r   Úpredicts   s   ÿzPP_ChatOCR_Pipeline.predict)r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústrr   r   r
   Úboolr   r	   r   r"   r#   r%   r&   r'   r(   r)   r,   Ú__classcell__r   r   r   r   r      s>    øýüûúùø
ö!r   N)Útypingr   r   r   r   Úutilsr   Úmodelsr	   r
   Úbaser   r   r   r   r   r   Ú<module>   s
   