Conditionality

The conditions JSON describes the set of conditions under which the attribute should be collected. Each of these conditions objects described in the JSON are OR'd together, and each property within these objects is AND'd together.

Definition: Conditions

"conditions": {
  "label_condition": {
  	"label": ["Car", "Truck", "Motorcycle"]
  },
  "attribute_conditions": [{ "is_moving": "No" }, { "is_parked": "Yes" }]
}

The conditions object describes which labels and attributes to ask for based on already provided responses. conditions can have up to two key-values: label_condition and attribute_conditions.

Definition: Condition

// condition for the label being equal to vehicle
{ "label": "vehicle" }

// condition for the label to be equal to either car or truck
{ "label": ["car", "truck"] } 

// condition for the is_parked attribute to be equal to be Yes
{ "is_parked": "Yes" }

A Condition is an object defined by a single key and a value. The key describes the semantic string that you want to check, whether it is 'label' for the label_condition or the attribute identifier for attribute_conditions.

The value is either a string or an array of strings. In the case of a string, the label or attribute will be checked for strict equality with the string. In the case of an array of strings, the label or attribute will be checked for membership within the array.

Condition Parameters

The label_condition key-value will describe the label or labels that you want to collect this attribute for. The value is a Condition object, which must have a key equal to 'label' and a value corresponding to the label or furthest "leaf" node / subchoice of a LabelDescription object.

{
  ...,
  "geometries": {
     ...
  },
  "annotation_attributes": {
    "occlusion": {
      "description": "What percent of the object is occluded?",
      "choices": ["0%", "25%", "50%", "75%"],
      "conditions": {
        "label_condition": {
        	"label": ["Car", "Truck", "Motorcycle"]
        }
      }
    }
  },
  ...,
}

For example, if in the above example, you wanted an "occlusion" attribute for some mix of the "leaf" labels, you could specify the label condition for the attribute as e.g. { "label": ["Car", "Truck", "Motorcycle", "Adult"] }. If you wanted the attribute to be conditional on all the subchoices of a given label (e.g., all "Vehicle"s), you would simply specify all of those subchoices in the array,
e.g. { "label": ["Car", "Truck", "Train", "Motorcycle"] }.

The attribute_conditions key-value will describe under what conditions with the other attributes you'd like to collect this attribute for. The value should be a Condition object or a list of Condition objects.

attribute_conditions are automatically verified for circular dependencies, and tasks will be rejected if any circular dependencies are found.