o
    ߥi                     @   s  d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZmZmZ edZG dd deZi e	jejge	jejge	jejge	jejge	jejge	jejge	jejge	jejge	jejge	jejge	j ej!ge	j"ej#ge	j$ej%ge	j&ej'ge	j(ej)ge	j*ej)ge	j+ej,ge	j-ej.ge	j/ej0ge	j1ej2ge	j3ej4ge	j5ej6ge	j7ej8ge	j9ej)ge	j:ej;ge	j<ej=ge	j>ej?gi
Z@ed	fd
eeAef deAdeBfddZCd	S )    )DictMappingUnion)Metrics)
ConfigDict)Tasks)Registrybuild_from_cfgdefault_groupmetricsc                   @   s   e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"S )#
MetricKeysaccuracyf1z	binary-f1zmacro-f1zmicro-f1	precisionrecallpsnrssimlpipsniqeavg_lossfscorefidzbleu-1zbleu-4zrouge-1zrouge-lnedmAPinbatch_t2i_recall_at_1cropping_ratiodistortion_valuestability_scorepplplccsrccrmsemrrndcgARcolorfulnesskendall_tau_correlationN)$__name__
__module____qualname__ACCURACYF1	Binary_F1Macro_F1Micro_F1	PRECISIONRECALLPSNRSSIMLPIPSNIQEAVERAGE_LOSSFScoreFIDBLEU_1BLEU_4ROUGE_1ROUGE_LNEDr   BatchAccCROPPING_RATIODISTORTION_VALUESTABILITY_SCOREPPLPLCCSRCCRMSEMRRNDCGr$   ColorfulnessKendall_Tau_Correlation rI   rI   N/home/ubuntu/.local/lib/python3.10/site-packages/modelscope/metrics/builder.pyr      sD    r   N
metric_cfgfielddefault_argsc                 C   s4   t | trd| v sJ ntd| i} t| t||dS )a/   Build metric given metric_name and field.

    Args:
        metric_name (str | dict): The metric name or metric config dict.
        field (str, optional):  The field of this metric, default value: 'default' for all fields.
        default_args (dict, optional): Default initialization arguments.
    type)	group_keyrM   )
isinstancer   r   r	   METRICS)rK   rL   rM   rI   rI   rJ   build_metricT   s   

rR   )Dtypingr   r   r   modelscope.metainfor   modelscope.utils.configr   modelscope.utils.constantr   modelscope.utils.registryr   r	   r
   rQ   objectr   image_segmentationimage_ins_seg_coco_metricsentence_similarityseq_cls_metricnlisentiment_classificationtoken_classificationtoken_cls_metrictext_generationtext_gen_metricchattext_classificationimage_denoisingimage_denoise_metricimage_deblurringvideo_super_resolutionvideo_super_resolution_metricimage_color_enhancementimage_color_enhance_metricimage_portrait_enhancement!image_portrait_enhancement_metricvideo_summarizationvideo_summarization_metricimage_captioningr   visual_question_answeringmovie_scene_segmentationmovie_scene_segmentation_metricimage_inpaintingimage_inpainting_metric#referring_video_object_segmentation*referring_video_object_segmentation_metricvideo_frame_interpolation video_frame_interpolation_metricvideo_stabilizationvideo_stabilization_metric$image_quality_assessment_degradation+image_quality_assessment_degradation_metricimage_quality_assessment_mos#image_quality_assessment_mos_metricbad_image_detectingocr_recognitionocr_recognition_metricefficient_diffusion_tuningloss_metrictranslation_evaluationtranslation_evaluation_metrictask_default_metricsstrdictrR   rI   rI   rI   rJ   <module>   s   $








	













%