Skip to content

Commit 0015c54

Browse files
committed
Correct error of calculating RMSE of bbox for ARB and FRB
1 parent 8853330 commit 0015c54

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

utils/evaluate_results.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ def measure_traj_prediction(target, prediction, args):
110110
'FRB': {'0.5': 0, '1.0': 0, '1.5': 0}, # bbox - B: bbox
111111
}
112112
bs, ts, _ = target.shape
113-
performance_MSE = np.square(target - prediction).sum(axis=2) # n_samples x ts x 4 --> bs x ts
113+
# Error: performance_MSE = np.square(target - prediction).sum(axis=2) # n_samples x ts x 4 --> bs x ts
114+
performance_MSE = np.square(target - prediction).mean(axis=2)
114115
performance_RMSE = np.sqrt(performance_MSE) # bs x ts
115116
for t in [0.5, 1.0, 1.5]:
116117
end_frame = int(t * args.fps)

utils/metrics.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def evaluate_traj(target, prediction, args):
2929
'FRB': {'0.5': 0, '1.0': 0, '1.5': 0}, # bbox - B: bbox
3030
}
3131
bs, ts, _ = target.shape
32-
performance_MSE = np.square(target - prediction).sum(axis=2) # n_samples x ts x 4 --> bs x ts
32+
# Correct error of calculating RMSE of bbox for ARB and FRB
33+
# performance_MSE = np.square(target - prediction).sum(axis=2) # n_samples x ts x 4 --> bs x ts
34+
performance_MSE = np.square(target - prediction).mean(axis=2)
3335
performance_RMSE = np.sqrt(performance_MSE) #bs x ts
3436
for t in [0.5, 1.0, 1.5]:
3537
end_frame = int(t * args.fps)

0 commit comments

Comments
 (0)