Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix project export with skeletons #5004

Merged
merged 8 commits into from
Sep 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes for shapes
  • Loading branch information
yasakova-anastasia committed Sep 27, 2022
commit 395f360c20679ce999e462e3858cb0852535f220
9 changes: 7 additions & 2 deletions cvat/apps/dataset_manager/task.py
Original file line number Diff line number Diff line change
@@ -426,15 +426,20 @@ def _init_shapes_from_db(self):
)

shapes = {}
elements = {}
for db_shape in db_shapes:
self._extend_attributes(db_shape.labeledshapeattributeval_set,
self.db_attributes[db_shape.label_id]["all"].values())

db_shape.elements = []
if db_shape.parent is None:
shapes[db_shape.id] = db_shape
else:
shapes[db_shape.parent].elements.append(db_shape)
if db_shape.parent not in elements:
elements[db_shape.parent] = []
elements[db_shape.parent].append(db_shape)

for shape_id, shape_elements in elements.items():
shapes[shape_id].elements = shape_elements

serializer = serializers.LabeledShapeSerializer(list(shapes.values()), many=True)
self.ir_data.shapes = serializer.data