|
8 | 8 | "# bioimageio.core usage examples"
|
9 | 9 | ]
|
10 | 10 | },
|
| 11 | + { |
| 12 | + "cell_type": "markdown", |
| 13 | + "id": "275284b2", |
| 14 | + "metadata": {}, |
| 15 | + "source": [ |
| 16 | + "# ⚠️ this notebook needs to be updated " |
| 17 | + ] |
| 18 | + }, |
11 | 19 | {
|
12 | 20 | "cell_type": "code",
|
13 | 21 | "execution_count": null,
|
14 | 22 | "id": "c72ba149",
|
15 | 23 | "metadata": {},
|
16 | 24 | "outputs": [],
|
17 | 25 | "source": [
|
18 |
| - "import os\n", |
19 | 26 | "import hashlib\n",
|
| 27 | + "import os\n", |
20 | 28 | "\n",
|
21 |
| - "import bioimageio.core\n", |
22 | 29 | "import imageio\n",
|
23 | 30 | "\n",
|
24 | 31 | "# we use napari for visualising images, you can install it via `pip install napari` or`conda install napari`\n",
|
25 | 32 | "import napari\n",
|
26 | 33 | "import numpy as np\n",
|
27 |
| - "import xarray as xr" |
| 34 | + "import xarray as xr\n", |
| 35 | + "\n", |
| 36 | + "import bioimageio.core" |
28 | 37 | ]
|
29 | 38 | },
|
30 | 39 | {
|
|
359 | 368 | "source": [
|
360 | 369 | "# The convenience function `predict_images` can be use to run prediction for many images stored on disc\n",
|
361 | 370 | "# Note: this only works for models which have a single input and output!\n",
|
362 |
| - "from bioimageio.core.prediction import predict_images\n", |
363 |
| - "\n", |
364 | 371 | "# Here we use a small subset of the dsb challenge data for prediction.\n",
|
365 | 372 | "# The original data is available at https://github.com/stardist/stardist/releases/download/0.1.0/dsb2018.zip.\n",
|
366 | 373 | "# We have added a few images to the repository so that the notebook runs out of the box.\n",
|
367 |
| - "\n", |
368 | 374 | "# Get all paths to the images in the \"example-images\" folder.\n",
|
369 | 375 | "from glob import glob\n",
|
370 | 376 | "\n",
|
| 377 | + "from bioimageio.core.prediction import predict_images\n", |
| 378 | + "\n", |
371 | 379 | "inputs = glob(\"./example-images/*.png\")\n",
|
372 | 380 | "\n",
|
373 | 381 | "# Create an output folder and specify the output path for each image.\n",
|
|
443 | 451 | "name": "python",
|
444 | 452 | "nbconvert_exporter": "python",
|
445 | 453 | "pygments_lexer": "ipython3",
|
446 |
| - "version": "3.9.7" |
| 454 | + "version": "3.9.19" |
447 | 455 | }
|
448 | 456 | },
|
449 | 457 | "nbformat": 4,
|
|
0 commit comments