|
292 | 292 | "We will create a Label called mal_label which has the same original structure as the label above\n", |
293 | 293 | "\n", |
294 | 294 | "Notes:\n", |
295 | | - "* Each label requires a valid feature schema id. We will assign it using our built in `assign_feature_schema_ids` method\n", |
296 | 295 | "* the NDJsonConverter takes in a list of labels" |
297 | 296 | ] |
298 | 297 | }, |
|
304 | 303 | "id": "10b19393-920a-45c8-9660-42d8c449b9c2", |
305 | 304 | "outputId": "a93a39de-c8ed-402c-b834-304b1ba8854a" |
306 | 305 | }, |
307 | | - "outputs": [ |
308 | | - { |
309 | | - "data": { |
310 | | - "text/plain": [ |
311 | | - "[{'uuid': 'fde1945b-01df-43c2-807a-3f5fa20450f4',\n", |
312 | | - " 'dataRow': {'id': 'ckzocppkf96r10z9q205151c3'},\n", |
313 | | - " 'schemaId': 'ckzocpq4l9bw20z9s9bc70h29',\n", |
314 | | - " 'classifications': [],\n", |
315 | | - " 'bbox': {'top': 30.0, 'left': 30.0, 'height': 170.0, 'width': 170.0}}]" |
316 | | - ] |
317 | | - }, |
318 | | - "execution_count": 6, |
319 | | - "metadata": {}, |
320 | | - "output_type": "execute_result" |
321 | | - } |
322 | | - ], |
| 306 | + "outputs": [], |
323 | 307 | "source": [ |
324 | 308 | "mal_label = Label(\n", |
325 | 309 | " data=image_data,\n", |
326 | 310 | " annotations = [rectangle_annotation]\n", |
327 | 311 | ")\n", |
328 | 312 | "\n", |
329 | | - "mal_label.assign_feature_schema_ids(ontology_builder.from_project(mal_project))\n", |
330 | | - "\n", |
331 | 313 | "ndjson_labels = list(NDJsonConverter.serialize([mal_label]))\n", |
332 | 314 | "\n", |
333 | 315 | "ndjson_labels" |
|
397 | 379 | "id": "41d103bc-a5fd-4f0b-95f0-7e9bc59fbd07" |
398 | 380 | }, |
399 | 381 | "source": [ |
400 | | - "Label import is very similar to model-assisted labeling. We will need to re-assign the feature schema before continuing, \n", |
401 | | - "but we can continue to use our NDJSonConverter\n", |
402 | | - "\n", |
403 | | - "We will create a Label called li_label which has the same original structure as the label above" |
| 382 | + "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" |
404 | 383 | ] |
405 | 384 | }, |
406 | 385 | { |
|
411 | 390 | "id": "c95716d5-a1ee-46fe-8dca-313ce10f104f", |
412 | 391 | "outputId": "0e83d5d0-1f51-4903-c777-f9c331781656" |
413 | 392 | }, |
414 | | - "outputs": [ |
415 | | - { |
416 | | - "data": { |
417 | | - "text/plain": [ |
418 | | - "[{'uuid': '7be8bb0b-39a2-44a5-96ab-5def3752811b',\n", |
419 | | - " 'dataRow': {'id': 'ckzocppkf96r10z9q205151c3'},\n", |
420 | | - " 'schemaId': 'ckzocpqv80ukp0z9l67cc6liv',\n", |
421 | | - " 'classifications': [],\n", |
422 | | - " 'bbox': {'top': 30.0, 'left': 30.0, 'height': 170.0, 'width': 170.0}}]" |
423 | | - ] |
424 | | - }, |
425 | | - "execution_count": 9, |
426 | | - "metadata": {}, |
427 | | - "output_type": "execute_result" |
428 | | - } |
429 | | - ], |
| 393 | + "outputs": [], |
430 | 394 | "source": [ |
431 | 395 | "li_label = Label(\n", |
432 | 396 | " data=image_data,\n", |
433 | 397 | " annotations = [rectangle_annotation]\n", |
434 | 398 | ")\n", |
435 | 399 | "\n", |
436 | | - "li_label.assign_feature_schema_ids(ontology_builder.from_project(li_project))\n", |
437 | | - "\n", |
438 | 400 | "ndjson_labels = list(NDJsonConverter.serialize([li_label]))\n", |
439 | 401 | "\n", |
440 | 402 | "ndjson_labels" |
|
0 commit comments