Skip to content

Commit

Permalink
CLI: Let function create-native submit label types to the server
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecLad committed Jan 31, 2025
1 parent 1a90c5f commit be87003
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cvat-cli/src/cvat_cli/_internal/commands_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ def execute(
"name": label_spec.name,
}
)

if getattr(label_spec, "type", "any") != "any":
# Add the type conditionally, to stay compatible with older
# CVAT versions when the function doesn't define label types.
remote_function["labels_v2"][-1]["type"] = label_spec.type
else:
raise cvataa.BadFunctionError(
f"Unsupported function spec type: {type(function.spec).__name__}"
Expand Down

0 comments on commit be87003

Please sign in to comment.