Skip to content

Commit

Permalink
Merge pull request #425 from bioimage-io/add_quick_links
Browse files Browse the repository at this point in the history
Add quick links within model_usage.ipynb
  • Loading branch information
FynnBe authored Oct 17, 2024
2 parents 878c646 + 6caaf0e commit ea65ead
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions example/model_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
"source": [
"# Bioimage Model Zoo Core Example notebook\n",
"\n",
"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)."
"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",
"\n",
"\n",
"quick links:\n",
"- [Create an input sample for a given model](#create_sample_for_model)"
]
},
{
Expand All @@ -30,9 +34,10 @@
"outputs": [],
"source": [
"try:\n",
" import bioimageio.core\n",
" import torch\n",
" import matplotlib\n",
" import torch\n",
"\n",
" import bioimageio.core\n",
"except ImportError:\n",
" %pip install bioimageio.core==0.6.7 torch==2.3.1 matplotlib==3.9.0"
]
Expand Down Expand Up @@ -73,11 +78,13 @@
"outputs": [],
"source": [
"# Load general dependencies\n",
"from imageio.v2 import imread\n",
"from bioimageio.spec.utils import download\n",
"from pprint import pprint\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from imageio.v2 import imread\n",
"\n",
"from bioimageio.spec.utils import download\n",
"\n",
"\n",
"# Function to display input and prediction output images\n",
Expand Down Expand Up @@ -300,8 +307,8 @@
"metadata": {},
"outputs": [],
"source": [
"from bioimageio.spec.utils import load_array\n",
"from bioimageio.spec.model import v0_5\n",
"from bioimageio.spec.utils import load_array\n",
"\n",
"assert isinstance(model, v0_5.ModelDescr)\n",
"input_image = load_array(model.inputs[0].test_tensor)\n",
Expand Down Expand Up @@ -359,7 +366,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"`bioimageio.core` provides the helper function `create_sample_for_model` to automatically create the `Sample` for the given model."
"`bioimageio.core` provides the helper function `create_sample_for_model` to automatically create the `Sample` for the given model.\n",
"<a id='create_sample_for_model'></a>"
]
},
{
Expand Down

0 comments on commit ea65ead

Please sign in to comment.