
    9i                         S SK JrJrJrJrJr  S SKrSSKJ	r	  SSK
Jr  SSKJr  SSKJr  SS	KJr  S
SKJr  \R(                  \	" S5       " S S\5      5       5       rg)    )AnyDictListOptionalUnionN   )pipeline_requires_extra   )DetVideoResult)	benchmark)	HPIConfig)PaddlePredictorOption   )BasePipelinevideoc                      ^  \ rS rSrSrSr    SS\S\S\S\	S	\
\\\\4   \4      S
S4U 4S jjjr  SS\\\\   \R"                  \\R"                     4   S\S\S
\4S jjrSrU =r$ )VideoDetectionPipeline   zVideo detection Pipelinevideo_detectionNconfigdevice	pp_optionuse_hpip
hpi_configreturnc                    > [         TU ]  X#XES9  US   S   n0 nSU;   a  US   US'   SU;   a  US   US'   U R                  " U40 UD6U l        g)ah  
Initializes the class with given configurations and options.

Args:
    config (Dict): Configuration dictionary containing model and other parameters.
    device (str): The device to run the prediction on. Default is None.
    pp_option (PaddlePredictorOption): Options for PaddlePaddle predictor. Default is None.
    use_hpip (bool, optional): Whether to use the high-performance
        inference plugin (HPIP) by default. Defaults to False.
    hpi_config (Optional[Union[Dict[str, Any], HPIConfig]], optional):
        The default high-performance inference configuration dictionary.
        Defaults to None.
)r   r   r   r   
SubModulesVideoDetection
nms_threshscore_threshN)super__init__create_modelvideo_detection_model)	selfr   r   r   r   r   video_detection_model_configmodel_kwargs	__class__s	           t/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/paddlex/inference/pipelines/video_detection/pipeline.pyr"   VideoDetectionPipeline.__init__"   s    * 	 	 	
 (.l';<L'M$77)El)SL&99+G+WL(%)%6%6(&
,8&
"    inputr   r    c              +   @   #    U R                  XUS9 Sh  vN   g N7f)a?  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%   r,   r   r    kwargss        r)   predictVideoDetectionPipeline.predictE   s)     " --| . 
 	
 	
s   r.   )NNFN)g      ?g?)__name__
__module____qualname____firstlineno____doc__entitiesr   strr   boolr   r   r   r   r"   r   npndarrayfloatr   r0   __static_attributes____classcell__)r(   s   @r)   r   r      s     # H
 +/AE!
!
 !
 )	!

 !
 U4S>9#<=>!
 
!
 !
L  !	
S$s)RZZbjj1AAB
 
 	
 

 
r+   r   )typingr   r   r   r   r   numpyr:   
utils.depsr	   models.video_detection.resultr   utils.benchmarkr   	utils.hpir   utils.pp_optionr   baser   time_methodsr    r+   r)   <module>rI      sP    4 3  2 ; ( " 4  !;
\ ;
 " ;
r+   