Fix point interpolation (#1344)
* Extend formats tests with different track types * Add unordered list comparison * Skip empty list comparison * fix * fix * Reproduce problem * Fix point interpolation for single point * undo rest api refactormain
parent
1feeef6e73
commit
66c6e7e919
@ -0,0 +1,39 @@
|
|||||||
|
# Copyright (C) 2020 Intel Corporation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
from cvat.apps.engine.data_manager import TrackManager
|
||||||
|
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
class TrackManagerTest(TestCase):
|
||||||
|
def test_single_point_interpolation(self):
|
||||||
|
track = {
|
||||||
|
"frame": 0,
|
||||||
|
"label_id": 0,
|
||||||
|
"group": None,
|
||||||
|
"attributes": [],
|
||||||
|
"shapes": [
|
||||||
|
{
|
||||||
|
"frame": 0,
|
||||||
|
"points": [1.0, 2.0],
|
||||||
|
"type": "points",
|
||||||
|
"occluded": False,
|
||||||
|
"outside": False,
|
||||||
|
"attributes": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"frame": 2,
|
||||||
|
"attributes": [],
|
||||||
|
"points": [3.0, 4.0, 5.0, 6.0],
|
||||||
|
"type": "points",
|
||||||
|
"occluded": False,
|
||||||
|
"outside": True
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolated = TrackManager.get_interpolated_shapes(track, 0, 2)
|
||||||
|
|
||||||
|
self.assertEqual(len(interpolated), 3)
|
||||||
Loading…
Reference in New Issue