diff --git a/changelog.d/20250204_183545_roman_unknown_any.md b/changelog.d/20250204_183545_roman_unknown_any.md new file mode 100644 index 000000000000..c7a51a7e48f3 --- /dev/null +++ b/changelog.d/20250204_183545_roman_unknown_any.md @@ -0,0 +1,5 @@ +### Changed + +- When invoking Nuclio functions, labels of type `any` can now be mapped to + labels of all types except `skeleton` + () diff --git a/cvat-ui/src/components/model-runner-modal/labels-mapper.tsx b/cvat-ui/src/components/model-runner-modal/labels-mapper.tsx index 29098e158cb3..551dc3f08dfb 100644 --- a/cvat-ui/src/components/model-runner-modal/labels-mapper.tsx +++ b/cvat-ui/src/components/model-runner-modal/labels-mapper.tsx @@ -39,7 +39,7 @@ function labelsCompatible(modelLabel: LabelInterface, jobLabel: LabelInterface): const compatibleTypes = [[LabelType.MASK, LabelType.POLYGON]]; return modelLabelType === jobLabelType || (jobLabelType === 'any' && modelLabelType !== LabelType.SKELETON) || - (modelLabelType === 'unknown' && jobLabelType !== LabelType.SKELETON) || // legacy support + ((modelLabelType === 'any' || modelLabelType === 'unknown') && jobLabelType !== LabelType.SKELETON) || // legacy support compatibleTypes.some((compatible) => compatible.includes(jobLabelType) && compatible.includes(modelLabelType)); } diff --git a/cvat/apps/lambda_manager/views.py b/cvat/apps/lambda_manager/views.py index 6ea48a6ff564..9edb5889ae75 100644 --- a/cvat/apps/lambda_manager/views.py +++ b/cvat/apps/lambda_manager/views.py @@ -202,7 +202,7 @@ def parse_attributes(attrs_spec): for label in spec: parsed_label = { "name": label["name"], - "type": label.get("type", "unknown"), + "type": label.get("type", "any"), "attributes": parse_attributes(label.get("attributes", [])), } if parsed_label["type"] == "skeleton": @@ -312,7 +312,7 @@ def labels_compatible(model_label: dict, task_label: Label) -> bool: return ( model_type == db_type or (db_type == "any" and model_type != "skeleton") - or (model_type == "unknown" and db_type != "skeleton") + or (model_type == "any" and db_type != "skeleton") or any( [ model_type in compatible and db_type in compatible