diff --git a/examples/annotation_import/image.ipynb b/examples/annotation_import/image.ipynb index fdab855ae..4dc2ee638 100644 --- a/examples/annotation_import/image.ipynb +++ b/examples/annotation_import/image.ipynb @@ -626,7 +626,10 @@ " name=\"point\"), \n", " lb.Tool( # Polyline tool given the name \"line\"\n", " tool=lb.Tool.Type.LINE,\n", - " name=\"polyline\")]\n", + " name=\"polyline\"),\n", + " lb.Tool( # Relationship tool given the name \"relationship\"\n", + " tool=lb.Tool.Type.RELATIONSHIP,\n", + " name=\"relationship\")]\n", ")\n", "\n", "ontology = client.create_ontology(\"Image Prediction Import Demo\", ontology_builder.asdict(), media_type=lb.MediaType.Image)" diff --git a/examples/annotation_import/pdf.ipynb b/examples/annotation_import/pdf.ipynb index 8678c8687..0f9f2e037 100644 --- a/examples/annotation_import/pdf.ipynb +++ b/examples/annotation_import/pdf.ipynb @@ -120,12 +120,14 @@ { "metadata": {}, "source": [ - "tool_name = \"super\"\n", "ontology_builder = lb.OntologyBuilder(\n", " tools=[ \n", " lb.Tool( # Entity tool given the name \"NER\"\n", " tool=lb.Tool.Type.NER, \n", - " name= tool_name)]\n", + " name= \"NER\"),\n", + " lb.Tool( # Relationship tool given the name \"relationship\"\n", + " tool=lb.Tool.Type.RELATIONSHIP, \n", + " name=\"relationship\")]\n", " )" ], "cell_type": "code", diff --git a/examples/basics/ontologies.ipynb b/examples/basics/ontologies.ipynb index baa2b7f82..c1102eddb 100644 --- a/examples/basics/ontologies.ipynb +++ b/examples/basics/ontologies.ipynb @@ -93,7 +93,8 @@ "| Polyline | line |\n", "| Point | point |\n", "| Segmentation mask | superpixel |\n", - "| Entity | named-entity |" + "| Entity | named-entity |\n", + "| Relationship | edge |" ], "cell_type": "markdown" }, @@ -315,7 +316,8 @@ "seg_tool = lb.Tool(tool=lb.Tool.Type.SEGMENTATION, name=\"dog_seg\")\n", "point_tool = lb.Tool(tool=lb.Tool.Type.POINT, name=\"dog_center\")\n", "line_tool = lb.Tool(tool=lb.Tool.Type.LINE, name=\"dog_orientation\")\n", - "ner_tool = lb.Tool(tool=lb.Tool.Type.NER, name=\"dog_reference\")" + "ner_tool = lb.Tool(tool=lb.Tool.Type.NER, name=\"dog_reference\")\n", + "relationship_tool = lb.Tool(tool=lb.Tool.Type.RELATIONSHIP, name=\"relationship\")" ], "cell_type": "code", "outputs": [], diff --git a/examples/prediction_upload/video_predictions.ipynb b/examples/prediction_upload/video_predictions.ipynb index da926929c..0fe650405 100644 --- a/examples/prediction_upload/video_predictions.ipynb +++ b/examples/prediction_upload/video_predictions.ipynb @@ -583,7 +583,10 @@ " name=\"point_video\"), \n", " lb.Tool( # Polyline tool given the name \"line\"\n", " tool=lb.Tool.Type.LINE,\n", - " name=\"line_video_frame\")]\n", + " name=\"line_video_frame\"),\n", + " lb.Tool( # Relationship tool given the name \"relationship\"\n", + " tool=lb.Tool.Type.RELATIONSHIP,\n", + " name=\"relationship_video\")]\n", ")\n", "\n", "ontology = client.create_ontology(\"Video Prediction Import Demo\", ontology_builder.asdict(), media_type=lb.MediaType.Video)\n", diff --git a/labelbox/schema/ontology.py b/labelbox/schema/ontology.py index d40b8d7c5..f487b8b6e 100644 --- a/labelbox/schema/ontology.py +++ b/labelbox/schema/ontology.py @@ -241,6 +241,7 @@ class Type(Enum): BBOX = "rectangle" LINE = "line" NER = "named-entity" + RELATIONSHIP = "edge" tool: Type name: str