
    {-j                         d dl mZmZmZmZmZ d dlZddlm	Z	 ddl
mZmZ ddlmZ ddlmZ d	d
lmZ ej         e	d           G d de                                  ZdS )    )AnyDictListOptionalUnionN   )pipeline_requires_extra   )	HPIConfigPaddlePredictorOption)DetVideoResult)	benchmark   )BasePipelinevideoc                   "    e Zd ZdZdZdddddddde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Z	 	 ddeeee         ej        eej                 f         dededefdZ xZS )VideoDetectionPipelinezVideo detection Pipelinevideo_detectionNFdeviceengineengine_config	pp_optionuse_hpip
hpi_configconfigr   r   r   r   r   r   returnc          
           t                      j        d||||||d| |d         d         }	i }
d|	v r|	d         |
d<   d|	v r|	d         |
d<    | j        |	fi |
| _        dS )a  Initializes the video detection pipeline.

        Args:
            config (Dict): Configuration dictionary containing model and other parameters.
            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   
SubModulesVideoDetection
nms_threshscore_threshN )super__init__create_modelvideo_detection_model)selfr   r   r   r   r   r   r   kwargsvideo_detection_model_configmodel_kwargs	__class__s              t/var/www/html/banglarbhumi/venv/lib/python3.11/site-packages/paddlex/inference/pipelines/video_detection/pipeline.pyr%   zVideoDetectionPipeline.__init__!   s    2 	 	
'!	
 	
 	
 	
 	
 (.l';<L'M$777)El)SL&999+G+WL(%6T%6(&
 &
,8&
 &
"""          ?皙?inputr!   r"   c              +   F   K   |                      |||          E d{V  dS )ao  Predicts video detection results for the given input.

        Args:
            input (Union[str, list[str], np.ndarray, list[np.ndarray]]): The input image(s) or path(s) to the images.
            **kwargs: Additional keyword arguments that can be passed to the function.

        Returns:
            DetVideoResult: The predicted video detection results.
        )r!   r"   N)r'   )r(   r1   r!   r"   r)   s        r-   predictzVideoDetectionPipeline.predictN   sT      " --j| . 
 
 	
 	
 	
 	
 	
 	
 	
 	
 	
r.   )r/   r0   )__name__
__module____qualname____doc__entitiesr   r   strr   r   boolr   r   r%   r   npndarrayfloatr   r3   __classcell__)r,   s   @r-   r   r      sK        #" H !% $2659AE+
 +
 +
+
 	+

 +
  S#X/+
 12+
 +
 U4S>9#<=>+
 
+
 +
 +
 +
 +
 +
`  !	
 
S$s)RZbj1AAB
 
 	
 

 
 
 
 
 
 
 
r.   r   )typingr   r   r   r   r   numpyr;   
utils.depsr	   modelsr   r   models.video_detection.resultr   utils.benchmarkr   baser   time_methodsr   r#   r.   r-   <module>rG      s   4 3 3 3 3 3 3 3 3 3 3 3 3 3     2 2 2 2 2 2 6 6 6 6 6 6 6 6 ; ; ; ; ; ; ( ( ( ( ( (       !!E
 E
 E
 E
 E
\ E
 E
 "! E
 E
 E
r.   