Skip to content

Commit e9d81b5

Browse files
committed
update to validate changes
1 parent 221f56b commit e9d81b5

File tree

1 file changed

+40
-24
lines changed

1 file changed

+40
-24
lines changed

examples/annotation_import/pdf_mal.ipynb

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
},
5757
{
5858
"cell_type": "code",
59-
"execution_count": 1,
59+
"execution_count": null,
6060
"id": "8d8d554f",
6161
"metadata": {},
6262
"outputs": [],
@@ -103,7 +103,7 @@
103103
},
104104
{
105105
"cell_type": "code",
106-
"execution_count": 56,
106+
"execution_count": 3,
107107
"id": "6ffec272",
108108
"metadata": {},
109109
"outputs": [],
@@ -243,14 +243,14 @@
243243
},
244244
{
245245
"cell_type": "code",
246-
"execution_count": 38,
246+
"execution_count": 7,
247247
"id": "5cbe5b5a",
248248
"metadata": {},
249249
"outputs": [],
250250
"source": [
251251
"box_annotation = ObjectAnnotation(\n",
252252
" name='box', \n",
253-
" extra={'unit': 'POINTS','page': 1}, \n",
253+
" extra={'unit': 'POINTS','page': 0}, #pages are 0-indexed, 0 indicates page 1 \n",
254254
" value=Rectangle(\n",
255255
" extra={}, \n",
256256
" start=Point(x=557,y=898),\n",
@@ -260,7 +260,7 @@
260260
},
261261
{
262262
"cell_type": "code",
263-
"execution_count": 39,
263+
"execution_count": 8,
264264
"id": "4896ea42",
265265
"metadata": {},
266266
"outputs": [],
@@ -302,23 +302,31 @@
302302
},
303303
{
304304
"cell_type": "code",
305-
"execution_count": 51,
305+
"execution_count": 9,
306306
"id": "64ac1f74",
307307
"metadata": {},
308308
"outputs": [
309+
{
310+
"name": "stderr",
311+
"output_type": "stream",
312+
"text": [
313+
"/Users/jonathantso/opt/anaconda3/lib/python3.8/site-packages/labelbox/data/annotation_types/classification/classification.py:85: UserWarning: Dropdown classification is deprecated and will be removed in a future release\n",
314+
" warnings.warn(\"Dropdown classification is deprecated and will be \"\n"
315+
]
316+
},
309317
{
310318
"data": {
311319
"text/plain": [
312320
"{'uid': None,\n",
313321
" 'data': ImageData(im_bytes=None,file_path=None,url=None,arr=None),\n",
314-
" 'annotations': [ObjectAnnotation(name='box', feature_schema_id=None, extra={'unit': 'POINTS', 'page': 1}, value=Rectangle(extra={}, start=Point(extra={}, x=557.0, y=898.0), end=Point(extra={}, x=852.0, y=1140.0)), classifications=[]),\n",
322+
" 'annotations': [ObjectAnnotation(name='box', feature_schema_id=None, extra={'unit': 'POINTS', 'page': 0}, value=Rectangle(extra={}, start=Point(extra={}, x=557.0, y=898.0), end=Point(extra={}, x=852.0, y=1140.0)), classifications=[]),\n",
315323
" ClassificationAnnotation(name='text', feature_schema_id=None, extra={}, value=Text(answer='the answer to the text question')),\n",
316324
" ClassificationAnnotation(name='checklist', feature_schema_id=None, extra={}, value=Checklist(name='checklist', answer=[ClassificationAnswer(name='first_checklist_answer', feature_schema_id=None, extra={}, keyframe=None), ClassificationAnswer(name='second_checklist_answer', feature_schema_id=None, extra={}, keyframe=None)])),\n",
317325
" ClassificationAnnotation(name='radio', feature_schema_id=None, extra={}, value=Radio(answer=ClassificationAnswer(name='second_radio_answer', feature_schema_id=None, extra={}, keyframe=None)))],\n",
318326
" 'extra': {}}"
319327
]
320328
},
321-
"execution_count": 51,
329+
"execution_count": 9,
322330
"metadata": {},
323331
"output_type": "execute_result"
324332
}
@@ -361,38 +369,38 @@
361369
},
362370
{
363371
"cell_type": "code",
364-
"execution_count": 52,
372+
"execution_count": 10,
365373
"id": "8794d8aa",
366374
"metadata": {
367-
"scrolled": true
375+
"scrolled": false
368376
},
369377
"outputs": [
370378
{
371379
"data": {
372380
"text/plain": [
373-
"[{'uuid': 'fd4475d6-8ece-44d0-ba55-feeac4cfa9e8',\n",
374-
" 'dataRow': {'id': 'cl76eelhd0fm3071n9ropffkr'},\n",
381+
"[{'uuid': '4a1ca900-85d7-4643-883e-277170000f9c',\n",
382+
" 'dataRow': {'id': 'cl7hrmmi90m5c0y6h5nk00u02'},\n",
375383
" 'name': 'box',\n",
376-
" 'classifications': [],\n",
377-
" 'page': 1,\n",
384+
" 'page': 0,\n",
378385
" 'unit': 'POINTS',\n",
386+
" 'classifications': [],\n",
379387
" 'bbox': {'top': 898.0, 'left': 557.0, 'height': 242.0, 'width': 295.0}},\n",
380388
" {'name': 'text',\n",
381389
" 'answer': 'the answer to the text question',\n",
382-
" 'uuid': 'fc1913c6-b735-4dea-bd25-c18152a4715f',\n",
383-
" 'dataRow': {'id': 'cl76eelhd0fm3071n9ropffkr'}},\n",
390+
" 'uuid': '35588dd3-9050-4471-ac13-a8ed6ac1fd4a',\n",
391+
" 'dataRow': {'id': 'cl7hrmmi90m5c0y6h5nk00u02'}},\n",
384392
" {'name': 'checklist',\n",
385-
" 'uuid': '9d7b2e57-d68f-4388-867a-af2a9b233719',\n",
386-
" 'dataRow': {'id': 'cl76eelhd0fm3071n9ropffkr'},\n",
393+
" 'uuid': '38bc716c-d199-4e6e-bd31-0d2128716444',\n",
394+
" 'dataRow': {'id': 'cl7hrmmi90m5c0y6h5nk00u02'},\n",
387395
" 'answer': [{'name': 'first_checklist_answer'},\n",
388396
" {'name': 'second_checklist_answer'}]},\n",
389397
" {'name': 'radio',\n",
390398
" 'answer': {'name': 'second_radio_answer'},\n",
391-
" 'uuid': 'ad60897f-ea1a-47de-b923-459339764921',\n",
392-
" 'dataRow': {'id': 'cl76eelhd0fm3071n9ropffkr'}}]"
399+
" 'uuid': '8a21a248-9669-4465-b0c0-5a8d75903c8f',\n",
400+
" 'dataRow': {'id': 'cl7hrmmi90m5c0y6h5nk00u02'}}]"
393401
]
394402
},
395-
"execution_count": 52,
403+
"execution_count": 10,
396404
"metadata": {},
397405
"output_type": "execute_result"
398406
}
@@ -405,7 +413,7 @@
405413
},
406414
{
407415
"cell_type": "code",
408-
"execution_count": 53,
416+
"execution_count": 11,
409417
"id": "787524ac",
410418
"metadata": {},
411419
"outputs": [],
@@ -420,10 +428,18 @@
420428
},
421429
{
422430
"cell_type": "code",
423-
"execution_count": 57,
431+
"execution_count": 13,
424432
"id": "eb5116f9",
425433
"metadata": {},
426-
"outputs": [],
434+
"outputs": [
435+
{
436+
"name": "stdout",
437+
"output_type": "stream",
438+
"text": [
439+
"Errors: []\n"
440+
]
441+
}
442+
],
427443
"source": [
428444
"# Errors will appear for each annotation that failed.\n",
429445
"# Empty list means that there were no errors\n",

0 commit comments

Comments
 (0)