def test_annotations_xor_predictions_present():
    """Tests frames that contain only annotations or predictions."""
    _ = None
    anno_tracks = {
        1: [0, 2, 4, 6, _, _, _],
        2: [_, _, 0, 2, 4, _, _],
    }
    pred_tracks = {
        1: [_, _, 3, 5, 7, 7, 7],
    }
    anno = _tracks_to_dataframe(anno_tracks)
    pred = _tracks_to_dataframe(pred_tracks)
    acc = mm.utils.compare_to_groundtruth(anno, pred, 'euc', distfields=['Position'], distth=2)
    mh = mm.metrics.create()
    metrics = mh.compute(acc, return_dataframe=False, metrics=[
        'num_objects', 'num_predictions', 'num_unique_objects',
    ])
    np.testing.assert_equal(metrics['num_objects'], 7)
    np.testing.assert_equal(metrics['num_predictions'], 5)
    np.testing.assert_equal(metrics['num_unique_objects'], 2)
Tests frames that contain only annotations or predictions.
motmetrics/tests/test_utils.py