From 168d5124748badca28b3eee90ab30d28e70f1d88 Mon Sep 17 00:00:00 2001 From: Dmitrii Lavrukhin Date: Wed, 21 Aug 2024 15:47:04 +0400 Subject: [PATCH] fixes --- cvat-core/src/annotations-objects.ts | 2 +- cvat/apps/dataset_manager/annotation.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cvat-core/src/annotations-objects.ts b/cvat-core/src/annotations-objects.ts index 320a270cb547..defcf7dbbada 100644 --- a/cvat-core/src/annotations-objects.ts +++ b/cvat-core/src/annotations-objects.ts @@ -2918,7 +2918,7 @@ export class SkeletonTrack extends Track { parentID: this.clientID, readOnlyFields: ['group', 'zOrder', 'source', 'rotation'], }); - }).sort((a: Annotation, b: Annotation) => a.label.id - b.label.id); + }).filter(Boolean).sort((a: Annotation, b: Annotation) => a.label.id - b.label.id); } public updateFromServerResponse(body: SerializedTrack): void { diff --git a/cvat/apps/dataset_manager/annotation.py b/cvat/apps/dataset_manager/annotation.py index d82ce7479563..a0f5f5380224 100644 --- a/cvat/apps/dataset_manager/annotation.py +++ b/cvat/apps/dataset_manager/annotation.py @@ -91,7 +91,7 @@ def has_overlap(a, b): prev_shape = shape - if not prev_shape['outside'] and prev_shape['frame'] <= stop: + if prev_shape is not None and not prev_shape['outside'] and prev_shape['frame'] <= stop: return True return False @@ -552,6 +552,8 @@ def _calc_objects_similarity(obj0, obj1, start_frame, overlap, dimension): return 0 def _modify_unmatched_object(self, obj, end_frame): + if not obj["shapes"]: + return shape = obj["shapes"][-1] if not shape["outside"]: shape = deepcopy(shape)