Check volume difference metric ¶
By: 89douner on Aug. 16, 2022, 2:18 a.m.
Hi
I'd like to notice you that there is code you should check.
But, I found some error code.
I think it should change from "truth_vol = np.sum(prediction)" to "truth_vol=np.sum(truth)".
def volume_difference(truth, prediction, batchwise=False):
'''
Computes the total volume difference between the prediction and ground truth.
----------
prediction : np.array
Array containing the prediction.
truth : np.array
Array containing the ground truth.
batchwise : bool
Optional. Indicate whether the computation should be done batchwise, assuming that the first dimension of the
data is the batch. Default: False.
Returns
-------
float or tuple
'''
if(not batchwise):
pred_vol = np.sum(prediction)
truth_vol = np.sum(prediction)
return np.abs(pred_vol - truth_vol)
else:
It may be not problem (because the score is shown on leaderboard). But, The host should check this.