Skip to content

Commit c24bf95

Browse files
committed
black
1 parent fda2a51 commit c24bf95

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

example/model_usage.ipynb

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,13 @@
9595
"# Improve readiblity of validation errors\n",
9696
"enable_pretty_validation_errors_in_ipynb()\n",
9797
"\n",
98+
"\n",
9899
"# Function to display input and prediction output images\n",
99-
"def show_images(images: Union[Mapping[str, NDArray[Any]], Mapping[TensorId, Union[Tensor, NDArray[Any]]]]) -> None:\n",
100+
"def show_images(\n",
101+
" images: Union[\n",
102+
" Mapping[str, NDArray[Any]], Mapping[TensorId, Union[Tensor, NDArray[Any]]]\n",
103+
" ],\n",
104+
") -> None:\n",
100105
"\n",
101106
" for title, image in images.items():\n",
102107
" if isinstance(image, Tensor):\n",
@@ -162,8 +167,8 @@
162167
"outputs": [],
163168
"source": [
164169
"model_source = \"affable-shark/1.2\"\n",
165-
"#model_source = \"10.5281/zenodo.6287342\"\n",
166-
"#model_source = \"https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/affable-shark/draft/files/rdf.yaml\""
170+
"# model_source = \"10.5281/zenodo.6287342\"\n",
171+
"# model_source = \"https://uk1s3.embassy.ebi.ac.uk/public-datasets/bioimage.io/affable-shark/draft/files/rdf.yaml\""
167172
]
168173
},
169174
{
@@ -220,8 +225,8 @@
220225
"from bioimageio.core import test_model\n",
221226
"\n",
222227
"model = load_model_description(model_source, format_version=\"latest\")\n",
223-
"test_summary = test_model(model) #Test model to check environment compatibility \n",
224-
"assert test_summary.status == \"passed\", test_summary.display() "
228+
"test_summary = test_model(model) # Test model to check environment compatibility\n",
229+
"assert test_summary.status == \"passed\", test_summary.display()"
225230
]
226231
},
227232
{
@@ -345,7 +350,6 @@
345350
}
346351
],
347352
"source": [
348-
"\n",
349353
"print(\n",
350354
" f\"Model '{model.name}' requires {len(model.inputs)} input(s) with the following features:\"\n",
351355
")\n",
@@ -422,7 +426,7 @@
422426
"prediction: Sample = predict(model=model, inputs=input)\n",
423427
"\n",
424428
"# show the input and prediction result\n",
425-
"show_images(input | prediction.members)\n"
429+
"show_images(input | prediction.members)"
426430
]
427431
},
428432
{
@@ -484,9 +488,9 @@
484488
"from bioimageio.core.stat_measures import DatasetMean\n",
485489
"\n",
486490
"sample = Sample(\n",
487-
" members={\"raw\": test_input_tensor}, \n",
488-
" stat={DatasetMean(member_id=TensorId(\"raw\")): 123.456}, # Example mean value\n",
489-
" id=\"sample-from-numpy\"\n",
491+
" members={\"raw\": test_input_tensor},\n",
492+
" stat={DatasetMean(member_id=TensorId(\"raw\")): 123.456}, # Example mean value\n",
493+
" id=\"sample-from-numpy\",\n",
490494
")\n",
491495
"\n",
492496
"sample"

0 commit comments

Comments
 (0)