Skip to content

Commit cf268d3

Browse files
ovalle15ovalle15
authored andcommitted
Replace data row id with global keys
1 parent d255c56 commit cf268d3

File tree

1 file changed

+47
-31
lines changed

1 file changed

+47
-31
lines changed

examples/prediction_upload/video_predictions.ipynb

Lines changed: 47 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -57,27 +57,16 @@
5757
},
5858
{
5959
"cell_type": "code",
60-
"execution_count": null,
60+
"execution_count": 1,
6161
"metadata": {},
62-
"outputs": [
63-
{
64-
"name": "stdout",
65-
"output_type": "stream",
66-
"text": [
67-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m187.7/187.7 KB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
68-
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.8/7.8 MB\u001b[0m \u001b[31m21.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
69-
"\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
70-
" Building wheel for pygeotile (setup.py) ... \u001b[?25l\u001b[?25hdone\n"
71-
]
72-
}
73-
],
62+
"outputs": [],
7463
"source": [
7564
"!pip install -q 'labelbox[data]'"
7665
]
7766
},
7867
{
7968
"cell_type": "code",
80-
"execution_count": null,
69+
"execution_count": 2,
8170
"metadata": {},
8271
"outputs": [],
8372
"source": [
@@ -95,17 +84,17 @@
9584
},
9685
{
9786
"cell_type": "code",
98-
"execution_count": null,
87+
"execution_count": 3,
9988
"metadata": {},
10089
"outputs": [],
10190
"source": [
102-
"API_KEY = \"\"\n",
91+
"API_KEY = \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJjbDNhaXV4MTAwMGt4MDhzcjJoYWpnZW5mIiwib3JnYW5pemF0aW9uSWQiOiJjbDNhaHY3M3cxODkxMDg3cWJ3enMzZWRkIiwiYXBpS2V5SWQiOiJjbGV5ZzcwZGQwMTRyMDcyNmVrc2Fhc3FkIiwic2VjcmV0IjoiMjMwY2IzY2RhNmJkNzY1ODA2ZTU0YjRlODAyZGQxZGMiLCJpYXQiOjE2NzgyMDU0NDksImV4cCI6MjMwOTM1NzQ0OX0.rIF5GlEqvMXbrMABU6MDIwqXJuUAyMU_Wr_BK0QpvlQ\"\n",
10392
"client = lb.Client(API_KEY)"
10493
]
10594
},
10695
{
10796
"cell_type": "code",
108-
"execution_count": null,
97+
"execution_count": 4,
10998
"metadata": {},
11099
"outputs": [],
111100
"source": [
@@ -148,7 +137,7 @@
148137
},
149138
{
150139
"cell_type": "code",
151-
"execution_count": null,
140+
"execution_count": 6,
152141
"metadata": {},
153142
"outputs": [],
154143
"source": [
@@ -164,7 +153,7 @@
164153
},
165154
{
166155
"cell_type": "code",
167-
"execution_count": null,
156+
"execution_count": 7,
168157
"metadata": {},
169158
"outputs": [],
170159
"source": [
@@ -205,7 +194,7 @@
205194
},
206195
{
207196
"cell_type": "code",
208-
"execution_count": null,
197+
"execution_count": 8,
209198
"metadata": {},
210199
"outputs": [],
211200
"source": [
@@ -223,7 +212,7 @@
223212
},
224213
{
225214
"cell_type": "code",
226-
"execution_count": null,
215+
"execution_count": 9,
227216
"metadata": {},
228217
"outputs": [],
229218
"source": [
@@ -287,7 +276,7 @@
287276
},
288277
{
289278
"cell_type": "code",
290-
"execution_count": null,
279+
"execution_count": 10,
291280
"metadata": {},
292281
"outputs": [],
293282
"source": [
@@ -377,7 +366,7 @@
377366
},
378367
{
379368
"cell_type": "code",
380-
"execution_count": null,
369+
"execution_count": 11,
381370
"metadata": {},
382371
"outputs": [],
383372
"source": [
@@ -467,9 +456,25 @@
467456
},
468457
{
469458
"cell_type": "code",
470-
"execution_count": null,
459+
"execution_count": 12,
471460
"metadata": {},
472-
"outputs": [],
461+
"outputs": [
462+
{
463+
"name": "stderr",
464+
"output_type": "stream",
465+
"text": [
466+
"There are errors present. Please look at `task.errors` for more details\n"
467+
]
468+
},
469+
{
470+
"name": "stdout",
471+
"output_type": "stream",
472+
"text": [
473+
"Errors: Duplicate global keys found: sample-video-2.mp4\n",
474+
"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"
475+
]
476+
}
477+
],
473478
"source": [
474479
"# send a sample image as batch to the project\n",
475480
"global_key = \"sample-video-2.mp4\"\n",
@@ -494,7 +499,7 @@
494499
},
495500
{
496501
"cell_type": "code",
497-
"execution_count": null,
502+
"execution_count": 14,
498503
"metadata": {},
499504
"outputs": [],
500505
"source": [
@@ -569,10 +574,7 @@
569574
" name=\"point_video\"), \n",
570575
" lb.Tool( # Polyline tool given the name \"line\"\n",
571576
" tool=lb.Tool.Type.LINE,\n",
572-
" name=\"line_video_frame\"),\n",
573-
" lb.Tool( # Relationship tool given the name \"relationship\"\n",
574-
" tool=lb.Tool.Type.RELATIONSHIP,\n",
575-
" name=\"relationship_video\")]\n",
577+
" name=\"line_video_frame\")]\n",
576578
")\n",
577579
"\n",
578580
"ontology = client.create_ontology(\"Video Prediction Import Demo\", ontology_builder.asdict(), media_type=lb.MediaType.Video)\n",
@@ -1197,8 +1199,22 @@
11971199
}
11981200
],
11991201
"metadata": {
1202+
"kernelspec": {
1203+
"display_name": "Python 3",
1204+
"language": "python",
1205+
"name": "python3"
1206+
},
12001207
"language_info": {
1201-
"name": "python"
1208+
"codemirror_mode": {
1209+
"name": "ipython",
1210+
"version": 3
1211+
},
1212+
"file_extension": ".py",
1213+
"mimetype": "text/x-python",
1214+
"name": "python",
1215+
"nbconvert_exporter": "python",
1216+
"pygments_lexer": "ipython3",
1217+
"version": "3.10.7"
12021218
}
12031219
},
12041220
"nbformat": 4,

0 commit comments

Comments
 (0)