o
    yqieh                     @   s  d dl mZ d dlmZmZmZmZmZmZ d dl	m
Z
mZ dd Zi ddedd	d
edd	dedd	dedd	dedd	dedd	dedd	dedd	dedd	dedd	g
ddeeeeeeef f  dd	gdd ed!d	gd"ded#d	gd$d%ed&d	d'ed(d	gd)d%ed*d	d'ed+d	gd,d%eee d&d	gd-d.ed/d	ded0d	d
edd	d1ed2d	d3ed4d	dedd	dedd	dedd	dedd	dedd	dedd	gd5d.ed/d	d6ed7d	d8ed9d	ded0d	d
edd	d1ed2d	d3ed4d	dedd	dedd	dedd	dedd	dedd	dedd	gd:ded0d	d
edd	d1ed2d	d;eeeeeeef f  d<d	d=ed>d	d?eeeeeeef eeef f  d@d	dAeeeeeeef f  dBd	dCedd	dDedEd	dFedd	dGedd	dHedd	dIedd	gdJdedd	d
edd	dKedLd	dedd	dMedNd	dOedPd	dQedRd	d;eeeeeeef f  d<d	d=ed>d	d?eeeeeeef eeef f  d@d	dAeeeeeeef f  dBd	dCedd	dDedEd	dFedd	dGedd	dHedd	dIedd	dedd	dedd	dedd	dedd	dedd	dedd	gdSdedd	d
edd	dKedLd	dedd	dMedNd	dOedPd	dQedRd	d;eeeeeeef f  d<d	d=ed>d	d?eeeeeeef eeef f  d@d	dAeeeeeeef f  dBd	dCedd	dDedEd	dFedd	dGedd	dHedd	dIedd	dedd	dedd	dedd	dedd	dedd	dedd	d.ed/d	d6ed7d	d8ed9d	gdTdedd	d
edd	d1edUd	dVedWd	d;eeeeeeef f  d<d	d=ed>d	d?eeeeeeef eeef f  d@d	dAeeeeeeef f  dBd	dXedYd	dZeee d[d	d\ed]d	d^eee d_d	d`eee dad	dbeee dcd	ddeee ded	dfeee dgd	gdhdidjdidkdidld1edUd	dedd	d
edd	d;eeeeeeef f  dmd	d=ednd	d?eeeeeeef eeef f  dod	dAeeeeeeef f  dpd	gdeee dqd	gdreeeeeeef eds f  dtd	gdeeeeeeef f  dud	gdid edvd	gdwedxd	dyedzd	gded{d	d
ed|d	gdeeeeeeef f  d}d	gd~eeeef dd	dedd	gdedd	deeee  dd	gdididZdiS )    )literal_eval)DictListLiteralOptionalTupleUnion)TypeAdapterValidationErrorc                    s   dt d f fdd}|S )z;Create validator for CLI input conversion and type checking	cli_inputreturnc                    s   zt | }W n tttttfy$ } zd| d| }t||d }~ww zt |W S  tyG } zd  d| d}t||d }~ww )Nz&Malformed input:
            - Input: z
            - Error: z,Invalid input type:
            - Expected: z
            - Received: z
            )	r   
ValueErrorSyntaxError	TypeErrorMemoryErrorRecursionErrorr	   Zvalidate_pythonr
   )r   parsedexcerrcli_expected_type g/home/app/PaddleOCR-VL/.venv_paddleocr/lib/python3.10/site-packages/paddlex/utils/pipeline_arguments.py	validator   s,   

zcustom_type.<locals>.validator)str)r   r   r   r   r   custom_type   s   r   ZOCRz--use_doc_orientation_classifyz=Determines whether to use document orientation classification)nametypehelpz--use_doc_unwarpingz,Determines whether to use document unwarpingz--use_textline_orientationz4Determines whether to consider text line orientationz--text_det_limit_side_lenz.Sets the side length limit for text detection.z--text_det_limit_typez'Sets the limit type for text detection.z--text_det_threshz&Sets the threshold for text detection.z--text_det_box_threshz*Sets the box threshold for text detection.z--text_det_unclip_ratioz)Sets the unclip ratio for text detection.z--text_rec_score_threshz.Sets the score threshold for text recognition.z--return_word_boxz%Determines whether to return word boxZobject_detectionz--thresholdz(Sets the threshold for object detection.Zimage_classificationz--topkz.Sets the Top-K value for image classification.Zimage_multilabel_classificationz7Sets the threshold for image multilabel classification.Z pedestrian_attribute_recognitionz--det_thresholdz'Sets the threshold for human detection.z--cls_thresholdz8Sets the threshold for pedestrian attribute recognition.Zvehicle_attribute_recognitionz)Sets the threshold for vehicle detection.z5Sets the threshold for vehicle attribute recognition.Zhuman_keypoint_detectionZtable_recognitionz--use_table_cells_ocr_resultsz+Determines whether to use cells OCR resultsz0Determines whether to use document preprocessingz--use_layout_detectionz3Determines whether to use document layout detectionz--use_ocr_modelzDetermines whether to use OCRZtable_recognition_v2z--use_e2e_wired_table_rec_modelzBDetermines whether to use end-to-end wired table recognition modelz"--use_e2e_wireless_table_rec_modelzEDetermines whether to use end-to-end wireless table recognition modelZseal_recognitionz--layout_thresholdz4Determines confidence threshold for layout detectionz--layout_nmsz1Determines whether to use non maximum suppressionz--layout_unclip_ratioz2Determines unclip ratio for layout detection boxesz--layout_merge_bboxes_modezNDetermines merge mode for layout detection bboxes, 'union', 'large' or 'small'z--seal_det_limit_side_lenz--seal_det_limit_typez5Sets the limit type for text detection, 'min', 'max'.z--seal_det_threshz--seal_det_box_threshz--seal_det_unclip_ratioz--seal_rec_score_threshZlayout_parsingz--use_general_ocrz%Determines whether to use general ocrz--use_seal_recognitionz*Determines whether to use seal recognitionz--use_table_recognitionz+Determines whether to use table recognitionz--use_formula_recognitionz-Determines whether to use formula recognitionzPP-StructureV3zPaddleOCR-VLz*Determines whether to use layout detectionz--use_chart_recognitionz4Determines whether to use document chart recognitionz--use_queuesz Determines whether to use queuesz--prompt_labelz5Sets the prompt label when not using layout detectionz--format_block_contentz*Determines whether to format block contentz--repetition_penalty z--temperaturez%Temperature parameter for VLLM model.z--top_pzTop-p parameter for VLLM model.z--min_pixelsz'Sets the minimum pixels for VLLM model.z--max_pixelsz*Sets the max_pixels pixels for VLLM model.Zts_forecastNZts_anomaly_detectionZts_classificationZformula_recognitionz/Sets the layout threshold for layout detection.z$Determines whether to use layout nmsz2Sets the layout unclip ratio for layout detection.z7Sets the layout merge bboxes mode for layout detection.z-Sets the threshold for instance segmentation.z--target_sizez>Sets the inference image resolution for semantic segmentation.z.Sets the threshold for small object detection.z.Sets the Top-K value for video classification.z--nms_threshz+Sets the NMS threshold for video detection.z--score_threshz2Sets the confidence threshold for video detection.z>Determines whether to use document orientation classification.z-Determines whether to use document unwarping.z0Sets the threshold for rotated object detection.z--thresholdsz2Sets the thresholds for open vocabulary detection.z--promptz.Sets the prompt for open vocabulary detection.z--prompt_typez6Sets the prompt type for open vocabulary segmentation.z1Sets the prompt for open vocabulary segmentation.)Zinstance_segmentationZsemantic_segmentationZsmall_object_detectionZanomaly_detectionZvideo_classificationZvideo_detectionZdoc_preprocessorZrotated_object_detectionZopen_vocabulary_detectionZopen_vocabulary_segmentationZ3d_bev_detectionZmultilingual_speech_recognition)astr   typingr   r   r   r   r   r   Zpydanticr	   r
   r   boolintr   floatZPIPELINE_ARGUMENTSr   r   r   r   <module>   s   5<CJVb
i #  f    ,      $         + 





                                                ,
	 			     