Skip to content

Commit e1d29db

Browse files
author
Matt Sokoloff
committed
schema id -> feature schema id
1 parent 466c7a0 commit e1d29db

File tree

20 files changed

+257
-485
lines changed

20 files changed

+257
-485
lines changed

examples/annotation_types/basics.ipynb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397
"1. Value\n",
398398
" - Must be either a Geometry, TextEntity, or Classification\n",
399399
" - This is the same as a top level tool in labelbox\n",
400-
"2. name or schema_id\n",
400+
"2. name or feature_schema_id\n",
401401
" - This is the id that corresponds to a particular class or just simply the class name\n",
402402
" - If uploading to labelbox this must match a field in an ontology.\n",
403403
"3. (Optional) Classifications \n",
@@ -437,7 +437,7 @@
437437
"\n",
438438
"point_annotation = ObjectAnnotation(\n",
439439
" value = Point(x = 5, y = 3),\n",
440-
" schema_id = \"ckrgcgl89000108jtggc9e687\"\n",
440+
" feature_schema_id = \"ckrgcgl89000108jtggc9e687\"\n",
441441
")"
442442
]
443443
},
@@ -471,7 +471,7 @@
471471
"\n",
472472
"polygon_annotation = ObjectAnnotation(\n",
473473
" value = Polygon(points = [Point(x = x, y = y) for x,y in xy_poly]),\n",
474-
" schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
474+
" feature_schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
475475
")\n",
476476
"\n"
477477
]
@@ -500,7 +500,7 @@
500500
"\n",
501501
"line_annotation = ObjectAnnotation(\n",
502502
" value = Line(points = [Point(x = x, y = y) for x,y in xy_line]),\n",
503-
" schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
503+
" feature_schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
504504
")"
505505
]
506506
},
@@ -529,7 +529,7 @@
529529
"\n",
530530
"rectangle_annotation = ObjectAnnotation(\n",
531531
" value = Rectangle(start = start, end = end),\n",
532-
" schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
532+
" feature_schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
533533
")"
534534
]
535535
},
@@ -557,7 +557,7 @@
557557
"\n",
558558
"mask_annotation = ObjectAnnotation(\n",
559559
" value = Mask(mask = ImageData(arr = np.zeros((32,32,3), dtype = np.uint8)), color = (255,255,255)),\n",
560-
" schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
560+
" feature_schema_id = \"ckrgcel71000008jtd9mn0szu\"\n",
561561
")"
562562
]
563563
},
@@ -639,7 +639,7 @@
639639
"\n",
640640
"entity_annotation = ObjectAnnotation(\n",
641641
" value = TextEntity(start = 10, end = 12),\n",
642-
" schema_id = \"ckrgddyli000108mk0c0t9qya\"\n",
642+
" feature_schema_id = \"ckrgddyli000108mk0c0t9qya\"\n",
643643
")"
644644
]
645645
},
@@ -844,7 +844,7 @@
844844
")\n",
845845
"\n",
846846
"text_annotation = ClassificationAnnotation(\n",
847-
" schema_id = \"my text class\", \n",
847+
" feature_schema_id = \"my text class\", \n",
848848
" value = Text(answer = \"some text answer\") \n",
849849
")"
850850
]
@@ -871,8 +871,8 @@
871871
"\n",
872872
"\n",
873873
"radio_annotation = ClassificationAnnotation(\n",
874-
" schema_id = \"ckresqdg7000001jnb70v4zcc\",\n",
875-
" value = Radio(answer = ClassificationAnswer(schema_id = \"ckrdy06ia000007ky94h04qlj\")) \n",
874+
" feature_schema_id = \"ckresqdg7000001jnb70v4zcc\",\n",
875+
" value = Radio(answer = ClassificationAnswer(feature_schema_id = \"ckrdy06ia000007ky94h04qlj\")) \n",
876876
")"
877877
]
878878
},
@@ -893,8 +893,8 @@
893893
"source": [
894894
"\n",
895895
"checklist_annotation = ClassificationAnnotation(\n",
896-
" schema_id = \"ckrestd5g000101jnhudjf29a\",\n",
897-
" value = Checklist(answer = [ClassificationAnswer(schema_id = \"ckrdy06ia000007ky94h04qlj\")])\n",
896+
" feature_schema_id = \"ckrestd5g000101jnhudjf29a\",\n",
897+
" value = Checklist(answer = [ClassificationAnswer(feature_schema_id = \"ckrdy06ia000007ky94h04qlj\")])\n",
898898
")\n",
899899
" \n",
900900
"checklist_annotation = ClassificationAnnotation(\n",
@@ -967,7 +967,7 @@
967967
"source": [
968968
"### Interacting with labelbox:\n",
969969
"* For this label to be compatible with labelbox we need the following:\n",
970-
" - all named features must have schema_ids\n",
970+
" - all named features must have feature_schema_ids\n",
971971
" - all data must have urls\n",
972972
" - masks\n",
973973
" - images\n",
@@ -1170,7 +1170,7 @@
11701170
"metadata": {},
11711171
"source": [
11721172
"### Assigning Schema Ids:\n",
1173-
"* All tools, classifications, and options either have names or schema_ids.\n",
1173+
"* All tools, classifications, and options either have names or feature_schema_ids.\n",
11741174
"* Locally it is convenient to provide a name so that we don't need a labelbox project to use these interfaces.\n",
11751175
"* To use MAL and MEA schema ids are required"
11761176
]
@@ -1220,18 +1220,18 @@
12201220
"metadata": {},
12211221
"outputs": [],
12221222
"source": [
1223-
"def show_schema_ids(label):\n",
1223+
"def show_feature_schema_ids(label):\n",
12241224
" for annotation in label.annotations:\n",
1225-
" print(f\"Object : {annotation.name} - {annotation.schema_id}\")\n",
1225+
" print(f\"Object : {annotation.name} - {annotation.feature_schema_id}\")\n",
12261226
" for classification in getattr(annotation, 'classifications', []):\n",
1227-
" print(f\"--- Subclass : {classification.name} - {classification.schema_id}\")\n",
1227+
" print(f\"--- Subclass : {classification.name} - {classification.feature_schema_id}\")\n",
12281228
" option = classification.value\n",
1229-
" print(f\"--- --- Options: {option.answer.name} - {option.answer.schema_id}\")\n",
1229+
" print(f\"--- --- Options: {option.answer.name} - {option.answer.feature_schema_id}\")\n",
12301230
"\n",
12311231
" if isinstance(annotation, ClassificationAnnotation):\n",
12321232
" for option in annotation.value.answer:\n",
1233-
" print(f\"--- Options: {option.name} - {option.schema_id}\")\n",
1234-
"show_schema_ids(label)"
1233+
" print(f\"--- Options: {option.name} - {option.feature_schema_id}\")\n",
1234+
"show_feature_schema_ids(label)"
12351235
]
12361236
},
12371237
{
@@ -1241,8 +1241,8 @@
12411241
"metadata": {},
12421242
"outputs": [],
12431243
"source": [
1244-
"label.assign_schema_ids(ontology)\n",
1245-
"show_schema_ids(label)"
1244+
"label.assign_feature_schema_ids(ontology)\n",
1245+
"show_feature_schema_ids(label)"
12461246
]
12471247
},
12481248
{

0 commit comments

Comments
 (0)