
    9i=                     '   S SK rS SKJr  S SKJr   " S S\5      r " S S\5      r\R                  \
\R                  \R                  4\R                  \
\R                  \
\\R                  4\R                  \
\R                  S4\R                   \\R                  4\R$                  \\" S5      4\R*                  \\" S5      4\R,                  \0r\R                  S	S
S.\R                  S	SS.\R                  S	SS.\R                  S	SS.\R                   SSSS0S.\R$                  SS0\R*                  SS0\R,                  SS00rS r0 \R6                  \R                  \R                  S._\R8                  \R                  \R                  \R                  \R                  0_\R:                  \R                  _\R<                  \R                  \R                  \R                  \R                  0_\R>                  \R                  _\R@                  \R                  _\RB                  \R                  _\R<                  \R                  _\RD                  \R                  _\RF                  \R                  _\RH                  \R                  _\RJ                  \R                  _\RL                  \R                  _\RN                  \R                  _\RP                  \R                  _\RR                  \R                  _\RT                  \R                  _0 \RV                  \R                  _\RX                  \R                  _\RZ                  \R                  _\R\                  \R                  _\R^                  \R                  _\R`                  \R                  _\Rb                  \R                  _\Rd                  \R                  _\Rf                  \R                  _\Rh                  \R                  _\Rj                  \R                  _\Rl                  \R                  _\Rn                  \R,                  _\Rp                  \R                  _\Rr                  \R                  _\Rt                  \R                  _\Rv                  \R                  _E0 \Rx                  \R                  _\Rz                  \R                  _\R|                  \R                  _\R~                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  \R                  S._\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _E0 \R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  \R                  S._\R                  \R                  \R                  S._\R                  \R                  \R                  \R                  S._\R                  \R                  \R                  S._\R                  \R                  \R                  S._\R                  \R                  \R                  S._\R                  \R                  _\R                  \R                  _\R                  \R                  \R                  \R                  \R                  \R                  4/_\R                  \R                  _\R                  \R                  \R                  S._\R                  \R                  _\R                  \R                  _E0 \R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  \R                   4_\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  \R                  \R                  4\R                  \R                  \R                  S./_\R                  \R                  \R                  \R                  \R                  0_\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  \R                  \R                  \R                  \R                  \R                  0_\R                  \R                  \R                  S \R                  0_E0 \R                  \R                  \R                  S!._\R                  \R                  \R                  \R                  \R                  S"._\R                  \R                  \R                  S#\R*                  0_\R                  \R                  \R                  S$\R                  0_\R                  S%\R*                  0_\R                  \R                  \R                  \R                  4\R                  \R                  S&./_\R                  \R                  \R                  4\R                  \R                  S'./_\R                  \R                  \R                  4_\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  _\R                  \R                  S(\R                  0/_\R                  \R                  _\R                  \R                  S(\R                  0/_\R                  \R                  _\R                  \R                  _E0 \GR                   \R                  _\GR                  \R*                  \R*                  S)._\GR                  \R                  \R                  4\R*                  \R*                  S)./_\GR                  \R                  _\GR                  \R                  \R                  \R                  \R                  S*._\GR
                  \R                  _\GR                  \R                  \R$                  S+._\GR                  \R*                  \R*                  S,._\GR                  \R*                  \R*                  \R*                  S-._\GR                  \R                  _\GR                  \R                  \R                  S.._\GR                  \R*                  \R*                  \R*                  S/._\GR                  S0\R*                  0_\GR                  \R*                  \R*                  \R*                  S1._\GR                  \R                  _\GR                  \R                  _\GR                   \R                  \R                  \R                  S2./_E0 \GR"                  \R                  _\GR$                  \R                  \R                  S3._\GR&                  \R                  _\GR(                  \R                  _\GR*                  \R                  _\GR,                  \R                  _\GR.                  \R                  _\GR0                  \R                  _\GR2                  \R                  _\GR4                  \R                  _\GR6                  \R                  _\GR8                  \R                  _\GR:                  \R                  \R                  /_\GR<                  \R                  S4\R                  0/_\GR>                  \R                  S5\R                  0/_\GR@                  S%\R*                  0_\GRB                  \R                  \R                  S._E0 \GRD                  S(\R                  0_\GRF                  \R                  \R                  S6._\GRH                  \R                  \R                  S._\GRJ                  \R                  \R                  S6._\GRL                  \R                  \R                  S7._\GRN                  \R                  \R                  S._\GRP                  \R                  \R                  S7._\GRR                  \R                  \R                  \R                  S8._\GRT                  \R                  _\GRV                  \R                  _\GRX                  \R                  \R                  \R                  \R,                  \R,                  \R,                  S9._\GRZ                  \R                  _\GR\                  \R                  \R                  \R                  S:._\GR^                  S(\R                  0_\GR`                  \R                  _\GRb                  S;\R                  0_\GRd                  \R                  \R*                  S<._Erg)=    N)Image)Tasksc                        \ rS rSrSrSrSrSrg)	InputKeys	   imagetextvideo N)__name__
__module____qualname____firstlineno__IMAGETEXTVIDEO__static_attributes__r       Z/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/modelscope/pipeline_inputs.pyr   r   	   s    EDEr   r   c                   4    \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rg)	InputType   r   r	   audior
   boxdictlistnumberr   N)r   r   r   r   r   r   AUDIOr   BOXDICTLISTNUMBERr   r   r   r   r   r      s*    EDEE
CDDFr   r   zcv2.VideoCapturestringz(Base64 encoded image file or url string.)typedescriptionz)Base64 encoded audio file or url string..z)Base64 encoded video file or url string..zThe input text.arrayzBox coordinate, should be int.r$   r   )r$   r%   itemsobjectintegerc           	      $   [         U    nU [        R                  :X  aG  [        U5      R                  S:X  d-  [        X5      (       d   SU  SU S[        U5       SU 35       eg g [        X5      (       d   SU  SU S[        U5       SU 35       eg )NVideoCapturezinvalid input type for z, expected z	 but got z
 )
INPUT_TYPEr   r   r$   r   
isinstance)
input_typeinputexpected_types      r   check_input_typer1   I   s    z*MY__$E{##~5E9Y9Y 	m%j\]O9UYZ_U`Taadejdkl	mY9Y5 %// 	m%j\]O9UYZ_U`Taadejdkl	m/r   )r   r	   )imgcategory_names)r   prompt)r2   mask)r2   r5   	reference)	sky_imagescene_image)templateuser)contentstyle)masked_modelposeclothtarget_pose_path)
dataset_idcase_id)rA   rB   action_datasetactiontarget_viewsave_dirmessages)r	   text2)source_texttarget_textr	   )source_sentencesentences_to_compare)history	knowledgebot_profileuser_profile)questionhistory_sql)	query_setsupport_set)hypsrcref)r	   database)querycontextlabeldataset)rY   positivenegative)wavr	   )nearend_micfarend_speechr   r
   )r2   r	   )r
   r	   )r   r	   rH   )	mesh_pathtexture_pathr4   uvsize
image_size
output_dir)video_input_pathvideo_output_path	mask_pathr4   )r2   prompts)numpynpPILr   modelscope.utils.constantr   r(   r   r   r   strndarrayr   r   bytesr   r   r   r    r   r$   r!   r"   intr,   INPUT_TYPE_SCHEMAr1   task_templateimage_text_retrievalgeneral_recognitionvideo_depth_estimationindoor_layout_estimationimage_demoireingpanorama_depth_estimationanimal_recognitionmotion_generationvideo_panoptic_segmentationocr_detectionocr_recognitionface_2d_keypointsface_livenessface_quality_assessmentcard_detectionlicense_plate_detectioncard_detection_correctionlineless_table_recognitiontable_recognitionface_detectionfacial_expression_recognitionface_attribute_recognitionface_recognitionface_reconstructionhead_reconstructiontext_to_headhuman_detectionface_image_generationimage_classificationimage_quality_assessment_mos$image_quality_assessment_degradationimage_object_detection domain_specific_object_detectionhuman_wholebody_keypointimage_segmentationportrait_mattinguniversal_mattingproduct_segmentationsemantic_segmentationface_human_hand_detectionhand_staticimage_fewshot_detectionopen_vocabulary_detectionimage_driving_perceptionvision_efficient_tuningskin_retouchingimage_super_resolutionimage_colorizationimage_color_enhancementimage_denoisingimage_body_reshapingimage_portrait_enhancementcrowd_countingimage_super_resolution_pasdimage_inpaintingimage_paintbyexampleimage_skychangecontrollable_image_generationimage_face_fusionimage_deblurringvideo_colorizationimage_to_image_generationimage_to_image_translationimage_style_transferimage_portrait_stylizationlive_categoryaction_recognitionbody_2d_keypointsbody_3d_keypointshand_2d_keypoints pedestrian_attribute_recognitionvideo_single_object_trackingvideo_multi_object_trackingvideo_categoryproduct_retrieval_embeddingvideo_embeddingvirtual_try_ontext_driven_segmentationshop_segmentationmovie_scene_segmentationbad_image_detectingimage_try_onhuman_image_generationhuman3d_renderhuman3d_animationimage_view_transformimage_control_3d_portraitchattext_classificationsentence_similaritynlisentiment_classificationzero_shot_classificationrelation_extractiontranslationtext_summarizationcompetency_aware_translationword_segmentationpart_of_speechnamed_entity_recognitiontext_error_correctionsentence_embeddingtext_rankingtext_generationfid_dialogue	fill_masktable_question_answeringfaq_question_answeringtranslation_evaluationsudokutext2sql!document_grounded_dialog_generatedocument_grounded_dialog_rerank"document_grounded_dialog_retrievalmachine_reading_comprehensionsiamese_uieauto_speech_recognitionspeech_signal_processacoustic_echo_cancellationspeech_separationacoustic_noise_suppressiontext_to_speechkeyword_spotting&speaker_diarization_dialogue_detectionlanguage_score_predictionpunctuationspeech_language_recognition3speaker_diarization_semantic_speaker_turn_detectioninverse_text_processingspeaker_verificationimage_captioningvideo_captioningmultimodal_dialoguevisual_groundingtext_to_image_synthesismulti_modal_embedding generative_multi_modal_embeddingmulti_modal_similaritytext_video_retrievalvisual_question_answeringvideo_question_answeringvisual_entailmentaction_detectionhuman_reconstructiontext_texture_generationimage_reid_personvideo_inpaintingtext_to_video_synthesisvideo_summarizationtext_to_360panorama_imageimage_editingTASK_INPUTSr   r   r   <module>r     s     +   OOc2::u{{3NNCOOc5"**-OOc2::'9:MMD"**%NNT4:&NNT4:&c	
 OOA OOB OOB NN( MM7H
 NN NN 	=! HmU 
U" 
	!#U* 
OO-U. 
  	#/U6 
""OO9U: 
OO=U> 
##OOAUB 
  OOEUF 
OOIUJ 
NNMUN 
%%OOQUV 
OOYUZ 
OO]U^ 
OOaUb 
OOeUf 
!!OOiUj 
OOmUn 
!!OOqUr 
##OOuUv 
$$OOyUz 
OO}U~ 
OOAUB 
''OOEUF 
$$OOIUJ 
OOMUN 
OOQUR 
OOUUV 
NNYUZ 
OO]U^ 
aUb 
OOeUf 
&&OOiUj 
..OOmUn 
  OOqUr 
**OOuUv 
""OOyUz 
OO}U~ 
OOAUB 
OOEUF 
OOIUJ 
OOMUN 
##OOQUR 
OOUUV 
!!OOYUZ 
###..&[Ub 
""OOeUf 
!!OOiUn 
OOqUr 
  OOuUv 
OOyUz 
!!OO}U~ 
OOAUB 
O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