From e9b591c0d38a2702e90f8f2defcde9f4cc59fe46 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Thu, 12 Mar 2020 18:20:18 +0300 Subject: [PATCH] sort frame shapes by z_order --- cvat/apps/annotation/annotation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cvat/apps/annotation/annotation.py b/cvat/apps/annotation/annotation.py index 9c805154fe1f..70054255c242 100644 --- a/cvat/apps/annotation/annotation.py +++ b/cvat/apps/annotation/annotation.py @@ -322,7 +322,7 @@ def _get_frame(annotations, shape): annotations = {} data_manager = DataManager(self._annotation_ir) - for shape in data_manager.to_shapes(self._db_task.size): + for shape in sorted(data_manager.to_shapes(self._db_task.size), key=lambda s: s.get("z_order", 0)): _get_frame(annotations, shape).labeled_shapes.append(self._export_labeled_shape(shape)) for tag in self._annotation_ir.tags: