Skip to content

Commit

Permalink
Support automatic tag annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
subdavis committed Nov 10, 2021
1 parent 7bf4154 commit 7860d8d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion cvat/apps/lambda_manager/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,9 @@ def __init__(self, task_id):
def append_shape(self, shape):
self.data["shapes"].append(shape)

def append_tag(self, tag):
self.data["tags"].append(tag)

def submit(self):
if not self.is_empty():
serializer = LabeledDataSerializer(data=self.data)
Expand Down Expand Up @@ -380,7 +383,17 @@ def reset(self):

for anno in annotations:
label_id = labels.get(anno["label"])
if label_id is not None:
if label_id is None:
continue # Invalid tag provided
if anno["type"].lower() == "tag":
results.append_tag({
"frame": frame,
"label_id": label_id,
"source": "auto",
"attributes": [],
"group": None,
})
else:
results.append_shape({
"frame": frame,
"label_id": label_id,
Expand Down

0 comments on commit 7860d8d

Please sign in to comment.