diff --git a/examples/annotation_import/conversational.ipynb b/examples/annotation_import/conversational.ipynb index e4f2fe2a3..637a8d583 100644 --- a/examples/annotation_import/conversational.ipynb +++ b/examples/annotation_import/conversational.ipynb @@ -310,15 +310,7 @@ "project.setup_editor(ontology) # Connect your ontology and editor to your project" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING:labelbox.client: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" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -336,29 +328,14 @@ "# Create a batch to send to your MAL project\n", "batch = project.create_batch(\n", " \"first-batch-convo-demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # Paginated collection of data row objects, list of data row ids or global keys\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")\n", "\n", "print(\"Batch: \", batch)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Batch: \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -428,16 +405,7 @@ "print(\"Status of uploads: \", upload_job.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -463,15 +431,7 @@ "print(\"Status of uploads: \", upload_job.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -484,7 +444,6 @@ { "metadata": {}, "source": [ - "#upload_job\n", "# project.delete()\n", "# dataset.delete()" ], diff --git a/examples/annotation_import/image.ipynb b/examples/annotation_import/image.ipynb index 3a6c9f715..597e9aea0 100644 --- a/examples/annotation_import/image.ipynb +++ b/examples/annotation_import/image.ipynb @@ -304,6 +304,11 @@ "outputs": [], "execution_count": null }, + { + "metadata": {}, + "source": [], + "cell_type": "markdown" + }, { "metadata": {}, "source": [ @@ -690,28 +695,13 @@ "source": [ "batch = project.create_batch(\n", " \"Initial batch2\", # name of the batch\n", - " global_keys=global_key, # DataRow objects, a list of global keys or data row ids are supported\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=1 # priority between 1-5\n", ")\n", "print(\"Batch\", batch)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Batch \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -773,7 +763,7 @@ { "metadata": {}, "source": [ - "label_ndjson_method2 = []\n", + "label_ndjson = []\n", "for annotation in [radio_annotation_ndjson, \n", " checklist_annotation_ndjson, \n", " text_annotation_ndjson,\n", @@ -792,7 +782,7 @@ " annotation.update({\n", " 'dataRow': {'globalKey':global_key},\n", " })\n", - " label_ndjson_method2.append(annotation)\n" + " label_ndjson.append(annotation)\n" ], "cell_type": "code", "outputs": [], @@ -821,23 +811,14 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"mal_job\"+str(uuid.uuid4()), \n", - " predictions=label_ndjson_method2)\n", + " predictions=label_ndjson)\n", "\n", "print(\"Errors:\", upload_job.errors)\n", "print(\"Status of uploads: \", upload_job.statuses)\n", "print(\" \")" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -855,7 +836,7 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"label_import_job\"+str(uuid.uuid4()), \n", - " labels=label_ndjson_method2)\n", + " labels=label_ndjson)\n", "\n", "print(\"Errors:\", upload_job.errors)\n", "print(\"Status of uploads: \", upload_job.statuses)\n", diff --git a/examples/annotation_import/pdf.ipynb b/examples/annotation_import/pdf.ipynb index f8e5d59cd..af291aab8 100644 --- a/examples/annotation_import/pdf.ipynb +++ b/examples/annotation_import/pdf.ipynb @@ -291,7 +291,7 @@ "metadata": {}, "source": [ "## Text layer url is required for uploading entity annotations\n", - "global_key = \"0801.3483.pd\"\n", + "global_key = \"0801.3483.pdf\"\n", "img_url = {\n", " \"row_data\": {\n", " \"pdf_url\": \"https://storage.googleapis.com/labelbox-datasets/arxiv-pdf/data/99-word-token-pdfs/0801.3483.pdf\",\n", @@ -431,23 +431,12 @@ "source": [ "project.create_batch(\n", " \"PDF_annotation_batch\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -522,16 +511,7 @@ " " ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "entities_annotations_ndjson={'name': 'named_entity', 'textSelections': [{'groupId': '2f4336f4-a07e-4e0a-a9e1-5629b03b719b', 'tokenIds': ['3f984bf3-1d61-44f5-b59a-9658a2e3440f', '3bf00b56-ff12-4e52-8cc1-08dbddb3c3b8', '6e1c3420-d4b7-4c5a-8fd6-ead43bf73d80', '87a43d32-af76-4a1d-b262-5c5f4d5ace3a', 'e8606e8a-dfd9-4c49-a635-ad5c879c75d0', '67c7c19e-4654-425d-bf17-2adb8cf02c30', '149c5e80-3e07-49a7-ab2d-29ddfe6a38fa', 'b0e94071-2187-461e-8e76-96c58738a52c'], 'page': 1}]}\n", - "entities_annotation=confidence=None name='named_entity' feature_schema_id=None extra={} value=DocumentEntity(text_selections=[DocumentTextSelection(token_ids=['3f984bf3-1d61-44f5-b59a-9658a2e3440f', '3bf00b56-ff12-4e52-8cc1-08dbddb3c3b8', '6e1c3420-d4b7-4c5a-8fd6-ead43bf73d80', '87a43d32-af76-4a1d-b262-5c5f4d5ace3a', 'e8606e8a-dfd9-4c49-a635-ad5c879c75d0', '67c7c19e-4654-425d-bf17-2adb8cf02c30', '149c5e80-3e07-49a7-ab2d-29ddfe6a38fa', 'b0e94071-2187-461e-8e76-96c58738a52c'], group_id='2f4336f4-a07e-4e0a-a9e1-5629b03b719b', page=1)]) classifications=[]\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -545,19 +525,20 @@ { "metadata": {}, "source": [ - "# create a Label\n", + "\n", "\n", "labels = []\n", "\n", - "labels.append(lb_types.Label(\n", - " data=lb_types.DocumentData(\n", - " global_key=global_key),\n", - " annotations = [\n", - " entities_annotation,\n", - " checklist_annotation, \n", - " text_annotation,\n", - " radio_annotation\n", - " ]\n", + "labels.append(\n", + " lb_types.Label(\n", + " data=lb_types.DocumentData(\n", + " global_key=global_key),\n", + " annotations = [\n", + " entities_annotation,\n", + " checklist_annotation, \n", + " text_annotation,\n", + " radio_annotation\n", + " ]\n", " )\n", ")" ], @@ -577,7 +558,7 @@ "metadata": {}, "source": [ "\n", - "ndjson_annotation = []\n", + "label_ndjson = []\n", "for annot in [\n", " entities_annotations_ndjson,\n", " bbox_annotation_ndjson,\n", @@ -590,7 +571,7 @@ " annot.update({\n", " 'dataRow': {'globalKey': global_key},\n", " })\n", - " ndjson_annotation.append(annot)\n", + " label_ndjson.append(annot)\n", "\n" ], "cell_type": "code", @@ -618,7 +599,7 @@ " client = client,\n", " project_id = project.uid,\n", " name=\"pdf_annotation_upload\" + str(uuid.uuid4()),\n", - " predictions=ndjson_annotation)\n", + " predictions=label_ndjson)\n", "\n", "upload_job.wait_until_done()\n", "# Errors will appear for annotation uploads that failed.\n", @@ -644,7 +625,7 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"label_import_job\"+str(uuid.uuid4()), \n", - " labels=ndjson_annotation)\n", + " labels=label_ndjson)\n", "\n", "print(\"Errors:\", upload_job.errors)\n", "print(\"Status of uploads: \", upload_job.statuses)" diff --git a/examples/annotation_import/text.ipynb b/examples/annotation_import/text.ipynb index 5120fbca7..ef0abc9bc 100644 --- a/examples/annotation_import/text.ipynb +++ b/examples/annotation_import/text.ipynb @@ -291,16 +291,7 @@ "print(\"Failed data rows:\", task.failed_data_rows)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: None\n", - "Failed data rows: None\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -425,29 +416,14 @@ "# Create a batch to send to your MAL project\n", "batch = project.create_batch(\n", " \"first-batch-text-demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")\n", "\n", "print(\"Batch: \", batch)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Batch: \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -478,10 +454,10 @@ " data=lb_types.TextData(\n", " global_key=global_key),\n", " annotations = [\n", - " named_entitity_annotation, \n", - " radio_annotation, \n", - " checklist_annotation, \n", - " text_annotation\n", + " named_entitity_annotation, \n", + " radio_annotation, \n", + " checklist_annotation, \n", + " text_annotation\n", " ]\n", " )\n", ")" @@ -500,7 +476,7 @@ { "metadata": {}, "source": [ - "label_ndjson_method2 = []\n", + "label_ndjson = []\n", "for annotations in [entities_ndjson, \n", " radio_annotation_ndjson, \n", " checklist_annotation_ndjson,\n", @@ -511,7 +487,7 @@ " annotations.update({\n", " 'dataRow': { 'globalKey': global_key }\n", " }) \n", - " label_ndjson_method2.append(annotations)" + " label_ndjson.append(annotations)" ], "cell_type": "code", "outputs": [], @@ -542,23 +518,14 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"mal_import_job\"+str(uuid.uuid4()), \n", - " predictions=label_ndjson_method2)\n", + " predictions=label_ndjson)\n", "\n", "upload_job_mal.wait_until_done();\n", "print(\"Errors:\", upload_job_mal.errors)\n", "print(\"Status of uploads: \", upload_job_mal.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -576,22 +543,14 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"label_import_job\"+str(uuid.uuid4()), \n", - " labels=label_ndjson_method2)\n", + " labels=label_ndjson)\n", "\n", "upload_job_label_import.wait_until_done();\n", "print(\"Errors:\", upload_job_label_import.errors)\n", "print(\"Status of uploads: \", upload_job_label_import.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/annotation_import/tiled.ipynb b/examples/annotation_import/tiled.ipynb index 2b2fbe577..048262a24 100644 --- a/examples/annotation_import/tiled.ipynb +++ b/examples/annotation_import/tiled.ipynb @@ -566,15 +566,7 @@ "print(\"Failed data rows:\", task.failed_data_rows)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "None\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -717,29 +709,14 @@ "# Create a batch to send to your MAL project\n", "batch = project.create_batch(\n", " \"first-batch-geo-demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # Paginated collection of data row objects\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")\n", "\n", "print(\"Batch: \", batch)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Batch: \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -823,142 +800,37 @@ "}" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "WARNING:labelbox.data.annotation_types.data.tiled_image:Unexpected tile size (512, 512, 3).\n", - "WARNING:labelbox.data.annotation_types.data.tiled_image:Unexpected tile size (512, 512, 3).\n" - ] - } - ], + "outputs": [], "execution_count": null }, { "metadata": {}, "source": [ - "\n", - "label = lb_types.Label(\n", - " data=lb_types.TiledImageData(\n", - " global_key=global_key,\n", - " tile_layer=tile_layer,\n", - " tile_bounds=bounds,\n", - " zoom_levels=[17, 23]\n", - " ),\n", - " annotations = [\n", - " point_annotation,\n", - " polyline_annotation,\n", - " polygon_annotation,\n", - " bbox_annotation,\n", - " radio_annotation,\n", - " bbox_with_checklist_subclass, \n", - " bbox_with_free_text_subclass,\n", - " checklist_annotation,\n", - " polygon_annotation_two\n", - " ]\n", + "labels =[]\n", + "labels.append(\n", + " lb_types.Label(\n", + " data=lb_types.TiledImageData(\n", + " global_key=global_key,\n", + " tile_layer=tile_layer,\n", + " tile_bounds=bounds,\n", + " zoom_levels=[17, 23]\n", + " ),\n", + " annotations = [\n", + " point_annotation,\n", + " polyline_annotation,\n", + " polygon_annotation,\n", + " bbox_annotation,\n", + " radio_annotation,\n", + " bbox_with_checklist_subclass, \n", + " bbox_with_free_text_subclass,\n", + " checklist_annotation,\n", + " polygon_annotation_two\n", + " ]\n", + " )\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "[{'uuid': '61ad497c-85bd-4f3c-a32e-4cb368844a22',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'point_geo',\n", - " 'classifications': [],\n", - " 'point': {'x': -122.31741025134123, 'y': 37.87355669249922}},\n", - " {'uuid': '5d6f057f-a0cd-4e9f-b9c2-ade883874226',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'polyline_geo',\n", - " 'classifications': [],\n", - " 'line': [{'x': -122.31757789012927, 'y': 37.87396317833991},\n", - " {'x': -122.31639782443663, 'y': 37.87396741226917},\n", - " {'x': -122.31638977853417, 'y': 37.87277872707839}]},\n", - " {'uuid': '7f2190d0-ba76-4c26-9c95-5b152f1e522d',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'polygon_geo',\n", - " 'classifications': [],\n", - " 'polygon': [{'x': -122.31691812612837, 'y': 37.873289980495024},\n", - " {'x': -122.31710184090099, 'y': 37.87304335144298},\n", - " {'x': -122.31680146054286, 'y': 37.87303594197371},\n", - " {'x': -122.31691812612837, 'y': 37.873289980495024}]},\n", - " {'uuid': '2c7b71f2-b0dc-4ea6-85bf-363794c1dac7',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'bbox_geo',\n", - " 'classifications': [],\n", - " 'bbox': {'top': 37.873713376083884,\n", - " 'left': -122.31734455895823,\n", - " 'height': 0.0001460709135656657,\n", - " 'width': 0.0006141705536464315}},\n", - " {'name': 'radio_question_geo',\n", - " 'answer': {'name': 'first_radio_answer'},\n", - " 'uuid': '3a14d7b8-409b-4f2a-b48d-70c27f2c03c2',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'}},\n", - " {'uuid': '5978bc1f-cc40-4588-8539-e905693b962d',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'bbox_checklist_geo',\n", - " 'classifications': [{'name': 'checklist_class_name',\n", - " 'answer': [{'name': 'first_checklist_answer'}]}],\n", - " 'bbox': {'top': 37.87340218056304,\n", - " 'left': -122.31711256877092,\n", - " 'height': 0.00020534685175022105,\n", - " 'width': 0.0004572754559006853}},\n", - " {'uuid': 'ebe20f18-b513-4645-a019-1f7732694d14',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'bbox_text_geo',\n", - " 'classifications': [{'name': 'free_text_geo', 'answer': 'sample text'}],\n", - " 'bbox': {'top': 37.87318201423049,\n", - " 'left': -122.31750814315438,\n", - " 'height': 0.00019791053033202388,\n", - " 'width': 0.00040764323713915473}},\n", - " {'name': 'checklist_question_geo',\n", - " 'uuid': 'fa58fd3d-8346-4c9a-bf55-65b27ed92508',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'answer': [{'name': 'first_checklist_answer'},\n", - " {'name': 'second_checklist_answer'},\n", - " {'name': 'third_checklist_answer'}]},\n", - " {'uuid': 'cdc124f7-5e1b-42d5-a9b7-1f98d50c141d',\n", - " 'dataRow': {'id': 'cldxm4s5906rw074nfm5kgtrl'},\n", - " 'name': 'polygon_geo_2',\n", - " 'classifications': [],\n", - " 'polygon': [{'x': -122.31703039689702, 'y': 37.87397804081582},\n", - " {'x': -122.31702351036107, 'y': 37.87393525033866},\n", - " {'x': -122.31698907768116, 'y': 37.87389857276706},\n", - " {'x': -122.3169787478772, 'y': 37.87385883871054},\n", - " {'x': -122.31695808826926, 'y': 37.87385578224377},\n", - " {'x': -122.31695464500127, 'y': 37.873816048164166},\n", - " {'x': -122.31692021232138, 'y': 37.873779370533214},\n", - " {'x': -122.31690988251741, 'y': 37.87373352346883},\n", - " {'x': -122.3168857796415, 'y': 37.873696845796786},\n", - " {'x': -122.3168547902296, 'y': 37.873684619902065},\n", - " {'x': -122.31682035754969, 'y': 37.873611264491025},\n", - " {'x': -122.31676526526188, 'y': 37.87355013492598},\n", - " {'x': -122.3167583787259, 'y': 37.87351651364362},\n", - " {'x': -122.31671017297403, 'y': 37.87348900531027},\n", - " {'x': -122.31671017297403, 'y': 37.873452327516496},\n", - " {'x': -122.31667918356217, 'y': 37.87344010158117},\n", - " {'x': -122.31663442107829, 'y': 37.87335451997715},\n", - " {'x': -122.31660343166638, 'y': 37.87334840700161},\n", - " {'x': -122.31659998839841, 'y': 37.873320898605485},\n", - " {'x': -122.31654489611057, 'y': 37.87329033370888},\n", - " {'x': -122.31652767977064, 'y': 37.87319863894286},\n", - " {'x': -122.31648980382273, 'y': 37.8731833564708},\n", - " {'x': -122.31648980382273, 'y': 37.873161961004534},\n", - " {'x': -122.31641749519497, 'y': 37.87309166157168},\n", - " {'x': -122.316410608659, 'y': 37.873054983580076},\n", - " {'x': -122.31639683558704, 'y': 37.873039701078184},\n", - " {'x': -122.31635551637117, 'y': 37.873039701078184},\n", - " {'x': -122.31635551637117, 'y': 37.87398109727749},\n", - " {'x': -122.31703039689702, 'y': 37.87397804081582}]}]" - ] - }, - "execution_count": 66, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -972,7 +844,7 @@ { "metadata": {}, "source": [ - "label_ndjson_method2 = []\n", + "label_ndjson = []\n", "\n", "for annotations in [point_annotation_ndjson,\n", " polyline_annotation_ndjson,\n", @@ -991,7 +863,7 @@ " 'globalKey': global_key\n", " }\n", " })\n", - " label_ndjson_method2.append(annotations)\n", + " label_ndjson.append(annotations)\n", " " ], "cell_type": "code", @@ -1021,24 +893,14 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"mal_import_job\"+str(uuid.uuid4()), \n", - " ### use label_ndjson_method2 if labels were created using NDJSON tools\n", - " predictions=label_ndjson_method2)\n", + " predictions=label_ndjson)\n", "\n", "upload_job.wait_until_done();\n", "print(\"Errors:\", upload_job.errors)\n", "print(\"Status of uploads: \", upload_job.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -1056,23 +918,14 @@ " client = client, \n", " project_id = project.uid, \n", " name=\"label_geo_import_job\"+str(uuid.uuid4()), \n", - " # user label_ndjson if labels were created using python annotation tools\n", - " labels=label_ndjson_method2)\n", + " labels=label_ndjson)\n", "\n", "upload_job.wait_until_done();\n", "print(\"Errors:\", upload_job.errors)\n", "print(\"Status of uploads: \", upload_job.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/annotation_import/video.ipynb b/examples/annotation_import/video.ipynb index 13027425d..68e841880 100644 --- a/examples/annotation_import/video.ipynb +++ b/examples/annotation_import/video.ipynb @@ -700,29 +700,14 @@ "# Create a batch to send to your MAL project\n", "batch = project.create_batch(\n", " \"first-batch-video-demo2\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A paginated collection of data row objects\n", + " global_keys=[global_key], # A paginated collection of data row objects\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")\n", "\n", "print(\"Batch: \", batch)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Batch: \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -801,18 +786,7 @@ " " ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'schemaNodeId': 'cldxj6zy80cvx07vdbg7q9qhs', 'featureSchemaId': 'cldxj6zy80cvw07vd9l34hymh', 'required': False, 'name': 'bbox_video', 'tool': 'rectangle', 'color': '#ff0000', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'cldxj6zy80cvz07vdf9285zd6', 'featureSchemaId': 'cldxj6zy80cvy07vdbad5dzyi', 'required': False, 'name': 'point_video', 'tool': 'point', 'color': '#7fff00', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'cldxj6zy80cw107vd7fdq6uyw', 'featureSchemaId': 'cldxj6zy80cw007vdb3hmau7o', 'required': False, 'name': 'line_video_frame', 'tool': 'line', 'color': '#00ffff', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'cldxj6zy90cwb07vd2cdgacin', 'featureSchemaId': 'cldxj6zy80cw207vd3brweppe', 'required': False, 'name': 'bbox_class', 'tool': 'rectangle', 'color': '#7f00ff', 'archived': 0, 'classifications': [{'schemaNodeId': 'cldxj6zy80cwa07vdc3qm8yb2', 'featureSchemaId': 'cldxj6zy80cw307vdgapmcu4e', 'archived': 0, 'required': False, 'instructions': 'bbox_radio', 'name': 'bbox_radio', 'type': 'radio', 'options': [{'schemaNodeId': 'cldxj6zy80cw507vd0r2aadwy', 'featureSchemaId': 'cldxj6zy80cw407vd1ynfckwg', 'label': 'bbox_radio_answer_1', 'value': 'bbox_radio_answer_1'}, {'schemaNodeId': 'cldxj6zy80cw707vda3bqeb9g', 'featureSchemaId': 'cldxj6zy80cw607vd4gel3yrq', 'label': 'bbox_radio_answer_2', 'value': 'bbox_radio_answer_2'}, {'schemaNodeId': 'cldxj6zy80cw907vdhm8c88gw', 'featureSchemaId': 'cldxj6zy80cw807vdhzst22m8', 'label': 'bbox_radio_answer_3', 'value': 'bbox_radio_answer_3'}]}]}\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -873,16 +847,7 @@ "print(\" \")" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -908,16 +873,7 @@ "print(\" \")" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/prediction_upload/geospatial_predictions.ipynb b/examples/prediction_upload/geospatial_predictions.ipynb index 2f392ca6b..163e5c4aa 100644 --- a/examples/prediction_upload/geospatial_predictions.ipynb +++ b/examples/prediction_upload/geospatial_predictions.ipynb @@ -65,15 +65,7 @@ "!pip install -q 'labelbox[data]'" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "477.56s - pydevd: Sending message related to process being replaced timed-out after 5 seconds\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -634,21 +626,10 @@ { "metadata": {}, "source": [ - "model_run.upsert_data_rows(global_keys=global_key)" + "model_run.upsert_data_rows(global_keys=[global_key])" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 43, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -726,16 +707,7 @@ "}" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Unexpected tile size (512, 512, 3).\n", - "Unexpected tile size (512, 512, 3).\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -780,7 +752,7 @@ { "metadata": {}, "source": [ - "label_ndjson_method_2 = []\n", + "label_ndjson = []\n", "for prediction in [\n", " radio_prediction_ndjson,\n", " checklist_prediction_ndjson,\n", @@ -795,7 +767,7 @@ " prediction.update({\n", " 'dataRow': {'globalKey': global_key},\n", " })\n", - " label_ndjson_method_2.append(prediction)" + " label_ndjson.append(prediction)" ], "cell_type": "code", "outputs": [], @@ -814,22 +786,14 @@ "# Upload the prediction label to the Model Run\n", "upload_job_prediction = model_run.add_predictions(\n", " name=\"prediction_upload_job\"+str(uuid.uuid4()),\n", - " predictions=label_ndjson_method_2)\n", + " predictions=label_ndjson)\n", "\n", "# Errors will appear for annotation uploads that failed.\n", "print(\"Errors:\", upload_job_prediction.errors)\n", "print(\"Status of uploads: \", upload_job_prediction.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -874,23 +838,12 @@ "source": [ "project.create_batch(\n", " \"batch_geospatial_prediction_demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # A list of data rows or data row ids\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 49, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -1213,15 +1166,7 @@ "print(\"Status of uploads: \", upload_job_annotation.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -1238,18 +1183,7 @@ "model_run.upsert_labels(project_id=project.uid)" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 53, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/prediction_upload/html_predictions.ipynb b/examples/prediction_upload/html_predictions.ipynb index 5329e360b..c7b635ae8 100644 --- a/examples/prediction_upload/html_predictions.ipynb +++ b/examples/prediction_upload/html_predictions.ipynb @@ -110,7 +110,7 @@ "########### Radio Classification ###########\n", "radio_prediction = lb_types.ClassificationAnnotation(\n", " name=\"radio_question\", \n", - " value=lb_types.Radio(answer = lb_types.ClassificationAnswer(name = \"second_radio_answer\", confidence=0.5))\n", + " value=lb_types.Radio(answer = lb_types.ClassificationAnswer(name = \"first_radio_answer\", confidence=0.5))\n", ")\n", "\n", "\n", @@ -367,21 +367,10 @@ { "metadata": {}, "source": [ - "model_run.upsert_data_rows(global_keys=global_key)" + "model_run.upsert_data_rows(global_keys=[global_key])" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -466,15 +455,7 @@ "print(\"Status of uploads: \", upload_job_prediction.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -519,23 +500,12 @@ "source": [ "project.create_batch(\n", " \"batch_prediction_html\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -648,15 +618,7 @@ "print(\"Status of uploads: \", upload_job_annotation.statuses)\n" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -673,18 +635,7 @@ "model_run.upsert_labels(project_id=project.uid)" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/prediction_upload/image_predictions.ipynb b/examples/prediction_upload/image_predictions.ipynb index 66b4b8d6c..a23596bdc 100644 --- a/examples/prediction_upload/image_predictions.ipynb +++ b/examples/prediction_upload/image_predictions.ipynb @@ -628,21 +628,10 @@ { "metadata": {}, "source": [ - "model_run.upsert_data_rows(global_keys=global_key)" + "model_run.upsert_data_rows(global_keys=[global_key])" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 32, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -691,7 +680,7 @@ { "metadata": {}, "source": [ - "ndjson_prediction_method2 = []\n", + "label_prediction_ndjson = []\n", "\n", "for annot in [\n", " radio_prediction_ndjson,\n", @@ -709,7 +698,7 @@ " annot.update({\n", " 'dataRow': {'globalKey': global_key}\n", " })\n", - " ndjson_prediction_method2.append(annot)" + " label_prediction_ndjson.append(annot)" ], "cell_type": "code", "outputs": [], @@ -728,22 +717,14 @@ "# Upload the prediction label to the Model Run\n", "upload_job_prediction = model_run.add_predictions(\n", " name=\"prediction_upload_job\"+str(uuid.uuid4()),\n", - " predictions=ndjson_prediction_method2)\n", + " predictions=label_prediction_ndjson)\n", "\n", "# Errors will appear for prediction uploads that failed.\n", "print(\"Errors:\", upload_job_prediction.errors)\n", "print(\"Status of uploads: \", upload_job_prediction.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -773,15 +754,7 @@ "project.setup_editor(ontology)" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "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" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -796,23 +769,12 @@ "source": [ "project.create_batch(\n", " \"batch_predictions_demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -1039,18 +1001,7 @@ "model_run.upsert_labels(project_id=project.uid)" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 41, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/prediction_upload/text_predictions.ipynb b/examples/prediction_upload/text_predictions.ipynb index 5056f4fcb..e6c8659fd 100644 --- a/examples/prediction_upload/text_predictions.ipynb +++ b/examples/prediction_upload/text_predictions.ipynb @@ -91,7 +91,7 @@ { "metadata": {}, "source": [ - "API_KEY=\"\"\n", + "API_KEY= \"\"\n", "client = lb.Client(API_KEY)" ], "cell_type": "code", @@ -279,16 +279,7 @@ "print(\"Failed data rows:\", task.failed_data_rows)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: None\n", - "Failed data rows: None\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -399,21 +390,10 @@ { "metadata": {}, "source": [ - "model_run.upsert_data_rows(global_keys=global_key)" + "model_run.upsert_data_rows(global_keys=[global_key])" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -498,16 +478,7 @@ "print(\"Status of uploads: \", upload_job_prediction.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - " \n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -536,15 +507,7 @@ "project.setup_editor(ontology)" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "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" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -559,23 +522,12 @@ "source": [ "project.create_batch(\n", " \"batch_text_prediction_demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # Paginated collection of data row objects, list of data row ids or global keys\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -695,15 +647,7 @@ "print(\"Status of uploads: \", upload_job_annotation.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -720,18 +664,7 @@ "model_run.upsert_labels(project_id=project.uid)" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { diff --git a/examples/prediction_upload/video_predictions.ipynb b/examples/prediction_upload/video_predictions.ipynb index a6950d4f7..7ee9a8909 100644 --- a/examples/prediction_upload/video_predictions.ipynb +++ b/examples/prediction_upload/video_predictions.ipynb @@ -473,23 +473,7 @@ "print(\"Failed data rows: \",task.failed_data_rows)" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "There are errors present. Please look at `task.errors` for more details\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: Duplicate global keys found: sample-video-2.mp4\n", - "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" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -617,21 +601,10 @@ { "metadata": {}, "source": [ - "model_run.upsert_data_rows(global_keys=global_key)" + "model_run.upsert_data_rows(global_keys=[global_key])" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 68, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -652,40 +625,7 @@ "set_feature_schema_id(features_schema, bbox_with_radio_subclass_prediction_ndjson)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'schemaNodeId': 'clfcx0vvw0tdc071019wb0rv9', 'featureSchemaId': 'clfcx0vvw0tdb071075pi09ik', 'required': False, 'name': 'bbox_video', 'tool': 'rectangle', 'color': '#ff0000', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'clfcx0vvw0tdi07100kjffzwk', 'featureSchemaId': 'clfcx0vvw0tdd0710644shrud', 'required': False, 'name': 'bbox_with_radio_subclass', 'tool': 'rectangle', 'color': '#7fff00', 'archived': 0, 'classifications': [{'schemaNodeId': 'clfcx0vvw0tdh07102bx256uu', 'featureSchemaId': 'clfcx0vvw0tde0710dkb40cq8', 'archived': 0, 'required': False, 'instructions': 'sub_radio_question', 'name': 'sub_radio_question', 'type': 'radio', 'options': [{'schemaNodeId': 'clfcx0vvw0tdg0710a7s79n79', 'featureSchemaId': 'clfcx0vvw0tdf07103ms5eh02', 'label': 'first_sub_radio_answer', 'value': 'first_sub_radio_answer'}]}]}\n", - "{'schemaNodeId': 'clfcx0vvw0tdk07104c5z7hzv', 'featureSchemaId': 'clfcx0vvw0tdj0710aigwf9g8', 'required': False, 'name': 'point_video', 'tool': 'point', 'color': '#00ffff', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'clfcx0vvx0tdm07106lchd2ui', 'featureSchemaId': 'clfcx0vvx0tdl0710doq7a7oo', 'required': False, 'name': 'line_video_frame', 'tool': 'line', 'color': '#7f00ff', 'archived': 0, 'classifications': []}\n" - ] - }, - { - "data": { - "text/plain": [ - "{'name': 'bbox_with_radio_subclass',\n", - " 'segments': [{'keyframes': [{'frame': 13,\n", - " 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n", - " 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n", - " 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n", - " {'frame': 14,\n", - " 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n", - " 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n", - " 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n", - " {'frame': 15,\n", - " 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n", - " 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n", - " 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]}]}]}" - ] - }, - "execution_count": 69, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -732,16 +672,7 @@ "print(\"Status of uploads: \", upload_job_prediction.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - "Status of uploads: [{'uuid': '3d46f7cc-40be-42d8-89cd-5e3e326e2b70', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '517fd472-0ddf-4f18-8c90-e0a9e380d1c9', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '73b04bd7-0738-4171-a13e-672b6ac0d93d', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'fe3faa8f-84a3-4f17-ae73-31d5ed83d3b3', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '530521fb-d3c4-4709-89ed-8d21454f4b88', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'b2c2950d-1e64-4f32-8664-702908b836fd', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'bd38fab4-a03b-48c7-a7b9-f5164aa580aa', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '284f5c5c-349e-44bf-a573-1e1eb34459ac', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}]\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -770,15 +701,7 @@ "project.setup_editor(ontology)" ], "cell_type": "code", - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "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" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -793,23 +716,12 @@ "source": [ "project.create_batch(\n", " \"batch_video_prediction_demo\", # Each batch in a project must have a unique name\n", - " global_keys=global_key, # A list of data rows or data row ids\n", + " global_keys=[global_key], # A list of data rows or data row ids\n", " priority=5 # priority between 1(Highest) - 5(lowest)\n", ")" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 73, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -1086,40 +998,7 @@ "set_feature_schema_id(features_schema, bbox_with_radio_subclass_annotation_ndjson)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'schemaNodeId': 'clfcx0vvw0tdc071019wb0rv9', 'featureSchemaId': 'clfcx0vvw0tdb071075pi09ik', 'required': False, 'name': 'bbox_video', 'tool': 'rectangle', 'color': '#ff0000', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'clfcx0vvw0tdi07100kjffzwk', 'featureSchemaId': 'clfcx0vvw0tdd0710644shrud', 'required': False, 'name': 'bbox_with_radio_subclass', 'tool': 'rectangle', 'color': '#7fff00', 'archived': 0, 'classifications': [{'schemaNodeId': 'clfcx0vvw0tdh07102bx256uu', 'featureSchemaId': 'clfcx0vvw0tde0710dkb40cq8', 'archived': 0, 'required': False, 'instructions': 'sub_radio_question', 'name': 'sub_radio_question', 'type': 'radio', 'options': [{'schemaNodeId': 'clfcx0vvw0tdg0710a7s79n79', 'featureSchemaId': 'clfcx0vvw0tdf07103ms5eh02', 'label': 'first_sub_radio_answer', 'value': 'first_sub_radio_answer'}]}]}\n", - "{'schemaNodeId': 'clfcx0vvw0tdk07104c5z7hzv', 'featureSchemaId': 'clfcx0vvw0tdj0710aigwf9g8', 'required': False, 'name': 'point_video', 'tool': 'point', 'color': '#00ffff', 'archived': 0, 'classifications': []}\n", - "{'schemaNodeId': 'clfcx0vvx0tdm07106lchd2ui', 'featureSchemaId': 'clfcx0vvx0tdl0710doq7a7oo', 'required': False, 'name': 'line_video_frame', 'tool': 'line', 'color': '#7f00ff', 'archived': 0, 'classifications': []}\n" - ] - }, - { - "data": { - "text/plain": [ - "{'name': 'bbox_with_radio_subclass',\n", - " 'segments': [{'keyframes': [{'frame': 13,\n", - " 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n", - " 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n", - " 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n", - " {'frame': 14,\n", - " 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n", - " 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n", - " 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n", - " {'frame': 15,\n", - " 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n", - " 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n", - " 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]}]}]}" - ] - }, - "execution_count": 75, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, { @@ -1169,16 +1048,7 @@ "print(\"Status of uploads: \", upload_job_annotation.statuses)" ], "cell_type": "code", - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Errors: []\n", - "Status of uploads: [{'uuid': '4bea6c32-8add-4168-acbd-128cae49b718', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'b54a495a-8ca3-4357-bae0-1af751e569d3', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '57d0f71e-a2b3-464d-acf1-4478143602ec', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '1977db5f-0a39-4d20-b6a2-2abeeed2c27d', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': '92239aea-9e17-441b-8e14-ee928bbc9d09', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'a1cba5d3-eaae-47e7-a626-392e6a76c305', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'bfd3f946-8482-4541-a85e-6768eb30fcfa', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}, {'uuid': 'd05d492e-7293-413c-b385-73aeab0ec9e9', 'dataRow': {'id': 'clfco73at0080079n5dhm9y3a', 'globalKey': 'sample-video-2.mp4'}, 'status': 'SUCCESS'}]\n" - ] - } - ], + "outputs": [], "execution_count": null }, { @@ -1195,18 +1065,7 @@ "model_run.upsert_labels(project_id=project.uid)" ], "cell_type": "code", - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 78, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "execution_count": null }, {