-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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 refactor
- Loading branch information
1 parent
1feeef6
commit 66c6e7e
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |