|
41 | 41 | "- Polyline\n", |
42 | 42 | "- Classification - radio\n", |
43 | 43 | "- Classification - checklist\n", |
| 44 | + "- Classification - free text\n", |
| 45 | + "- Nested classifications \n", |
44 | 46 | "\n", |
45 | 47 | "**NOT** supported:\n", |
46 | | - "- Polygons \n", |
47 | | - "- Segmentation masks\n", |
48 | | - "- Free form text classifications\n", |
49 | | - "\n", |
50 | | - "Please note that this list of unsupported annotations only refers to limitations for importing annotations. For example, when using the Labelbox editor, segmentation masks can be created and edited on video assets.\n" |
| 48 | + "- Polygons [not supported in video editor or model]\n", |
| 49 | + "- Raster segmentation masks [not supported in model] \n", |
| 50 | + "- Vector segmentation masks [not supported in video editor]\n", |
| 51 | + "\n" |
51 | 52 | ], |
52 | 53 | "cell_type": "markdown" |
53 | 54 | }, |
|
680 | 681 | "outputs": [], |
681 | 682 | "execution_count": null |
682 | 683 | }, |
683 | | - { |
684 | | - "metadata": {}, |
685 | | - "source": [ |
686 | | - "##### Raster Segmentation ########\n", |
687 | | - "\n", |
688 | | - "instance_uri = \"https://storage.googleapis.com/labelbox-datasets/video-sample-data/mask_example.png\"\n", |
689 | | - "\n", |
690 | | - "\n", |
691 | | - "\n", |
692 | | - "video_mask_prediction=[\n", |
693 | | - " lb_types.VideoMaskAnnotation(\n", |
694 | | - " frames=[\n", |
695 | | - " lb_types.MaskFrame(index=10, instance_uri=instance_uri)\n", |
696 | | - " ],\n", |
697 | | - " instances=[\n", |
698 | | - " lb_types.MaskInstance(color_rgb=(255,255,255), name=\"video_mask\")\n", |
699 | | - " ] \n", |
700 | | - " )\n", |
701 | | - "]\n", |
702 | | - "\n", |
703 | | - "video_mask_prediction_ndjson = {\n", |
704 | | - " \"masks\": {\n", |
705 | | - " \"frames\": [{\n", |
706 | | - " \"index\": 10,\n", |
707 | | - " \"instanceURI\": instance_uri\n", |
708 | | - " }],\n", |
709 | | - " \"instances\": [\n", |
710 | | - " {\n", |
711 | | - " \"colorRGB\": (255, 255, 255),\n", |
712 | | - " \"name\": \"video_mask\",\n", |
713 | | - " }\n", |
714 | | - " ]\n", |
715 | | - " }\n", |
716 | | - "}" |
717 | | - ], |
718 | | - "cell_type": "code", |
719 | | - "outputs": [], |
720 | | - "execution_count": null |
721 | | - }, |
722 | 684 | { |
723 | 685 | "metadata": {}, |
724 | 686 | "source": [ |
|
763 | 725 | "print(\"Failed data rows: \",task.failed_data_rows)" |
764 | 726 | ], |
765 | 727 | "cell_type": "code", |
766 | | - "outputs": [], |
| 728 | + "outputs": [ |
| 729 | + { |
| 730 | + "name": "stderr", |
| 731 | + "output_type": "stream", |
| 732 | + "text": [ |
| 733 | + "There are errors present. Please look at `task.errors` for more details\n" |
| 734 | + ] |
| 735 | + }, |
| 736 | + { |
| 737 | + "name": "stdout", |
| 738 | + "output_type": "stream", |
| 739 | + "text": [ |
| 740 | + "Errors: Duplicate global keys found: sample-video-2.mp4\n", |
| 741 | + "Failed data rows: [{'message': 'Duplicate global keys found: sample-video-2.mp4', 'failedDataRows': [{'globalKey': 'sample-video-2.mp4', 'rowData': 'https://storage.googleapis.com/labelbox-datasets/video-sample-data/sample-video-2.mp4', 'attachmentInputs': []}]}]\n" |
| 742 | + ] |
| 743 | + } |
| 744 | + ], |
767 | 745 | "execution_count": null |
768 | 746 | }, |
769 | 747 | { |
|
782 | 760 | " lb.Tool(tool=lb.Tool.Type.BBOX, name=\"bbox_video\"),\n", |
783 | 761 | " lb.Tool(tool=lb.Tool.Type.POINT, name=\"point_video\"),\n", |
784 | 762 | " lb.Tool(tool=lb.Tool.Type.LINE, name=\"line_video_frame\"),\n", |
785 | | - " lb.Tool(tool=lb.Tool.Type.RASTER_SEGMENTATION, name=\"video_mask\"),\n", |
786 | 763 | " lb.Tool(\n", |
787 | 764 | " tool=lb.Tool.Type.BBOX, name=\"bbox_class\",\n", |
788 | 765 | " classifications=[\n", |
|
872 | 849 | "\n", |
873 | 850 | "ontology = client.create_ontology(\"Ontology Video Annotations\", \n", |
874 | 851 | " ontology_builder.asdict(), \n", |
875 | | - " # media_type=lb.MediaType.Video\n", |
| 852 | + " media_type=lb.MediaType.Video\n", |
876 | 853 | " )" |
877 | 854 | ], |
878 | 855 | "cell_type": "code", |
|
912 | 889 | "model_run.upsert_data_rows(global_keys=[global_key])" |
913 | 890 | ], |
914 | 891 | "cell_type": "code", |
915 | | - "outputs": [], |
| 892 | + "outputs": [ |
| 893 | + { |
| 894 | + "data": { |
| 895 | + "text/plain": [ |
| 896 | + "True" |
| 897 | + ] |
| 898 | + }, |
| 899 | + "execution_count": 90, |
| 900 | + "metadata": {}, |
| 901 | + "output_type": "execute_result" |
| 902 | + } |
| 903 | + ], |
916 | 904 | "execution_count": null |
917 | 905 | }, |
918 | 906 | { |
|
947 | 935 | " frame_bbox_with_checklist_subclass_prediction,\n", |
948 | 936 | " global_radio_prediction,\n", |
949 | 937 | " global_checklist_prediction,\n", |
950 | | - " video_mask_prediction,\n", |
951 | 938 | " text_prediction\n", |
952 | 939 | " ]\n", |
953 | 940 | "\n", |
|
988 | 975 | " frame_bbox_with_checklist_subclass_prediction_ndjson,\n", |
989 | 976 | " global_radio_classification_ndjson,\n", |
990 | 977 | " global_checklist_classification_ndjson,\n", |
991 | | - " video_mask_prediction_ndjson,\n", |
992 | 978 | " text_prediction_ndjson\n", |
993 | 979 | "]: \n", |
994 | 980 | " annotation.update({\n", |
|
1022 | 1008 | "print(\"Status of uploads: \", upload_job_prediction.statuses)" |
1023 | 1009 | ], |
1024 | 1010 | "cell_type": "code", |
1025 | | - "outputs": [], |
| 1011 | + "outputs": [ |
| 1012 | + { |
| 1013 | + "name": "stdout", |
| 1014 | + "output_type": "stream", |
| 1015 | + "text": [ |
| 1016 | + "Errors: []\n", |
| 1017 | + "Status of uploads: [{'uuid': 'e3145fa9-42b8-466f-9ac5-0130aeab1060', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '04e035b4-3083-4408-9a67-9cb52cbe027b', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'aafaeda7-8ba3-4df1-8e42-a02fe72add94', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '956687f4-091c-4dc0-9c84-0b4e35ae451b', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'b7c6e33e-2cc4-46be-8a1f-d920cabf115b', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'daff0aff-8834-4e80-97f5-cf2d38684c5c', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'a611c275-39d8-47aa-808c-969692eb1698', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '9ed7be94-bf89-432b-99ff-c834f31087f0', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '6ed2ef7c-e83a-48e6-8073-c291779c7497', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '14a4950f-0835-49bb-a968-81c41cda6869', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '5bd23f6c-ab87-44b0-a32b-49c84f72b06c', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}]\n" |
| 1018 | + ] |
| 1019 | + } |
| 1020 | + ], |
1026 | 1021 | "execution_count": null |
1027 | 1022 | }, |
1028 | 1023 | { |
|
1051 | 1046 | "project.setup_editor(ontology)" |
1052 | 1047 | ], |
1053 | 1048 | "cell_type": "code", |
1054 | | - "outputs": [], |
| 1049 | + "outputs": [ |
| 1050 | + { |
| 1051 | + "name": "stderr", |
| 1052 | + "output_type": "stream", |
| 1053 | + "text": [ |
| 1054 | + "Default createProject behavior will soon be adjusted to prefer batch projects. Pass in `queue_mode` parameter explicitly to opt-out for the time being.\n" |
| 1055 | + ] |
| 1056 | + } |
| 1057 | + ], |
1055 | 1058 | "execution_count": null |
1056 | 1059 | }, |
1057 | 1060 | { |
|
1071 | 1074 | ")" |
1072 | 1075 | ], |
1073 | 1076 | "cell_type": "code", |
1074 | | - "outputs": [], |
| 1077 | + "outputs": [ |
| 1078 | + { |
| 1079 | + "data": { |
| 1080 | + "text/plain": [ |
| 1081 | + "<Batch ID: 28e7da10-f660-11ed-9f2b-f9c234af8129>" |
| 1082 | + ] |
| 1083 | + }, |
| 1084 | + "execution_count": 95, |
| 1085 | + "metadata": {}, |
| 1086 | + "output_type": "execute_result" |
| 1087 | + } |
| 1088 | + ], |
1075 | 1089 | "execution_count": null |
1076 | 1090 | }, |
1077 | 1091 | { |
|
1368 | 1382 | "]\n", |
1369 | 1383 | "\n", |
1370 | 1384 | "\n", |
1371 | | - "instance_uri = \"https://storage.googleapis.com/labelbox-datasets/video-sample-data/mask_example.png\"\n", |
1372 | | - "video_mask_annotation=[\n", |
1373 | | - " lb_types.VideoMaskAnnotation(\n", |
1374 | | - " frames=[\n", |
1375 | | - " lb_types.MaskFrame(index=10, instance_uri=instance_uri)\n", |
1376 | | - " ],\n", |
1377 | | - " instances=[\n", |
1378 | | - " lb_types.MaskInstance(color_rgb=(255,255,255), name=\"video_mask\")\n", |
1379 | | - " ] \n", |
1380 | | - " )\n", |
1381 | | - "]\n", |
1382 | | - "\n", |
1383 | 1385 | "text_annotation = [lb_types.ClassificationAnnotation(\n", |
1384 | 1386 | " name=\"free_text\", # must match your ontology feature's name\n", |
1385 | 1387 | " value=lb_types.Text(answer=\"sample text\")\n", |
|
1416 | 1418 | " polyline_annotation,\n", |
1417 | 1419 | " global_checklist_annotation,\n", |
1418 | 1420 | " global_radio_annotation,\n", |
1419 | | - " video_mask_annotation,\n", |
1420 | 1421 | " nested_checklist_annotation,\n", |
1421 | 1422 | " nested_radio_annotation,\n", |
1422 | 1423 | " text_annotation\n", |
|
1457 | 1458 | "print(\"Status of uploads: \", upload_job_annotation.statuses)" |
1458 | 1459 | ], |
1459 | 1460 | "cell_type": "code", |
1460 | | - "outputs": [], |
| 1461 | + "outputs": [ |
| 1462 | + { |
| 1463 | + "name": "stdout", |
| 1464 | + "output_type": "stream", |
| 1465 | + "text": [ |
| 1466 | + "Errors: []\n", |
| 1467 | + "Status of uploads: [{'uuid': 'c5ddce8f-c672-49d7-bc43-f4cc5afbe0f2', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '9b2bf816-6f22-4b05-818a-d200a2061a94', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'f6bf224d-a295-484b-8078-16e49e7583ec', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '0602a136-8383-49c0-be64-36ea1499cd31', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '306df4bd-a22d-48c7-bfee-fb0e8695d965', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '60ec1dfc-64bb-4354-98f0-67aec7794bac', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '6fd8c58d-883d-4fdb-9bdc-598c663e0ad4', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '200c256f-b6cd-4469-987a-e9d773dc5715', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'b1c3ccbe-21fd-4c41-aeee-e2df9732cd5f', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '7682c660-147a-4cf8-9b3a-a15859100142', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '4e80a895-3722-49e9-8d00-15eded343a60', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}]\n" |
| 1468 | + ] |
| 1469 | + } |
| 1470 | + ], |
1461 | 1471 | "execution_count": null |
1462 | 1472 | }, |
1463 | 1473 | { |
|
1474 | 1484 | "model_run.upsert_labels(project_id=project.uid)" |
1475 | 1485 | ], |
1476 | 1486 | "cell_type": "code", |
1477 | | - "outputs": [], |
| 1487 | + "outputs": [ |
| 1488 | + { |
| 1489 | + "data": { |
| 1490 | + "text/plain": [ |
| 1491 | + "True" |
| 1492 | + ] |
| 1493 | + }, |
| 1494 | + "execution_count": 99, |
| 1495 | + "metadata": {}, |
| 1496 | + "output_type": "execute_result" |
| 1497 | + } |
| 1498 | + ], |
1478 | 1499 | "execution_count": null |
1479 | 1500 | }, |
1480 | 1501 | { |
|
0 commit comments