File size: 702 Bytes
9c890d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import numpy as np

from evaluation.ucpe_inputs import ClipLabels
from evaluation.ucpe_scores import score_tracks


def test_frames_before_and_at_the_query_do_not_affect_masked_scores():
    gt = np.zeros((4, 1, 3), np.float32)
    prediction = gt.copy()
    prediction[:2, :, 0] = 10
    labels = ClipLabels(gt, np.ones((4, 1), bool))
    probability = np.ones((4, 1), np.float32)
    mask = np.arange(4)[:, None] > 1
    masked = score_tracks(labels, prediction, probability, evaluation_mask=mask)
    assert masked["metric"]["aj"] == 100
    assert masked["metric"]["apd"] == 100
    assert masked["metric"]["epe"] == 0
    assert score_tracks(labels, prediction, probability)["metric"]["aj"] < 100