|
87 | 87 | "!pip install -q 'labelbox[data]'" |
88 | 88 | ], |
89 | 89 | "metadata": { |
90 | | - "id": "cm8xMaLbGb7v" |
| 90 | + "id": "cm8xMaLbGb7v", |
| 91 | + "colab": { |
| 92 | + "base_uri": "https://localhost:8080/" |
| 93 | + }, |
| 94 | + "outputId": "65ba50e8-4a5d-45c5-90b7-7f8c2c168c62" |
91 | 95 | }, |
92 | | - "execution_count": 49, |
93 | | - "outputs": [] |
| 96 | + "execution_count": 1, |
| 97 | + "outputs": [ |
| 98 | + { |
| 99 | + "output_type": "stream", |
| 100 | + "name": "stdout", |
| 101 | + "text": [ |
| 102 | + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m185.5/185.5 KB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", |
| 103 | + "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.8/7.8 MB\u001b[0m \u001b[31m17.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", |
| 104 | + "\u001b[?25h Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n", |
| 105 | + " Building wheel for pygeotile (setup.py) ... \u001b[?25l\u001b[?25hdone\n" |
| 106 | + ] |
| 107 | + } |
| 108 | + ] |
94 | 109 | }, |
95 | 110 | { |
96 | 111 | "cell_type": "code", |
|
112 | 127 | "metadata": { |
113 | 128 | "id": "NIq-6M9kHKSs" |
114 | 129 | }, |
115 | | - "execution_count": 50, |
| 130 | + "execution_count": 2, |
116 | 131 | "outputs": [] |
117 | 132 | }, |
118 | 133 | { |
|
128 | 143 | { |
129 | 144 | "cell_type": "code", |
130 | 145 | "source": [ |
131 | | - "API_KEY = None\n", |
| 146 | + "API_KEY = None\n", |
132 | 147 | "client = Client(API_KEY)" |
133 | 148 | ], |
134 | 149 | "metadata": { |
135 | 150 | "id": "z7ZLKLYLHP__" |
136 | 151 | }, |
137 | | - "execution_count": 51, |
| 152 | + "execution_count": 3, |
138 | 153 | "outputs": [] |
139 | 154 | }, |
140 | 155 | { |
|
165 | 180 | "metadata": { |
166 | 181 | "id": "FJhCAqeR-cUJ" |
167 | 182 | }, |
168 | | - "execution_count": 52, |
| 183 | + "execution_count": 4, |
169 | 184 | "outputs": [] |
170 | 185 | }, |
171 | 186 | { |
|
216 | 231 | "metadata": { |
217 | 232 | "id": "D_luKHzuY-b3" |
218 | 233 | }, |
219 | | - "execution_count": 53, |
| 234 | + "execution_count": 5, |
220 | 235 | "outputs": [] |
221 | 236 | }, |
222 | 237 | { |
|
257 | 272 | "metadata": { |
258 | 273 | "id": "rjHUJUbGZXgY" |
259 | 274 | }, |
260 | | - "execution_count": 54, |
| 275 | + "execution_count": 6, |
261 | 276 | "outputs": [] |
262 | 277 | }, |
263 | 278 | { |
|
280 | 295 | "metadata": { |
281 | 296 | "id": "dMpF0LfZZZpg" |
282 | 297 | }, |
283 | | - "execution_count": 55, |
| 298 | + "execution_count": 7, |
284 | 299 | "outputs": [] |
285 | 300 | }, |
286 | 301 | { |
|
309 | 324 | "colab": { |
310 | 325 | "base_uri": "https://localhost:8080/" |
311 | 326 | }, |
312 | | - "outputId": "537e3d11-3809-46fd-af14-4821ae7b89b0" |
| 327 | + "outputId": "e7c7dd14-293e-42e7-d93e-faebdbbab036" |
313 | 328 | }, |
314 | | - "execution_count": 56, |
| 329 | + "execution_count": 8, |
315 | 330 | "outputs": [ |
316 | 331 | { |
317 | 332 | "output_type": "stream", |
318 | 333 | "name": "stdout", |
319 | 334 | "text": [ |
320 | 335 | "<DataRow {\n", |
321 | | - " \"created_at\": \"2023-01-24 20:57:13+00:00\",\n", |
| 336 | + " \"created_at\": \"2023-01-24 22:36:16+00:00\",\n", |
322 | 337 | " \"external_id\": null,\n", |
323 | | - " \"global_key\": \"eb359c83-89e5-42e3-8fc5-dd2a5f22fb1e\",\n", |
| 338 | + " \"global_key\": \"c23d513c-57f1-48ad-a233-53ff99a795c4\",\n", |
324 | 339 | " \"media_attributes\": {},\n", |
325 | 340 | " \"metadata\": [],\n", |
326 | 341 | " \"metadata_fields\": [],\n", |
327 | 342 | " \"row_data\": \"https://storage.googleapis.com/labelbox-datasets/html_sample_data/sample_html_2.html\",\n", |
328 | | - " \"uid\": \"cldapxjfn0gns07xkfn9p4ct8\",\n", |
329 | | - " \"updated_at\": \"2023-01-24 20:57:13+00:00\"\n", |
| 343 | + " \"uid\": \"cldatgxbz33qk07y0cknjgnsf\",\n", |
| 344 | + " \"updated_at\": \"2023-01-24 22:36:16+00:00\"\n", |
330 | 345 | "}>\n" |
331 | 346 | ] |
332 | 347 | } |
|
407 | 422 | "metadata": { |
408 | 423 | "id": "Kt4XWWqgIiWk" |
409 | 424 | }, |
410 | | - "execution_count": 57, |
| 425 | + "execution_count": 9, |
411 | 426 | "outputs": [] |
412 | 427 | }, |
413 | 428 | { |
|
431 | 446 | "metadata": { |
432 | 447 | "id": "8n-AvzdiOR6d" |
433 | 448 | }, |
434 | | - "execution_count": 59, |
| 449 | + "execution_count": 10, |
435 | 450 | "outputs": [] |
436 | 451 | }, |
437 | 452 | { |
|
453 | 468 | "colab": { |
454 | 469 | "base_uri": "https://localhost:8080/" |
455 | 470 | }, |
456 | | - "outputId": "ebb721f4-b795-4511-bdd6-aac4f92a4e71" |
| 471 | + "outputId": "630f3187-5377-4607-af50-5c8250fd431a" |
457 | 472 | }, |
458 | | - "execution_count": 60, |
| 473 | + "execution_count": 11, |
459 | 474 | "outputs": [ |
460 | 475 | { |
461 | 476 | "output_type": "execute_result", |
|
465 | 480 | ] |
466 | 481 | }, |
467 | 482 | "metadata": {}, |
468 | | - "execution_count": 60 |
| 483 | + "execution_count": 11 |
469 | 484 | } |
470 | 485 | ] |
471 | 486 | }, |
|
474 | 489 | "source": [ |
475 | 490 | "## Step 5. Create the predictions payload\n", |
476 | 491 | "\n", |
477 | | - "Create the annotations payload using the snippets of [code here](https://https://docs.labelbox.com/reference/import-image-annotations#supported-annotations).\n", |
| 492 | + "Create the annotations payload using the snippets of code in the **Supported Predictions** section.\n", |
478 | 493 | "\n", |
479 | 494 | "Labelbox support two formats for the annotations payload: NDJSON and Python Annotation types. Both are described below to compose your annotations into Labels attached to the data rows.\n", |
480 | 495 | "\n", |
|
507 | 522 | "metadata": { |
508 | 523 | "id": "zv2OLTXKSGWv" |
509 | 524 | }, |
510 | | - "execution_count": 61, |
| 525 | + "execution_count": 12, |
511 | 526 | "outputs": [] |
512 | 527 | }, |
513 | 528 | { |
|
540 | 555 | "metadata": { |
541 | 556 | "id": "F-Y7sSyAV3tn" |
542 | 557 | }, |
543 | | - "execution_count": 62, |
| 558 | + "execution_count": 13, |
544 | 559 | "outputs": [] |
545 | 560 | }, |
546 | 561 | { |
|
568 | 583 | "colab": { |
569 | 584 | "base_uri": "https://localhost:8080/" |
570 | 585 | }, |
571 | | - "outputId": "81984276-a391-4e34-f9cd-3974792ec2bb" |
| 586 | + "outputId": "6b6841ae-cca5-4813-d1ac-1e964ae6c104" |
572 | 587 | }, |
573 | | - "execution_count": 63, |
| 588 | + "execution_count": 14, |
574 | 589 | "outputs": [ |
575 | 590 | { |
576 | 591 | "output_type": "stream", |
|
615 | 630 | "metadata": { |
616 | 631 | "id": "jEtoDiDrPFvI" |
617 | 632 | }, |
618 | | - "execution_count": 64, |
| 633 | + "execution_count": 15, |
619 | 634 | "outputs": [] |
620 | 635 | }, |
621 | 636 | { |
|
641 | 656 | "colab": { |
642 | 657 | "base_uri": "https://localhost:8080/" |
643 | 658 | }, |
644 | | - "outputId": "dad5bd19-32ce-45e1-cfd5-b925e37037f2" |
| 659 | + "outputId": "ff468996-5876-4001-99e8-73b597bf5083" |
645 | 660 | }, |
646 | | - "execution_count": 65, |
| 661 | + "execution_count": 16, |
647 | 662 | "outputs": [ |
648 | 663 | { |
649 | 664 | "output_type": "execute_result", |
650 | 665 | "data": { |
651 | 666 | "text/plain": [ |
652 | | - "<Batch ID: d22f70b0-9c29-11ed-9ce8-292230ae59f9>" |
| 667 | + "<Batch ID: 8e97f0d0-9c37-11ed-8a1b-5b30e16bddf7>" |
653 | 668 | ] |
654 | 669 | }, |
655 | 670 | "metadata": {}, |
656 | | - "execution_count": 65 |
| 671 | + "execution_count": 16 |
657 | 672 | } |
658 | 673 | ] |
659 | 674 | }, |
|
672 | 687 | "###### Annotations ###### \n", |
673 | 688 | "\n", |
674 | 689 | "\n", |
675 | | - "radio_prediction_ndjson = {\n", |
| 690 | + "radio_annotation_ndjson = {\n", |
676 | 691 | " 'name': 'radio_question',\n", |
677 | 692 | " 'answer': {'name': 'first_radio_answer'}\n", |
678 | 693 | "}\n", |
679 | 694 | "\n", |
680 | 695 | "\n", |
681 | | - "nested_radio_prediction_ndjson = {\n", |
| 696 | + "nested_radio_annotation_ndjson = {\n", |
682 | 697 | " 'name': 'radio_question_sub',\n", |
683 | 698 | " 'answer': {\n", |
684 | 699 | " 'name': 'first_radio_answer',\n", |
|
690 | 705 | "}\n", |
691 | 706 | "\n", |
692 | 707 | "\n", |
693 | | - "nested_checklist_prediction_ndjson = {\n", |
| 708 | + "nested_checklist_annotation_ndjson = {\n", |
694 | 709 | " \"name\": \"nested_checklist_question\",\n", |
695 | 710 | " \"answer\": [{\n", |
696 | 711 | " \"name\": \"first_checklist_answer\", \n", |
|
703 | 718 | " }]\n", |
704 | 719 | "}\n", |
705 | 720 | "\n", |
706 | | - "checklist_prediction_ndjson = {\n", |
| 721 | + "checklist_annotation_ndjson = {\n", |
707 | 722 | " 'name': 'checklist_question',\n", |
708 | 723 | " 'answer': [\n", |
709 | 724 | " {'name': 'first_checklist_answer', }\n", |
710 | 725 | " ]\n", |
711 | 726 | "}\n", |
712 | 727 | "\n", |
713 | 728 | "\n", |
714 | | - "text_prediction_ndjson = {\n", |
| 729 | + "text_annotation_ndjson = {\n", |
715 | 730 | " 'name': 'free_text',\n", |
716 | 731 | " 'answer': 'sample text'\n", |
717 | 732 | "}\n" |
718 | 733 | ], |
719 | 734 | "metadata": { |
720 | 735 | "id": "A8_HVvu9Uvfl" |
721 | 736 | }, |
722 | | - "execution_count": 66, |
| 737 | + "execution_count": 17, |
723 | 738 | "outputs": [] |
724 | 739 | }, |
725 | 740 | { |
|
736 | 751 | "source": [ |
737 | 752 | "ndjson_annotation = []\n", |
738 | 753 | "for annot in [\n", |
739 | | - " radio_prediction_ndjson,\n", |
740 | | - " nested_radio_prediction_ndjson,\n", |
741 | | - " nested_checklist_prediction_ndjson ,\n", |
742 | | - " checklist_prediction_ndjson,\n", |
743 | | - " text_prediction_ndjson\n", |
| 754 | + " radio_annotation_ndjson,\n", |
| 755 | + " nested_radio_annotation_ndjson,\n", |
| 756 | + " nested_checklist_annotation_ndjson ,\n", |
| 757 | + " checklist_annotation_ndjson,\n", |
| 758 | + " text_annotation_ndjson\n", |
744 | 759 | " ]:\n", |
745 | 760 | " annot.update({\n", |
746 | 761 | " 'uuid': str(uuid.uuid4()),\n", |
|
751 | 766 | "metadata": { |
752 | 767 | "id": "9gD_alThQA3G" |
753 | 768 | }, |
754 | | - "execution_count": 67, |
| 769 | + "execution_count": 18, |
755 | 770 | "outputs": [] |
756 | 771 | }, |
757 | 772 | { |
|
781 | 796 | "colab": { |
782 | 797 | "base_uri": "https://localhost:8080/" |
783 | 798 | }, |
784 | | - "outputId": "495b5db6-14b4-4901-8000-7d831d85968c" |
| 799 | + "outputId": "ef8c5932-35df-4feb-9879-81fd89c5897b" |
785 | 800 | }, |
786 | | - "execution_count": 68, |
| 801 | + "execution_count": 19, |
787 | 802 | "outputs": [ |
788 | 803 | { |
789 | 804 | "output_type": "stream", |
|
815 | 830 | "colab": { |
816 | 831 | "base_uri": "https://localhost:8080/" |
817 | 832 | }, |
818 | | - "outputId": "f3272425-c1de-4dff-d2fe-d8c238d084bb" |
| 833 | + "outputId": "9234850e-fc29-427e-e75e-d16237b3ef08" |
819 | 834 | }, |
820 | | - "execution_count": 69, |
| 835 | + "execution_count": 20, |
821 | 836 | "outputs": [ |
822 | 837 | { |
823 | 838 | "output_type": "execute_result", |
|
827 | 842 | ] |
828 | 843 | }, |
829 | 844 | "metadata": {}, |
830 | | - "execution_count": 69 |
| 845 | + "execution_count": 20 |
831 | 846 | } |
832 | 847 | ] |
833 | 848 | }, |
|
849 | 864 | "metadata": { |
850 | 865 | "id": "aAhkyvJlWK1p" |
851 | 866 | }, |
852 | | - "execution_count": null, |
| 867 | + "execution_count": 21, |
853 | 868 | "outputs": [] |
854 | 869 | } |
855 | 870 | ] |
|
0 commit comments