Skip to content

Commit 13e09b0

Browse files
ovalle15ovalle15
authored andcommitted
Replace data row id with global keys
1 parent 8f3ec2a commit 13e09b0

File tree

1 file changed

+56
-31
lines changed

1 file changed

+56
-31
lines changed

examples/prediction_upload/video_predictions.ipynb

Lines changed: 56 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
{
8989
"metadata": {},
9090
"source": [
91-
"API_KEY = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbDNhaXV4MTAwMGt4MDhzcjJoYWpnZW5mIiwib3JnYW5pemF0aW9uSWQiOiJjbDNhaHY3M3cxODkxMDg3cWJ3enMzZWRkIiwiYXBpS2V5SWQiOiJjbGV5ZzcwZGQwMTRyMDcyNmVrc2Fhc3FkIiwic2VjcmV0IjoiMjMwY2IzY2RhNmJkNzY1ODA2ZTU0YjRlODAyZGQxZGMiLCJpYXQiOjE2NzgyMDU0NDksImV4cCI6MjMwOTM1NzQ0OX0.rIF5GlEqvMXbrMABU6MDIwqXJuUAyMU_Wr_BK0QpvlQ\"\n",
91+
"API_KEY = \"\"\n",
9292
"client = lb.Client(API_KEY)"
9393
],
9494
"cell_type": "code",
@@ -627,7 +627,7 @@
627627
"True"
628628
]
629629
},
630-
"execution_count": 15,
630+
"execution_count": 68,
631631
"metadata": {},
632632
"output_type": "execute_result"
633633
}
@@ -657,10 +657,10 @@
657657
"name": "stdout",
658658
"output_type": "stream",
659659
"text": [
660-
"{'schemaNodeId': 'cldyrtcxi001707yra30a43ky', 'featureSchemaId': 'cldyrtcxi001607yr5j5b83ps', 'required': False, 'name': 'bbox_video', 'tool': 'rectangle', 'color': '#ff0000', 'archived': 0, 'classifications': []}\n",
661-
"{'schemaNodeId': 'cldyrtcxj001d07yrcpumdrzy', 'featureSchemaId': 'cldyrtcxi001807yrggaaal18', 'required': False, 'name': 'bbox_with_radio_subclass', 'tool': 'rectangle', 'color': '#7fff00', 'archived': 0, 'classifications': [{'schemaNodeId': 'cldyrtcxj001c07yr498u7sjy', 'featureSchemaId': 'cldyrtcxj001907yr3idhdbgi', 'archived': 0, 'required': False, 'instructions': 'sub_radio_question', 'name': 'sub_radio_question', 'type': 'radio', 'options': [{'schemaNodeId': 'cldyrtcxj001b07yr2afe29ej', 'featureSchemaId': 'cldyrtcxj001a07yr3ro1dhpb', 'label': 'first_sub_radio_answer', 'value': 'first_sub_radio_answer'}]}]}\n",
662-
"{'schemaNodeId': 'cldyrtcxj001f07yrh4k3g2sl', 'featureSchemaId': 'cldyrtcxj001e07yrcge9h9b8', 'required': False, 'name': 'point_video', 'tool': 'point', 'color': '#00ffff', 'archived': 0, 'classifications': []}\n",
663-
"{'schemaNodeId': 'cldyrtcxj001h07yrdvca3afo', 'featureSchemaId': 'cldyrtcxj001g07yr8oo9647y', 'required': False, 'name': 'line_video_frame', 'tool': 'line', 'color': '#7f00ff', 'archived': 0, 'classifications': []}\n"
660+
"{'schemaNodeId': 'clfcx0vvw0tdc071019wb0rv9', 'featureSchemaId': 'clfcx0vvw0tdb071075pi09ik', 'required': False, 'name': 'bbox_video', 'tool': 'rectangle', 'color': '#ff0000', 'archived': 0, 'classifications': []}\n",
661+
"{'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",
662+
"{'schemaNodeId': 'clfcx0vvw0tdk07104c5z7hzv', 'featureSchemaId': 'clfcx0vvw0tdj0710aigwf9g8', 'required': False, 'name': 'point_video', 'tool': 'point', 'color': '#00ffff', 'archived': 0, 'classifications': []}\n",
663+
"{'schemaNodeId': 'clfcx0vvx0tdm07106lchd2ui', 'featureSchemaId': 'clfcx0vvx0tdl0710doq7a7oo', 'required': False, 'name': 'line_video_frame', 'tool': 'line', 'color': '#7f00ff', 'archived': 0, 'classifications': []}\n"
664664
]
665665
},
666666
{
@@ -669,19 +669,19 @@
669669
"{'name': 'bbox_with_radio_subclass',\n",
670670
" 'segments': [{'keyframes': [{'frame': 13,\n",
671671
" 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n",
672-
" 'classifications': [{'schemaId': 'cldyrtcxj001907yr3idhdbgi',\n",
673-
" 'answer': {'schemaId': 'cldyrtcxj001a07yr3ro1dhpb'}}]},\n",
672+
" 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n",
673+
" 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n",
674674
" {'frame': 14,\n",
675675
" 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n",
676-
" 'classifications': [{'schemaId': 'cldyrtcxj001907yr3idhdbgi',\n",
677-
" 'answer': {'schemaId': 'cldyrtcxj001a07yr3ro1dhpb'}}]},\n",
676+
" 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n",
677+
" 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n",
678678
" {'frame': 15,\n",
679679
" 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n",
680-
" 'classifications': [{'schemaId': 'cldyrtcxj001907yr3idhdbgi',\n",
681-
" 'answer': {'schemaId': 'cldyrtcxj001a07yr3ro1dhpb'}}]}]}]}"
680+
" 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n",
681+
" 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]}]}]}"
682682
]
683683
},
684-
"execution_count": 16,
684+
"execution_count": 69,
685685
"metadata": {},
686686
"output_type": "execute_result"
687687
}
@@ -737,7 +737,8 @@
737737
"name": "stdout",
738738
"output_type": "stream",
739739
"text": [
740-
"Errors: []\n"
740+
"Errors: []\n",
741+
"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"
741742
]
742743
}
743744
],
@@ -774,7 +775,7 @@
774775
"name": "stderr",
775776
"output_type": "stream",
776777
"text": [
777-
"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"
778+
"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"
778779
]
779780
}
780781
],
@@ -801,10 +802,10 @@
801802
{
802803
"data": {
803804
"text/plain": [
804-
"<Batch ID: ebefc850-a963-11ed-b63a-8b5860515337>"
805+
"<Batch ID: 72f4de90-c4f7-11ed-b615-37d469fdf63f>"
805806
]
806807
},
807-
"execution_count": 20,
808+
"execution_count": 73,
808809
"metadata": {},
809810
"output_type": "execute_result"
810811
}
@@ -1085,7 +1086,40 @@
10851086
"set_feature_schema_id(features_schema, bbox_with_radio_subclass_annotation_ndjson)"
10861087
],
10871088
"cell_type": "code",
1088-
"outputs": [],
1089+
"outputs": [
1090+
{
1091+
"name": "stdout",
1092+
"output_type": "stream",
1093+
"text": [
1094+
"{'schemaNodeId': 'clfcx0vvw0tdc071019wb0rv9', 'featureSchemaId': 'clfcx0vvw0tdb071075pi09ik', 'required': False, 'name': 'bbox_video', 'tool': 'rectangle', 'color': '#ff0000', 'archived': 0, 'classifications': []}\n",
1095+
"{'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",
1096+
"{'schemaNodeId': 'clfcx0vvw0tdk07104c5z7hzv', 'featureSchemaId': 'clfcx0vvw0tdj0710aigwf9g8', 'required': False, 'name': 'point_video', 'tool': 'point', 'color': '#00ffff', 'archived': 0, 'classifications': []}\n",
1097+
"{'schemaNodeId': 'clfcx0vvx0tdm07106lchd2ui', 'featureSchemaId': 'clfcx0vvx0tdl0710doq7a7oo', 'required': False, 'name': 'line_video_frame', 'tool': 'line', 'color': '#7f00ff', 'archived': 0, 'classifications': []}\n"
1098+
]
1099+
},
1100+
{
1101+
"data": {
1102+
"text/plain": [
1103+
"{'name': 'bbox_with_radio_subclass',\n",
1104+
" 'segments': [{'keyframes': [{'frame': 13,\n",
1105+
" 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n",
1106+
" 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n",
1107+
" 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n",
1108+
" {'frame': 14,\n",
1109+
" 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n",
1110+
" 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n",
1111+
" 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]},\n",
1112+
" {'frame': 15,\n",
1113+
" 'bbox': {'top': 146.0, 'left': 98.0, 'height': 382.0, 'width': 341.0},\n",
1114+
" 'classifications': [{'schemaId': 'clfcx0vvw0tde0710dkb40cq8',\n",
1115+
" 'answer': {'schemaId': 'clfcx0vvw0tdf07103ms5eh02'}}]}]}]}"
1116+
]
1117+
},
1118+
"execution_count": 75,
1119+
"metadata": {},
1120+
"output_type": "execute_result"
1121+
}
1122+
],
10891123
"execution_count": null
10901124
},
10911125
{
@@ -1101,7 +1135,7 @@
11011135
" point_annotation_ndjson, \n",
11021136
" polyline_annotation_ndjson,\n",
11031137
" nested_radio_annotation_ndjson,\n",
1104-
" nested_checklist_prediction_ndjson,\n",
1138+
" nested_checklist_annotation_ndjson,\n",
11051139
" bbox_with_radio_subclass_annotation_ndjson\n",
11061140
"]:\n",
11071141
" annot.update({\n",
@@ -1136,21 +1170,12 @@
11361170
],
11371171
"cell_type": "code",
11381172
"outputs": [
1139-
{
1140-
"name": "stderr",
1141-
"output_type": "stream",
1142-
"text": [
1143-
"WARNING:labelbox.schema.annotation_import:\n",
1144-
" Confidence scores are not supported in Label Import.\n",
1145-
" Corresponding confidence score values will be ignored.\n",
1146-
" \n"
1147-
]
1148-
},
11491173
{
11501174
"name": "stdout",
11511175
"output_type": "stream",
11521176
"text": [
1153-
"Errors: []\n"
1177+
"Errors: []\n",
1178+
"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"
11541179
]
11551180
}
11561181
],
@@ -1177,7 +1202,7 @@
11771202
"True"
11781203
]
11791204
},
1180-
"execution_count": 25,
1205+
"execution_count": 78,
11811206
"metadata": {},
11821207
"output_type": "execute_result"
11831208
}

0 commit comments

Comments
 (0)