Support automatic tag annotation (#3896)

main
Brandon Davis 4 years ago committed by GitHub
parent 4c52438991
commit b1c26898a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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

@ -353,6 +353,9 @@ class LambdaJob:
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)
@ -380,7 +383,17 @@ class LambdaJob:
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,

Loading…
Cancel
Save