Skip to content

Commit

Permalink
Changed metrics default value to NaN (#180)
Browse files Browse the repository at this point in the history
* Changed default value to nan

* Revert test change
  • Loading branch information
thuiop authored Jul 16, 2021
1 parent 90f1d53 commit bc2a029
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions btk/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def meas_ksb_ellipticity(image, additional_params):
f"Shear measurement error : '{res.error_message }'. \
This error may happen for faint galaxies or inaccurate detections."
)
result = [np.nan, np.nan, np.nan]
return result


Expand Down Expand Up @@ -328,7 +329,7 @@ def segmentation_metrics_blend(
/ np.sum(np.logical_or(true_segmentation, detected_segmentation))
)
else:
iou_blend_results.append(-1)
iou_blend_results.append(np.nan)
return iou_blend_results


Expand Down Expand Up @@ -448,11 +449,11 @@ def reconstruction_metrics_blend(
target_meas_blend_results[k].append(res_deblended)
target_meas_blend_results[k + "_true"].append(res_isolated)
else:
msr_blend_results.append(-1)
psnr_blend_results.append(-1)
ssim_blend_results.append(-1)
msr_blend_results.append(np.nan)
psnr_blend_results.append(np.nan)
ssim_blend_results.append(np.nan)
for k in target_meas_blend_results.keys():
target_meas_blend_results[k].append(-1)
target_meas_blend_results[k].append(np.nan)

return msr_blend_results, psnr_blend_results, ssim_blend_results, target_meas_blend_results

Expand Down

0 comments on commit bc2a029

Please sign in to comment.