From 07bb676f538e37c7859657be4ff9f449024ec174 Mon Sep 17 00:00:00 2001 From: "kirill.sizov" Date: Thu, 9 Sep 2021 11:36:23 +0300 Subject: [PATCH] Remove save interpolated shapes --- cvat/apps/dataset_manager/annotation.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cvat/apps/dataset_manager/annotation.py b/cvat/apps/dataset_manager/annotation.py index 88989dbb4921..b7b164830a8f 100644 --- a/cvat/apps/dataset_manager/annotation.py +++ b/cvat/apps/dataset_manager/annotation.py @@ -110,9 +110,6 @@ def filter_track_shapes(shapes): interpolated_shapes[stop + 1]['outside']: segment_shapes.append(interpolated_shapes[stop + 1]) - # Should delete 'interpolation_shapes' and 'keyframe' keys because - # Track and TrackedShape models don't expect these fields - del track['interpolated_shapes'] for shape in segment_shapes: shape.pop('keyframe', None) @@ -429,15 +426,6 @@ def _modify_unmached_object(obj, end_frame): shape["frame"] = end_frame shape["outside"] = True obj["shapes"].append(shape) - # Need to update cached interpolated shapes - # because key shapes were changed - if obj.get("interpolated_shapes"): - last_interpolated_shape = obj["interpolated_shapes"][-1] - for frame in range(last_interpolated_shape["frame"] + 1, end_frame): - last_interpolated_shape = deepcopy(last_interpolated_shape) - last_interpolated_shape["frame"] = frame - obj["interpolated_shapes"].append(last_interpolated_shape) - obj["interpolated_shapes"].append(shape) @staticmethod def get_interpolated_shapes(track, start_frame, end_frame): @@ -713,9 +701,6 @@ def interpolate(shape0, shape1): return shapes - if track.get("interpolated_shapes"): - return track["interpolated_shapes"] - shapes = [] curr_frame = track["shapes"][0]["frame"] prev_shape = {} @@ -742,8 +727,6 @@ def interpolate(shape0, shape1): shape["frame"] = end_frame shapes.extend(interpolate(prev_shape, shape)) - track["interpolated_shapes"] = shapes - return shapes @staticmethod @@ -760,6 +743,5 @@ def _unite_objects(obj0, obj1): track["frame"] = min(obj0["frame"], obj1["frame"]) track["shapes"] = list(sorted(shapes.values(), key=lambda shape: shape["frame"])) - track["interpolated_shapes"] = [] return track