Skip to content

Commit

Permalink
update tasks and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ccinv committed Mar 21, 2024
1 parent 081e87c commit 24ccb49
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tests/python/rest_api/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ def test_can_split_skeleton_tracks_on_jobs(self, jobs):
"label_id": 59,
"frame": 0,
"shapes": [
# https://github.com/opencv/cvat/issues/7498
# https://github.com/opencv/cvat/pull/7615

# This shape covers frame 0 to 7,
# We need to check if frame 5 is generated correctly for job#1

{"type": "points", "frame": 0, "points": [1.0, 2.0]},
{"type": "points", "frame": 7, "points": [2.0, 4.0]},
],
Expand Down Expand Up @@ -587,21 +593,11 @@ def interpolate(frame):
# simple interpolate from ([1, 2], 1) to ([2, 4], 7)
return [(2.0 - 1.0) / 7 * (frame - 0) + 1.0, (4.0 - 2.0) / 7 * (frame - 0) + 2.0]

def compare_float_lists(list1, list2):
if len(list1) != len(list2):
return False

for num1, num2 in zip(list1, list2):
if not math.isclose(num1,num2):
return False

return True

for element in track["elements"]:
element_frames = set(shape["frame"] for shape in element["shapes"])
assert all(
[
compare_float_lists(interpolate(shape["frame"]), shape["points"])
not DeepDiff(interpolate(shape["frame"]), shape["points"], significant_digits=2)
for shape in element["shapes"]
if shape["frame"] >= 0 and shape["frame"] <= 7
]
Expand Down

0 comments on commit 24ccb49

Please sign in to comment.