|
16 | 16 | "metadata": {}, |
17 | 17 | "source": [ |
18 | 18 | "<td>\n", |
19 | | - "<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/master/examples/annotation_import/audio.ipynb\" target=\"_blank\"><img\n", |
| 19 | + "<a href=\"https://colab.research.google.com/github/Labelbox/labelbox-python/blob/develop/examples/annotation_import/audio.ipynb\" target=\"_blank\"><img\n", |
20 | 20 | "src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"></a>\n", |
21 | 21 | "</td>\n", |
22 | 22 | "\n", |
23 | 23 | "<td>\n", |
24 | | - "<a href=\"https://github.com/Labelbox/labelbox-python/tree/master/examples/annotation_import/audio.ipynb\" target=\"_blank\"><img\n", |
| 24 | + "<a href=\"https://github.com/Labelbox/labelbox-python/tree/develop/examples/annotation_import/audio.ipynb\" target=\"_blank\"><img\n", |
25 | 25 | "src=\"https://img.shields.io/badge/GitHub-100000?logo=github&logoColor=white\" alt=\"GitHub\"></a>\n", |
26 | 26 | "</td>" |
27 | 27 | ], |
|
80 | 80 | "cell_type": "code", |
81 | 81 | "outputs": [ |
82 | 82 | { |
83 | | - "name": "stdout", |
84 | 83 | "output_type": "stream", |
| 84 | + "name": "stdout", |
85 | 85 | "text": [ |
86 | 86 | "\n", |
87 | 87 | "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip available: \u001b[0m\u001b[31;49m22.3.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.0.1\u001b[0m\n", |
|
157 | 157 | { |
158 | 158 | "metadata": {}, |
159 | 159 | "source": [ |
160 | | - "##### Checklist Classification ####### \n", |
| 160 | + "##### Checklist Classification #######\n", |
161 | 161 | "\n", |
162 | 162 | "checklist_annotation= lb_types.ClassificationAnnotation(\n", |
163 | 163 | " name=\"checklist_audio\",\n", |
164 | 164 | " value=lb_types.Checklist(\n", |
165 | 165 | " answer = [\n", |
166 | 166 | " lb_types.ClassificationAnswer(\n", |
167 | 167 | " name = \"first_checklist_answer\"\n", |
168 | | - " ), \n", |
| 168 | + " ),\n", |
169 | 169 | " lb_types.ClassificationAnswer(\n", |
170 | 170 | " name = \"second_checklist_answer\"\n", |
171 | 171 | " )\n", |
|
242 | 242 | "cell_type": "code", |
243 | 243 | "outputs": [ |
244 | 244 | { |
245 | | - "name": "stdout", |
246 | 245 | "output_type": "stream", |
| 246 | + "name": "stdout", |
247 | 247 | "text": [ |
248 | 248 | "Errors: None\n", |
249 | 249 | "Failed data rows: None\n" |
|
267 | 267 | "metadata": {}, |
268 | 268 | "source": [ |
269 | 269 | "ontology_builder = lb.OntologyBuilder(\n", |
270 | | - " classifications=[ \n", |
271 | | - " lb.Classification( \n", |
| 270 | + " classifications=[\n", |
| 271 | + " lb.Classification(\n", |
272 | 272 | " class_type=lb.Classification.Type.TEXT,\n", |
273 | | - " name=\"text_audio\"), \n", |
274 | | - " lb.Classification( \n", |
275 | | - " class_type=lb.Classification.Type.CHECKLIST, \n", |
276 | | - " name=\"checklist_audio\", \n", |
| 273 | + " name=\"text_audio\"),\n", |
| 274 | + " lb.Classification(\n", |
| 275 | + " class_type=lb.Classification.Type.CHECKLIST,\n", |
| 276 | + " name=\"checklist_audio\",\n", |
277 | 277 | " options=[\n", |
278 | 278 | " lb.Option(value=\"first_checklist_answer\"),\n", |
279 | | - " lb.Option(value=\"second_checklist_answer\") \n", |
| 279 | + " lb.Option(value=\"second_checklist_answer\")\n", |
280 | 280 | " ]\n", |
281 | | - " ), \n", |
282 | | - " lb.Classification( \n", |
283 | | - " class_type=lb.Classification.Type.RADIO, \n", |
284 | | - " name=\"radio_audio\", \n", |
| 281 | + " ),\n", |
| 282 | + " lb.Classification(\n", |
| 283 | + " class_type=lb.Classification.Type.RADIO,\n", |
| 284 | + " name=\"radio_audio\",\n", |
285 | 285 | " options=[\n", |
286 | 286 | " lb.Option(value=\"first_radio_answer\"),\n", |
287 | 287 | " lb.Option(value=\"second_radio_answer\")\n", |
|
309 | 309 | "metadata": {}, |
310 | 310 | "source": [ |
311 | 311 | "# Create Labelbox project\n", |
312 | | - "project = client.create_project(name=\"audio_project\", \n", |
| 312 | + "project = client.create_project(name=\"audio_project\",\n", |
313 | 313 | " media_type=lb.MediaType.Audio)\n", |
314 | 314 | "\n", |
315 | | - "# Setup your ontology \n", |
| 315 | + "# Setup your ontology\n", |
316 | 316 | "project.setup_editor(ontology) # Connect your ontology and editor to your project" |
317 | 317 | ], |
318 | 318 | "cell_type": "code", |
319 | 319 | "outputs": [ |
320 | 320 | { |
321 | | - "name": "stderr", |
322 | 321 | "output_type": "stream", |
| 322 | + "name": "stderr", |
323 | 323 | "text": [ |
324 | 324 | "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" |
325 | 325 | ] |
|
351 | 351 | "cell_type": "code", |
352 | 352 | "outputs": [ |
353 | 353 | { |
354 | | - "name": "stdout", |
355 | 354 | "output_type": "stream", |
| 355 | + "name": "stdout", |
356 | 356 | "text": [ |
357 | 357 | "Batch: <Batch {\n", |
358 | 358 | " \"consensus_settings_json\": \"{\\\"numberOfLabels\\\":1,\\\"coveragePercentage\\\":0}\",\n", |
|
452 | 452 | "source": [ |
453 | 453 | "# Upload our label using Model-Assisted Labeling\n", |
454 | 454 | "upload_job = lb.MALPredictionImport.create_from_objects(\n", |
455 | | - " client = client, \n", |
456 | | - " project_id = project.uid, \n", |
457 | | - " name=f\"mal_job-{str(uuid.uuid4())}\", \n", |
| 455 | + " client = client,\n", |
| 456 | + " project_id = project.uid,\n", |
| 457 | + " name=f\"mal_job-{str(uuid.uuid4())}\",\n", |
458 | 458 | " predictions=label)\n", |
459 | 459 | "\n", |
460 | 460 | "upload_job.wait_until_done();\n", |
|
464 | 464 | "cell_type": "code", |
465 | 465 | "outputs": [ |
466 | 466 | { |
467 | | - "name": "stdout", |
468 | 467 | "output_type": "stream", |
| 468 | + "name": "stdout", |
469 | 469 | "text": [ |
470 | 470 | "Errors: []\n", |
471 | 471 | "Status of uploads: [{'uuid': '40aea601-206f-491c-8bcc-675205dbb351', 'dataRow': {'id': 'clfsl56ww5uyi078ldbojeqby', 'globalKey': 'sample-audio-1.mp3'}, 'status': 'SUCCESS'}, {'uuid': '51c43a0e-a54b-4ee3-94c1-7ccdebe81f98', 'dataRow': {'id': 'clfsl56ww5uyi078ldbojeqby', 'globalKey': 'sample-audio-1.mp3'}, 'status': 'SUCCESS'}, {'uuid': '380273f0-4ed4-4d0a-959a-06659f5edf88', 'dataRow': {'id': 'clfsl56ww5uyi078ldbojeqby', 'globalKey': 'sample-audio-1.mp3'}, 'status': 'SUCCESS'}]\n" |
|
484 | 484 | { |
485 | 485 | "metadata": {}, |
486 | 486 | "source": [ |
487 | | - "# Upload label for this data row in project \n", |
| 487 | + "# Upload label for this data row in project\n", |
488 | 488 | "upload_job = lb.LabelImport.create_from_objects(\n", |
489 | | - " client = client, \n", |
490 | | - " project_id = project.uid, \n", |
491 | | - " name=\"label_import_job\"+str(uuid.uuid4()), \n", |
| 489 | + " client = client,\n", |
| 490 | + " project_id = project.uid,\n", |
| 491 | + " name=\"label_import_job\"+str(uuid.uuid4()),\n", |
492 | 492 | " labels=label)\n", |
493 | 493 | "\n", |
494 | 494 | "upload_job.wait_until_done();\n", |
|
498 | 498 | "cell_type": "code", |
499 | 499 | "outputs": [ |
500 | 500 | { |
501 | | - "name": "stdout", |
502 | 501 | "output_type": "stream", |
| 502 | + "name": "stdout", |
503 | 503 | "text": [ |
504 | 504 | "Errors: []\n", |
505 | 505 | "Status of uploads: [{'uuid': '1e555dd0-3916-4cfb-97be-79f9607da01a', 'dataRow': {'id': 'clfsl56ww5uyi078ldbojeqby', 'globalKey': 'sample-audio-1.mp3'}, 'status': 'SUCCESS'}, {'uuid': 'fe805388-d313-45ea-b3bc-1a7f5ffa0980', 'dataRow': {'id': 'clfsl56ww5uyi078ldbojeqby', 'globalKey': 'sample-audio-1.mp3'}, 'status': 'SUCCESS'}, {'uuid': '83cea6f0-acdf-4a2c-afff-197bac9bdb01', 'dataRow': {'id': 'clfsl56ww5uyi078ldbojeqby', 'globalKey': 'sample-audio-1.mp3'}, 'status': 'SUCCESS'}]\n" |
|
0 commit comments