
    }-jo
                     n    d dl Z ddlmZmZmZmZ ddlmZmZ  G d de          Z	 G d d	e          Z
dS )
    N   )add_simple_inference_argsget_subcommand_argsperform_simple_inferencestr2bool   )PaddleXPredictorWrapperPredictorCLISubcommandExecutorc                   2     e Zd Zdddddd fd
Zd Z xZS )ObjectDetectionNimg_size	threshold
layout_nmslayout_unclip_ratiolayout_merge_bboxes_modec                T    |||||d| _          t                      j        di | d S )Nr    )_extra_init_argssuper__init__)selfr   r   r   r   r   kwargs	__class__s          c/var/www/html/banglarbhumi/venv/lib/python3.11/site-packages/paddleocr/_models/_object_detection.pyr   zObjectDetection.__init__   sH     !"$#6(@!
 !
 	""6"""""    c                     | j         S N)r   r   s    r   &_get_extra_paddlex_predictor_init_argsz6ObjectDetection._get_extra_paddlex_predictor_init_args.   s    $$r   )__name__
__module____qualname__r   r    __classcell__)r   s   @r   r   r      sb          !%# # # # # # #&% % % % % % %r   r   c                   J    e Zd Zd Zeej        d                         Zd ZdS )!ObjectDetectionSubcommandExecutorc                 F   t          |           |                    dt          d           |                    dt          d           |                    dt          d           |                    dt          d	           |                    d
t
          d           d S )Nz
--img_sizezInput image size (w, h).)typehelpz--thresholdz7Threshold for filtering out low-confidence predictions.z--layout_nmsz Whether to use layout-aware NMS.z--layout_unclip_ratioz%Ratio of unclipping the bounding box.z--layout_merge_bboxes_modez Mode for merging bounding boxes.)r   add_argumentintfloatr   str)r   	subparsers     r   _update_subparserz3ObjectDetectionSubcommandExecutor._update_subparser3   s    !),,,+ 	 	
 	
 	

 	J 	 	
 	
 	

 	3 	 	
 	
 	

 	#8 	 	
 	
 	

 	(3 	 	
 	
 	
 	
 	
r   c                     t           r   )NotImplementedErrorr   s    r   wrapper_clsz-ObjectDetectionSubcommandExecutor.wrapper_clsP   s
     "!r   c                 N    t          |          }t          | j        |           d S r   )r   r   r2   )r   argsparamss      r   execute_with_argsz3ObjectDetectionSubcommandExecutor.execute_with_argsU   s(    $T** !16:::::r   N)	r!   r"   r#   r/   propertyabcabstractmethodr2   r6   r   r   r   r&   r&   2   s[        
 
 
: " "  X"; ; ; ; ;r   r&   )r8   
_utils.clir   r   r   r   baser	   r
   r   r&   r   r   r   <module>r<      s    


            J I I I I I I I% % % % %- % % %0%; %; %; %; %;(F %; %; %; %; %;r   