Skip to content

Commit 1ec5ed6

Browse files
authored
Merge pull request #1 from dvdhfnr/ea/fix_metric
fix rmse calculation
2 parents 9518168 + ca7415d commit 1ec5ed6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/accuracy_checker/accuracy_checker/metrics/regression.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def _calculate_diff_depth_estimation_rep(self, annotation, prediction):
6666
diff = annotation.mask * self.value_differ(annotation.depth_map, prediction.depth_map)
6767

6868
if np.sum(annotation.mask) > 0:
69-
return np.sqrt(np.sum(diff) / np.sum(annotation.mask))
69+
return np.sum(diff) / np.sum(annotation.mask)
7070
else:
7171
return 0
7272

@@ -190,11 +190,12 @@ def __init__(self, *args, **kwargs):
190190
super().__init__(mse_differ, *args, **kwargs)
191191

192192
def update(self, annotation, prediction):
193-
mse = super().update(annotation, prediction)
194-
return np.sqrt(mse)
193+
rmse = np.sqrt(self.calculate_diff(annotation, prediction))
194+
self.magnitude.append(rmse)
195+
return rmse
195196

196197
def evaluate(self, annotations, predictions):
197-
return np.sqrt(np.mean(self.magnitude)), np.sqrt(np.std(self.magnitude))
198+
return np.mean(self.magnitude), np.std(self.magnitude)
198199

199200

200201
class MeanAbsoluteErrorOnInterval(BaseRegressionOnIntervals):

0 commit comments

Comments
 (0)