!8692 Support uncertatiny, single channel heatmap, separated image datafiles

From: @ngtony
Reviewed-by: @jonyguo
Signed-off-by:
pull/8692/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit d773b54fe7

@ -109,12 +109,18 @@ message Explain {
repeated float ground_truth_prob = 1;
repeated int32 predicted_label = 2;
repeated float predicted_prob = 3;
repeated float ground_truth_prob_sd = 4;
repeated float ground_truth_prob_itl95_low = 5;
repeated float ground_truth_prob_itl95_hi = 6;
repeated float predicted_prob_sd = 7;
repeated float predicted_prob_itl95_low = 8;
repeated float predicted_prob_itl95_hi = 9;
}
message Explanation{
optional string explain_method = 1;
optional int32 label = 2;
optional bytes heatmap = 3;
optional string heatmap_path = 3;
}
message Benchmark{
@ -130,11 +136,10 @@ message Explain {
repeated string benchmark_method = 3;
}
optional string image_id = 1; // The Metadata and image id and benchmark must have one fill in
optional bytes image_data = 2;
optional int32 sample_id = 1;
optional string image_path = 2; // The Metadata and image path must have one fill in
repeated int32 ground_truth_label = 3;
optional Inference inference = 4;
repeated Explanation explanation = 5;
repeated Benchmark benchmark = 6;

File diff suppressed because it is too large Load Diff

@ -28,8 +28,8 @@ def check_explain_proto(explain):
if not isinstance(explain, Explain):
raise TypeError(f'Plugin explainer expects a {Explain.__name__} value.')
if not explain.image_id and not explain.metadata.label and not explain.benchmark:
raise ValueError(f'The Metadata and image id and benchmark must have one fill in.')
if not explain.image_path and not explain.inference and not explain.metadata.label and not explain.benchmark:
raise ValueError('One of metadata, image path, inference or benchmark has to be filled in.')
def package_explain_event(explain_str):

Loading…
Cancel
Save