|
6 | 6 | "source": [ |
7 | 7 | "# Bioimage Model Zoo Core Example notebook\n", |
8 | 8 | "\n", |
9 | | - "This notebook shows how to interact with the `bioimageio.core` programmatically to explore, load, use, and export content from the [BioImage Model Zoo](https://bioimage.io)." |
| 9 | + "This notebook shows how to interact with the `bioimageio.core` programmatically to explore, load, use, and export content from the [BioImage Model Zoo](https://bioimage.io).\n", |
| 10 | + "\n", |
| 11 | + "\n", |
| 12 | + "quick links:\n", |
| 13 | + "- [Create an input sample for a given model](#create_sample_for_model)" |
10 | 14 | ] |
11 | 15 | }, |
12 | 16 | { |
|
30 | 34 | "outputs": [], |
31 | 35 | "source": [ |
32 | 36 | "try:\n", |
33 | | - " import bioimageio.core\n", |
34 | | - " import torch\n", |
35 | 37 | " import matplotlib\n", |
| 38 | + " import torch\n", |
| 39 | + "\n", |
| 40 | + " import bioimageio.core\n", |
36 | 41 | "except ImportError:\n", |
37 | 42 | " %pip install bioimageio.core==0.6.7 torch==2.3.1 matplotlib==3.9.0" |
38 | 43 | ] |
|
73 | 78 | "outputs": [], |
74 | 79 | "source": [ |
75 | 80 | "# Load general dependencies\n", |
76 | | - "from imageio.v2 import imread\n", |
77 | | - "from bioimageio.spec.utils import download\n", |
78 | 81 | "from pprint import pprint\n", |
| 82 | + "\n", |
79 | 83 | "import matplotlib.pyplot as plt\n", |
80 | 84 | "import numpy as np\n", |
| 85 | + "from imageio.v2 import imread\n", |
| 86 | + "\n", |
| 87 | + "from bioimageio.spec.utils import download\n", |
81 | 88 | "\n", |
82 | 89 | "\n", |
83 | 90 | "# Function to display input and prediction output images\n", |
|
300 | 307 | "metadata": {}, |
301 | 308 | "outputs": [], |
302 | 309 | "source": [ |
303 | | - "from bioimageio.spec.utils import load_array\n", |
304 | 310 | "from bioimageio.spec.model import v0_5\n", |
| 311 | + "from bioimageio.spec.utils import load_array\n", |
305 | 312 | "\n", |
306 | 313 | "assert isinstance(model, v0_5.ModelDescr)\n", |
307 | 314 | "input_image = load_array(model.inputs[0].test_tensor)\n", |
|
359 | 366 | "cell_type": "markdown", |
360 | 367 | "metadata": {}, |
361 | 368 | "source": [ |
362 | | - "`bioimageio.core` provides the helper function `create_sample_for_model` to automatically create the `Sample` for the given model." |
| 369 | + "`bioimageio.core` provides the helper function `create_sample_for_model` to automatically create the `Sample` for the given model.\n", |
| 370 | + "<a id='create_sample_for_model'></a>" |
363 | 371 | ] |
364 | 372 | }, |
365 | 373 | { |
|
0 commit comments