|
140 | 140 | "id": "preliminary-benchmark", |
141 | 141 | "outputId": "8cf16a44-d0b8-477f-b361-43865b2fc572" |
142 | 142 | }, |
143 | | - |
144 | | - "outputs": [ |
| 143 | + "outputs": [ |
145 | 144 | { |
146 | 145 | "name": "stderr", |
147 | 146 | "output_type": "stream", |
|
295 | 294 | "We will create a Label called mal_label which has the same original structure as the label above\n", |
296 | 295 | "\n", |
297 | 296 | "Notes:\n", |
298 | | - "* Each label requires a valid feature schema id. We will assign it using our built in `assign_feature_schema_ids` method\n", |
| 297 | + "* Each label requires a valid feature schema id or name\n", |
299 | 298 | "* the NDJsonConverter takes in a list of labels" |
300 | 299 | ] |
301 | 300 | }, |
|
307 | 306 | "id": "10b19393-920a-45c8-9660-42d8c449b9c2", |
308 | 307 | "outputId": "a93a39de-c8ed-402c-b834-304b1ba8854a" |
309 | 308 | }, |
310 | | - "outputs": [ |
311 | | - { |
312 | | - "data": { |
313 | | - "text/plain": [ |
314 | | - "[{'uuid': 'fde1945b-01df-43c2-807a-3f5fa20450f4',\n", |
315 | | - " 'dataRow': {'id': 'ckzocppkf96r10z9q205151c3'},\n", |
316 | | - " 'schemaId': 'ckzocpq4l9bw20z9s9bc70h29',\n", |
317 | | - " 'classifications': [],\n", |
318 | | - " 'bbox': {'top': 30.0, 'left': 30.0, 'height': 170.0, 'width': 170.0}}]" |
319 | | - ] |
320 | | - }, |
321 | | - "execution_count": 6, |
322 | | - "metadata": {}, |
323 | | - "output_type": "execute_result" |
324 | | - } |
325 | | - ], |
| 309 | + "outputs": [], |
326 | 310 | "source": [ |
327 | 311 | "mal_label = Label(\n", |
328 | 312 | " data=image_data,\n", |
329 | 313 | " annotations = [rectangle_annotation]\n", |
330 | 314 | ")\n", |
331 | 315 | "\n", |
332 | | - "mal_label.assign_feature_schema_ids(ontology_builder.from_project(mal_project))\n", |
333 | | - "\n", |
334 | 316 | "ndjson_labels = list(NDJsonConverter.serialize([mal_label]))\n", |
335 | 317 | "\n", |
336 | 318 | "ndjson_labels" |
|
400 | 382 | "id": "41d103bc-a5fd-4f0b-95f0-7e9bc59fbd07" |
401 | 383 | }, |
402 | 384 | "source": [ |
403 | | - "Label import is very similar to model-assisted labeling. We will need to re-assign the feature schema before continuing, \n", |
404 | | - "but we can continue to use our NDJSonConverter\n", |
405 | | - "\n", |
406 | | - "We will create a Label called li_label which has the same original structure as the label above" |
| 385 | + "Label import is very similar to model-assisted labeling. We will create a Label called li_label which has the same original structure as the label above" |
407 | 386 | ] |
408 | 387 | }, |
409 | 388 | { |
|
414 | 393 | "id": "c95716d5-a1ee-46fe-8dca-313ce10f104f", |
415 | 394 | "outputId": "0e83d5d0-1f51-4903-c777-f9c331781656" |
416 | 395 | }, |
417 | | - "outputs": [ |
418 | | - { |
419 | | - "data": { |
420 | | - "text/plain": [ |
421 | | - "[{'uuid': '7be8bb0b-39a2-44a5-96ab-5def3752811b',\n", |
422 | | - " 'dataRow': {'id': 'ckzocppkf96r10z9q205151c3'},\n", |
423 | | - " 'schemaId': 'ckzocpqv80ukp0z9l67cc6liv',\n", |
424 | | - " 'classifications': [],\n", |
425 | | - " 'bbox': {'top': 30.0, 'left': 30.0, 'height': 170.0, 'width': 170.0}}]" |
426 | | - ] |
427 | | - }, |
428 | | - "execution_count": 9, |
429 | | - "metadata": {}, |
430 | | - "output_type": "execute_result" |
431 | | - } |
432 | | - ], |
| 396 | + "outputs": [], |
433 | 397 | "source": [ |
434 | 398 | "li_label = Label(\n", |
435 | 399 | " data=image_data,\n", |
436 | 400 | " annotations = [rectangle_annotation]\n", |
437 | 401 | ")\n", |
438 | 402 | "\n", |
439 | | - "li_label.assign_feature_schema_ids(ontology_builder.from_project(li_project))\n", |
440 | | - "\n", |
441 | 403 | "ndjson_labels = list(NDJsonConverter.serialize([li_label]))\n", |
442 | 404 | "\n", |
443 | 405 | "ndjson_labels" |
|
489 | 451 | } |
490 | 452 | ], |
491 | 453 | "metadata": { |
| 454 | + "colab": { |
| 455 | + "collapsed_sections": [], |
| 456 | + "name": "mal_basics.ipynb", |
| 457 | + "provenance": [] |
| 458 | + }, |
492 | 459 | "kernelspec": { |
493 | | - "display_name": "Python 3", |
| 460 | + "display_name": "Python 3.9.2 64-bit", |
494 | 461 | "language": "python", |
495 | 462 | "name": "python3" |
496 | 463 | }, |
|
504 | 471 | "name": "python", |
505 | 472 | "nbconvert_exporter": "python", |
506 | 473 | "pygments_lexer": "ipython3", |
507 | | - "version": "3.8.8" |
| 474 | + "version": "3.9.2" |
508 | 475 | }, |
509 | | - "colab": { |
510 | | - "name": "mal_basics.ipynb", |
511 | | - "provenance": [], |
512 | | - "collapsed_sections": [] |
| 476 | + "vscode": { |
| 477 | + "interpreter": { |
| 478 | + "hash": "7812ea015bdcee6f23a998adcdd2ef97c151c0c241b7b7070987d9313e41299d" |
| 479 | + } |
513 | 480 | } |
514 | 481 | }, |
515 | 482 | "nbformat": 4, |
|
0 commit comments