Skip to content

Commit

Permalink
Add track id attribute in dump file again (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
azhavoro authored and nmanovic committed Dec 21, 2018
1 parent 1d88a2d commit 79895fa
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 79895fa

Please sign in to comment.