Skip to content
DeepForgeby svx
All problems
MediumComputer Visioncv-366

MOTA Computation

Problem

Compute the multi-object tracking accuracy metric.

MOTA = 1 - (fn + fp + idsw) / num_gt, where fn, fp and idsw are the false negatives, false positives and identity switches. Return the value rounded to 4 decimal places, or 0.0 when num_gt is 0.

Hint

All errors are normalized by the number of ground-truth boxes, so MOTA can go negative.

Test cases

case 1
in: [10,2,1,0]
expected: 0.7
case 2
in: [4,0,0,1]
expected: 0.75
case 3
in: [5,6,2,2]
expected: -1
case 4
in: [0,0,0,0]
expected: 0
Starter codePython
def mota(num_gt, fn, fp, idsw):
    # Your code here
    pass

4 test cases · run your code against them in the editor