Skip to content

Commit ea65ead

Browse files
authored
Merge pull request #425 from bioimage-io/add_quick_links
Add quick links within model_usage.ipynb
2 parents 878c646 + 6caaf0e commit ea65ead

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

example/model_usage.ipynb

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
"source": [
77
"# Bioimage Model Zoo Core Example notebook\n",
88
"\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)"
1014
]
1115
},
1216
{
@@ -30,9 +34,10 @@
3034
"outputs": [],
3135
"source": [
3236
"try:\n",
33-
" import bioimageio.core\n",
34-
" import torch\n",
3537
" import matplotlib\n",
38+
" import torch\n",
39+
"\n",
40+
" import bioimageio.core\n",
3641
"except ImportError:\n",
3742
" %pip install bioimageio.core==0.6.7 torch==2.3.1 matplotlib==3.9.0"
3843
]
@@ -73,11 +78,13 @@
7378
"outputs": [],
7479
"source": [
7580
"# Load general dependencies\n",
76-
"from imageio.v2 import imread\n",
77-
"from bioimageio.spec.utils import download\n",
7881
"from pprint import pprint\n",
82+
"\n",
7983
"import matplotlib.pyplot as plt\n",
8084
"import numpy as np\n",
85+
"from imageio.v2 import imread\n",
86+
"\n",
87+
"from bioimageio.spec.utils import download\n",
8188
"\n",
8289
"\n",
8390
"# Function to display input and prediction output images\n",
@@ -300,8 +307,8 @@
300307
"metadata": {},
301308
"outputs": [],
302309
"source": [
303-
"from bioimageio.spec.utils import load_array\n",
304310
"from bioimageio.spec.model import v0_5\n",
311+
"from bioimageio.spec.utils import load_array\n",
305312
"\n",
306313
"assert isinstance(model, v0_5.ModelDescr)\n",
307314
"input_image = load_array(model.inputs[0].test_tensor)\n",
@@ -359,7 +366,8 @@
359366
"cell_type": "markdown",
360367
"metadata": {},
361368
"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>"
363371
]
364372
},
365373
{

0 commit comments

Comments
 (0)