Skip to content

Commit

Permalink
Support automatic tag annotation (#3896)
Browse files Browse the repository at this point in the history
  • Loading branch information
subdavis authored Dec 7, 2021
1 parent 4c52438 commit b1c2689
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add project tasks paginations (<https://github.com/openvinotoolkit/cvat/pull/3910>)
- Add remove issue button (<https://github.com/openvinotoolkit/cvat/pull/3952>)
- Options to change font size & position of text labels on the canvas (<https://github.com/openvinotoolkit/cvat/pull/3972>)
- Add "tag" return type for automatic annotation in Nuclio (<https://github.com/openvinotoolkit/cvat/pull/3896>)

### Changed
- TDB
Expand Down
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 label 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 b1c2689

Please sign in to comment.