|
18 | 18 | "\n", |
19 | 19 | "All three share the same two-step shape:\n", |
20 | 20 | "- `.parse()` reads and validates the dataset on disk. Use it to preview image/box counts and class names before uploading anything. Unsupported annotations (e.g. polygons) are counted, not silently dropped.\n", |
21 | | - "- `.import_to_project(project, api=None)` reuses the parsed result to upload the images and their box annotations. `api` is optional and defaults to a new `Api()` if omitted.\n", |
| 21 | + "- `.import_to_project(project)` reuses the parsed result to upload the images and their box annotations. \n", |
22 | 22 | "\n", |
23 | 23 | "This notebook builds tiny synthetic datasets in each format (a couple of generated images) so it runs end-to-end without needing an external download." |
24 | 24 | ] |
|
187 | 187 | "cell_type": "markdown", |
188 | 188 | "metadata": {}, |
189 | 189 | "source": [ |
190 | | - "Then upload the images and their box annotations. `api` is optional here -- it defaults to a new `Api()` if omitted, but we reuse the one from Setup:" |
| 190 | + "Then upload the images and their box annotations. " |
191 | 191 | ] |
192 | 192 | }, |
193 | 193 | { |
|
196 | 196 | "metadata": {}, |
197 | 197 | "outputs": [], |
198 | 198 | "source": [ |
199 | | - "result = coco_importer.import_to_project(project_coco, api=api, tags=[\"coco-import-tutorial\"])\n", |
| 199 | + "result = coco_importer.import_to_project(project_coco, tags=[\"coco-import-tutorial\"])\n", |
200 | 200 | "\n", |
201 | 201 | "print(f\"Uploaded images: {result.n_images_uploaded}\")\n", |
202 | 202 | "print(f\"Uploaded boxes: {result.n_boxes_uploaded}\")\n", |
|
270 | 270 | "preview = voc_importer.parse()\n", |
271 | 271 | "print(f\"{preview.num_images} images, {preview.num_boxes} boxes, classes={preview.class_names}\")\n", |
272 | 272 | "\n", |
273 | | - "result = voc_importer.import_to_project(project_voc, api=api, tags=[\"voc-import-tutorial\"])\n", |
| 273 | + "result = voc_importer.import_to_project(project_voc, tags=[\"voc-import-tutorial\"])\n", |
274 | 274 | "print(f\"Uploaded images: {result.n_images_uploaded}, boxes: {result.n_boxes_uploaded}, errors: {result.errors}\")" |
275 | 275 | ] |
276 | 276 | }, |
|
337 | 337 | "preview = yolo_importer.parse()\n", |
338 | 338 | "print(f\"{preview.num_images} images, {preview.num_boxes} boxes, classes={preview.class_names}\")\n", |
339 | 339 | "\n", |
340 | | - "result = yolo_importer.import_to_project(project_yolo, api=api, tags=[\"yolo-import-tutorial\"])\n", |
| 340 | + "result = yolo_importer.import_to_project(project_yolo, tags=[\"yolo-import-tutorial\"])\n", |
341 | 341 | "print(f\"Uploaded images: {result.n_images_uploaded}, boxes: {result.n_boxes_uploaded}, errors: {result.errors}\")" |
342 | 342 | ] |
343 | 343 | } |
|
0 commit comments