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

keep track id attribute in dump file #247

Merged
merged 1 commit into from
Dec 21, 2018
Merged
Changes from all commits
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
6 changes: 6 additions & 0 deletions cvat/apps/engine/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ def to_box_paths(self):
group_id=box.group_id,
boxes=[box0, box1],
attributes=box.attributes,
client_id=box.client_id,
)
paths.append(path)

Expand All @@ -491,6 +492,7 @@ def _to_poly_paths(self, iter_attr_name):
stop_frame=shape.frame + 1,
group_id=shape.group_id,
shapes=[shape0, shape1],
client_id=shape.client_id,
attributes=shape.attributes,
)
paths.append(path)
Expand Down Expand Up @@ -2080,10 +2082,14 @@ def _flip_shape(shape, im_w, im_h):
im_w = im_meta_data['original_size'][0]['width']
im_h = im_meta_data['original_size'][0]['height']

counter = 0
for shape_type in ["boxes", "polygons", "polylines", "points"]:
path_list = paths[shape_type]
for path in path_list:
path_id = path.client_id if path.client_id != -1 else counter
counter += 1
dump_dict = OrderedDict([
("id", str(path_id)),
("label", path.label.name),
])
if path.group_id:
Expand Down