
    uj=                        d dl Zd dlmZ d dlmZ  G d de          Z G d de          Zej	        e
ej        ej        fej        e
ej        e
eej        fej        e
ej        dfej        eej        fej        e ed          fej        e ed          fej        eiZej	        d	d
dej        d	ddej        d	ddej        d	ddej        ddddidej        ddiej        ddiej        ddiiZd Zi ej        ej	        ej        dej        ej	        ej	        ej        ej        iej        ej	        ej        ej	        ej	        ej        ej        iej        ej	        ej         ej	        ej!        ej	        ej        ej        ej"        ej	        ej#        ej        ej$        ej        ej%        ej	        ej&        ej	        ej'        ej	        ej(        ej	        ej)        ej	        ej*        ej	        i ej+        ej	        ej,        ej	        ej-        ej	        ej.        ej	        ej/        ej	        ej0        ej	        ej1        ej	        ej2        ej	        ej3        ej	        ej4        ej	        ej5        ej        ej6        ej	        ej7        ej        ej8        ej	        ej9        ej	        ej:        ej	        ej;        ej	        i ej<        ej	        ej=        ej	        ej>        ej	        ej?        ej	        ej@        ej	        ejA        ej	        ejB        ej	        ejC        ej	        ejD        ej	        ejE        ej	        ejF        ej	        ej        dejG        ej	        ejH        ej	        ejI        ej	        ejJ        ej	        ejK        ej	        ejL        ej	        i ejM        ej	        ejN        ej	        ejO        ej	        ejP        ej	        ejQ        ej	        ej        dejR        ej	        ej	        dejS        ej	        ej	        ej	        dejT        ej	        ej	        dejU        ej	        ej        dejV        ej	        ej	        dejW        ej	        ejX        ej        ejY        ej	        ej	        ej	        ej	        ej	        fgejZ        ej	        ej[        ej	        ej	        dej\        ej	        ej]        ej        i ej^        ej        ej_        ej	        ej`        ej        eja        ej	        ejb        ej	        ejc        ej        ej        fejd        ej        eje        ej        ejf        ej	        ejg        ej        ejh        ej	        ej	        ej	        fej	        ej	        ej	        dgeji        ej	        ej	        ej        ej        iejj        ej	        ejk        ej        ejl        ej	        ejm        ej	        ej	        ej	        ej	        ej	        ej	        iejn        ej	        ej	        d ej        ii ejo        ej        ej        d!ejp        ej        ej        ej        ej        d"ejq        ej	        ej	        d#ej        iejr        ej	        ej	        d$ej        iejs        d%ej        iejt        ej        ej        ej        fej        ej        d&geju        ej        ej        fej        ej        d'gejv        ej        ej        fejw        ej        ejx        ej        ejy        ej        ejz        ej        ej{        ej        d(ej        igej|        ej        ej}        ej        d(ej        igej~        ej        ej        ej        i ej        ej        ej        ej        ej        d)ej        ej        ej        fej        ej        d)gej        ej        ej        ej        ej        ej        ej        d*ej        ej        ej        ej        ej        d+ej        ej        ej        d,ej        ej        ej        ej        d-ej        ej        ej        ej        ej        d.ej        ej        ej        ej        d/ej        d0ej        iej        ej        ej        ej        d1ej        ej        ej        ej        ej        ej        ej        ej        d2gi ej        ej        ej        ej        ej        d3ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        ej        gej        ej	        d4ej	        igej        ej        d5ej        igej        d%ej        iej        ej	        ej        di ej        d(ej        iej        ej	        ej        d6ej        ej	        ej        dej        ej	        ej        d6ej        ej        ej        d7ej        ej	        ej        dej        ej        ej        d7ej        ej	        ej        ej        d8ej        ej        ej        ej	        ej        ej        ej        ej        ej        ej        ej        d9ej        ej	        ej        ej        ej        ej        d:ej        d(ej        iej        ej        ej        d;ej        iej        ej	        ej        d<ZdS )=    N)Image)Tasksc                       e Zd ZdZdZdZdS )	InputKeysimagetextvideoN)__name__
__module____qualname__IMAGETEXTVIDEO     j/lsinfo/ai/hellotax_ai/data_center/backend/venv/lib/python3.11/site-packages/modelscope/pipeline_inputs.pyr   r   	   s        EDEEEr   r   c                   .    e Zd ZdZdZdZdZdZdZdZ	dZ
d	S )
	InputTyper   r   audior	   boxdictlistnumberN)r
   r   r   r   r   AUDIOr   BOXDICTLISTNUMBERr   r   r   r   r      s6        EDEE
CDDFFFr   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           	      D   t           |          }| t          j        k    rOt          |          j        dk    s3t          ||          s%J d|  d| dt          |           d|             d S d S t          ||          s#J d|  d| dt          |           d|             d S )NVideoCapturezinvalid input type for z, expected z	 but got z
 )
INPUT_TYPEr   r   r    r
   
isinstance)
input_typeinputexpected_types      r   check_input_typer-   I   s    z*MY_$$E{{#~55E=9Y9Y55ljll]llUYZ_U`U`llejll 65Y5555 %// 	m 	mljll]llUYZ_U`U`llejll	m 	m/ 	m 	mr   )r   r   )imgcategory_names)r   prompt)r.   mask)r.   r1   	reference)	sky_imagescene_image)templateuser)contentstyle)masked_modelposeclothtarget_pose_path)
dataset_idcase_id)r=   r>   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)rU   positivenegative)wavr   )nearend_micfarend_speechr   r	   )r.   r   )r	   r   )r   r   rD   )	mesh_pathtexture_pathr0   uvsize
image_size
output_dir)video_input_pathvideo_output_path	mask_pathr0   )r.   prompts)numpynpPILr   modelscope.utils.constantr   r$   r   r   r   strndarrayr   r   bytesr   r   r   r   r   r    r   r   intr(   INPUT_TYPE_SCHEMAr-   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             + + + + + +               Oc2:u{3NCOc5"*-Oc2:'9:MD"*%NT44::&NT44::&c	
 OA  OB  OB  N(  M7H
  N N 	=! Hm m mU 
 U" 
	!#U* 
O-U. 
 	#/U6 
"O9U: 
O=U> 
#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