gesund-ai / gesund

Open source SDK for Gesund.ai platform
MIT License
5 stars 0 forks source link

Ref/better plots #1

Closed ozkanuysal closed 2 weeks ago

ozkanuysal commented 3 weeks ago

Here is example usage of new plots with parameters & thresholds.

from gesund import validation

args = {
    'annotations_json_path': '/home/ozkan/gesund/test_data/object_detection/gesund_custom_format/gesund_custom_format_annotations_obj_det.json',
    'predictions': '/home/ozkan/gesund/test_data/object_detection/gesund_custom_format/gesund_custom_format_predictions_obj_det.json',
    'class_mappings': '/home/ozkan/gesund/test_data/object_detection/test_class_mappings.json',
    'problem_type': 'object_detection',
    'format': 'gesund_custom_format',
    'write_results_to_json': True,
    'plot_configs': {

        #--------------------------#classificaition--------------------------
        #  'class_distributions': {'metrics': ['normal','pneumonia'], 'threshold': 10}, 
        #  'blind_spot': {'class_type': ['Average','1','0']}, 
        #  'performance_by_threshold': {'graph_type': 'graph_1', 'metrics': ['F1', 'Sensitivity', 'Specificity', 'Precision','FPR', 'FNR'], 'threshold': 0.2}, 
        #  'roc': {'roc_class': ['normal', 'pneumonia']}, 
        #  'precision_recall': {'pr_class': ['normal','pneumonia']}, 
        #  'confidence_histogram': {'metrics': ['TP', 'FP'], 'threshold': 0.5}, 
        #  'overall_metrics': {'metrics': ['AUC','Precision'], 'threshold': 0.2} 

        #--------------------------OD--------------------------------------

        'mixed_plot': {'mixed_plot': ['map10', 'map50', 'map75'], 'threshold': 0.5}, 
        'top_misses': {'min_miou': 0.70, 'top_n': 10}, 
        'confidence_histogram': {'confidence_histogram_labels': ['TP', 'FP']}, 
        'classbased_table': {'classbased_table_metrics': ['precision', 'recall', 'f1'], 'threshold': 0.2}, 
        'overall_metrics': {'overall_metrics_metrics': ['map', 'mar'], 'threshold': 0.5}, 
        'blind_spot': {'blind_spot_Average': ['mAP@50', 'mAP@10','mAR@max=10','mAR@max=100'],'threshold': 0.5} 

        #-----------------------------SS-----------------------------------

        # 'violin_graph': {'metrics':['Acc', 'Spec','AUC'], 'threshold': 0.5}, 
        # 'plot_by_meta_data': {'meta_data_args': [ 'FalsePositive','Dice Score','mean Sensitivity','mean AUC','Precision','AverageHausdorffDistance','SimpleHausdorffDistance']}, 
        # 'overall_metrics': {'overall_args': ['mean AUC', 'fwIoU','mean Sensitivity']}, 
        # 'classbased_table': {'classbased_table_args': 0.5}, 
        # 'blind_spot': {'blind_spot_args': ['fwIoU','mean IoU','mean Sensitivity','mean Specificity','mean Kappa','mean AUC','']}, 

    }
}

result = validation.run_metrics(args)
plotting = validation.plotting_metrics(result, args)