|
397 | 397 | "1. Value\n", |
398 | 398 | " - Must be either a Geometry, TextEntity, or Classification\n", |
399 | 399 | " - 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", |
401 | 401 | " - This is the id that corresponds to a particular class or just simply the class name\n", |
402 | 402 | " - If uploading to labelbox this must match a field in an ontology.\n", |
403 | 403 | "3. (Optional) Classifications \n", |
|
437 | 437 | "\n", |
438 | 438 | "point_annotation = ObjectAnnotation(\n", |
439 | 439 | " value = Point(x = 5, y = 3),\n", |
440 | | - " schema_id = \"ckrgcgl89000108jtggc9e687\"\n", |
| 440 | + " feature_schema_id = \"ckrgcgl89000108jtggc9e687\"\n", |
441 | 441 | ")" |
442 | 442 | ] |
443 | 443 | }, |
|
471 | 471 | "\n", |
472 | 472 | "polygon_annotation = ObjectAnnotation(\n", |
473 | 473 | " 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", |
475 | 475 | ")\n", |
476 | 476 | "\n" |
477 | 477 | ] |
|
500 | 500 | "\n", |
501 | 501 | "line_annotation = ObjectAnnotation(\n", |
502 | 502 | " 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", |
504 | 504 | ")" |
505 | 505 | ] |
506 | 506 | }, |
|
529 | 529 | "\n", |
530 | 530 | "rectangle_annotation = ObjectAnnotation(\n", |
531 | 531 | " value = Rectangle(start = start, end = end),\n", |
532 | | - " schema_id = \"ckrgcel71000008jtd9mn0szu\"\n", |
| 532 | + " feature_schema_id = \"ckrgcel71000008jtd9mn0szu\"\n", |
533 | 533 | ")" |
534 | 534 | ] |
535 | 535 | }, |
|
557 | 557 | "\n", |
558 | 558 | "mask_annotation = ObjectAnnotation(\n", |
559 | 559 | " 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", |
561 | 561 | ")" |
562 | 562 | ] |
563 | 563 | }, |
|
639 | 639 | "\n", |
640 | 640 | "entity_annotation = ObjectAnnotation(\n", |
641 | 641 | " value = TextEntity(start = 10, end = 12),\n", |
642 | | - " schema_id = \"ckrgddyli000108mk0c0t9qya\"\n", |
| 642 | + " feature_schema_id = \"ckrgddyli000108mk0c0t9qya\"\n", |
643 | 643 | ")" |
644 | 644 | ] |
645 | 645 | }, |
|
844 | 844 | ")\n", |
845 | 845 | "\n", |
846 | 846 | "text_annotation = ClassificationAnnotation(\n", |
847 | | - " schema_id = \"my text class\", \n", |
| 847 | + " feature_schema_id = \"my text class\", \n", |
848 | 848 | " value = Text(answer = \"some text answer\") \n", |
849 | 849 | ")" |
850 | 850 | ] |
|
871 | 871 | "\n", |
872 | 872 | "\n", |
873 | 873 | "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", |
876 | 876 | ")" |
877 | 877 | ] |
878 | 878 | }, |
|
893 | 893 | "source": [ |
894 | 894 | "\n", |
895 | 895 | "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", |
898 | 898 | ")\n", |
899 | 899 | " \n", |
900 | 900 | "checklist_annotation = ClassificationAnnotation(\n", |
|
967 | 967 | "source": [ |
968 | 968 | "### Interacting with labelbox:\n", |
969 | 969 | "* 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", |
971 | 971 | " - all data must have urls\n", |
972 | 972 | " - masks\n", |
973 | 973 | " - images\n", |
|
1170 | 1170 | "metadata": {}, |
1171 | 1171 | "source": [ |
1172 | 1172 | "### 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", |
1174 | 1174 | "* Locally it is convenient to provide a name so that we don't need a labelbox project to use these interfaces.\n", |
1175 | 1175 | "* To use MAL and MEA schema ids are required" |
1176 | 1176 | ] |
|
1220 | 1220 | "metadata": {}, |
1221 | 1221 | "outputs": [], |
1222 | 1222 | "source": [ |
1223 | | - "def show_schema_ids(label):\n", |
| 1223 | + "def show_feature_schema_ids(label):\n", |
1224 | 1224 | " 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", |
1226 | 1226 | " 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", |
1228 | 1228 | " 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", |
1230 | 1230 | "\n", |
1231 | 1231 | " if isinstance(annotation, ClassificationAnnotation):\n", |
1232 | 1232 | " 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)" |
1235 | 1235 | ] |
1236 | 1236 | }, |
1237 | 1237 | { |
|
1241 | 1241 | "metadata": {}, |
1242 | 1242 | "outputs": [], |
1243 | 1243 | "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)" |
1246 | 1246 | ] |
1247 | 1247 | }, |
1248 | 1248 | { |
|
0 commit comments