Skip to content

Commit 0ca5240

Browse files
authored
Merge pull request #921 from Labelbox/lgluszek/PTDT-1115
[PTDT-1115] User can create a relationship feature
2 parents 5a796da + 6f5c33a commit 0ca5240

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

examples/annotation_import/image.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,10 @@
626626
" name=\"point\"), \n",
627627
" lb.Tool( # Polyline tool given the name \"line\"\n",
628628
" tool=lb.Tool.Type.LINE,\n",
629-
" name=\"polyline\")]\n",
629+
" name=\"polyline\"),\n",
630+
" lb.Tool( # Relationship tool given the name \"relationship\"\n",
631+
" tool=lb.Tool.Type.RELATIONSHIP,\n",
632+
" name=\"relationship\")]\n",
630633
")\n",
631634
"\n",
632635
"ontology = client.create_ontology(\"Image Prediction Import Demo\", ontology_builder.asdict(), media_type=lb.MediaType.Image)"

examples/annotation_import/pdf.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@
120120
{
121121
"metadata": {},
122122
"source": [
123-
"tool_name = \"super\"\n",
124123
"ontology_builder = lb.OntologyBuilder(\n",
125124
" tools=[ \n",
126125
" lb.Tool( # Entity tool given the name \"NER\"\n",
127126
" tool=lb.Tool.Type.NER, \n",
128-
" name= tool_name)]\n",
127+
" name= \"NER\"),\n",
128+
" lb.Tool( # Relationship tool given the name \"relationship\"\n",
129+
" tool=lb.Tool.Type.RELATIONSHIP, \n",
130+
" name=\"relationship\")]\n",
129131
" )"
130132
],
131133
"cell_type": "code",

examples/basics/ontologies.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@
9393
"| Polyline | line |\n",
9494
"| Point | point |\n",
9595
"| Segmentation mask | superpixel |\n",
96-
"| Entity | named-entity |"
96+
"| Entity | named-entity |\n",
97+
"| Relationship | edge |"
9798
],
9899
"cell_type": "markdown"
99100
},
@@ -315,7 +316,8 @@
315316
"seg_tool = lb.Tool(tool=lb.Tool.Type.SEGMENTATION, name=\"dog_seg\")\n",
316317
"point_tool = lb.Tool(tool=lb.Tool.Type.POINT, name=\"dog_center\")\n",
317318
"line_tool = lb.Tool(tool=lb.Tool.Type.LINE, name=\"dog_orientation\")\n",
318-
"ner_tool = lb.Tool(tool=lb.Tool.Type.NER, name=\"dog_reference\")"
319+
"ner_tool = lb.Tool(tool=lb.Tool.Type.NER, name=\"dog_reference\")\n",
320+
"relationship_tool = lb.Tool(tool=lb.Tool.Type.RELATIONSHIP, name=\"relationship\")"
319321
],
320322
"cell_type": "code",
321323
"outputs": [],

examples/prediction_upload/video_predictions.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@
583583
" name=\"point_video\"), \n",
584584
" lb.Tool( # Polyline tool given the name \"line\"\n",
585585
" tool=lb.Tool.Type.LINE,\n",
586-
" name=\"line_video_frame\")]\n",
586+
" name=\"line_video_frame\"),\n",
587+
" lb.Tool( # Relationship tool given the name \"relationship\"\n",
588+
" tool=lb.Tool.Type.RELATIONSHIP,\n",
589+
" name=\"relationship_video\")]\n",
587590
")\n",
588591
"\n",
589592
"ontology = client.create_ontology(\"Video Prediction Import Demo\", ontology_builder.asdict(), media_type=lb.MediaType.Video)\n",

labelbox/schema/ontology.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ class Type(Enum):
241241
BBOX = "rectangle"
242242
LINE = "line"
243243
NER = "named-entity"
244+
RELATIONSHIP = "edge"
244245

245246
tool: Type
246247
name: str

0 commit comments

Comments
 (0)