View Features guide page for Features schema definitions and details.

Create a feature

Features will fall into one of two categories: Objects & Classifications.
Here are examples of tool objects you can create.

from labelbox import Tool

bbox_tool = Tool(tool=Tool.Type.BBOX, name="dog_box")
poly_tool = Tool(tool=Tool.Type.POLYGON, name="dog_poly")
seg_tool = Tool(tool=Tool.Type.SEGMENTATION, name="dog_seg")
point_tool = Tool(tool=Tool.Type.POINT, name="dog_center")
line_tool = Tool(tool=Tool.Type.LINE, name="dog_orientation")
ner_tool = Tool(tool=Tool.Type.NER, name="dog_reference")

Here are examples of classifications you can create.

from labelbox import Classification, Option

text_classification = Classification(class_type=Classification.Type.TEXT,
                                     instructions="dog_name")
radio_classification = Classification(class_type=Classification.Type.RADIO,
                                      instructions="dog_breed",
                                      options=[Option("poodle")])
checklist_classification = Classification(
    class_type=Classification.Type.CHECKLIST,
    instructions="background",
    options=[Option("at_park"), Option("has_leash")])

Get a feature

You can get the feature schema by name or schema id.

from labelbox import client

client = Client(api_key="<YOUR_API_KEY>")

## Search feature by name in your org
regulatory_sign_feature_schema = next(client.get_feature_schemas("regulatory-sign"))
classification_feature = next(client.get_feature_schemas("Quality Issues"))

## Get feature by feature schema ID. You can get this from the UI
regulatory_sign_feature_schema = client.get_feature_schema("FEATURE_SCHEMA_ID")

print(regulatory_sign_feature_schema)
print(classification_feature)