o
    0j                     @   sb   d dl Z d dlmZ ddlmZmZ ddlmZmZm	Z	 G dd de
e	eZG d	d
 d
eeZdS )    N)Dict   )ImageReaderImageWriter   )ImgMixin	JsonMixinStrMixinc                       s<   e Zd ZdZdeddf fddZdeddfdd	Z  ZS )

BaseResultzBase ResultdatareturnNc                    s*   t  | g | _t|  t|  dS )zInitializes the instance with the provided data.

        Args:
            data (Dict): The data to initialize the instance with.
        N)super__init___show_funcsr	   r   selfr   	__class__ z/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/paddlex/inference/pipelines/components/common/base_result.pyr      s   
zBaseResult.__init__	save_pathc                 C   s6   | j D ]}t|}d|jv r||d q|  qdS )z
        Save all show functions to the specified path if they accept a save_path argument.

        Args:
            save_path (str): The path to save the functions' output.

        Returns:
            None
        r   )r   N)r   inspect	signature
parameters)r   r   funcr   r   r   r   save_all$   s   



zBaseResult.save_all)	__name__
__module____qualname____doc__r   r   strr   __classcell__r   r   r   r   r
      s    r
   c                       s*   e Zd ZdZdeddf fddZ  ZS )CVResultz Result For Computer Vision Tasksr   r   Nc                    s4   t  | t| d tdd| _tdd| _dS )zInitializes the instance with the given data and sets up image processing with the 'pillow' backend.

        Args:
            data (Dict): The data to initialize the instance with.
        Zpillow)backendN)r   r   r   r   Z_img_readerr   Z_img_writerr   r   r   r   r   9   s   zCVResult.__init__)r   r   r   r   r   r   r!   r   r   r   r   r"   6   s    r"   )r   typingr   Zutils.ior   r   Zutils.mixinr   r   r	   dictr
   r"   r   r   r   r   <module>   s    