Title: New predict command: how to pass input_block_shape? · Issue #414 · bioimage-io/core-bioimage-io-python · GitHub
Open Graph Title: New predict command: how to pass input_block_shape? · Issue #414 · bioimage-io/core-bioimage-io-python
X Title: New predict command: how to pass input_block_shape? · Issue #414 · bioimage-io/core-bioimage-io-python
Description: It's unclear how to pass the value for input_block_shape in order to specify a fixed tiling shape. The code import bioimageio.core import imageio.v3 as imageio from xarray import DataArray # For a reproducible example you can use the mod...
Open Graph Description: It's unclear how to pass the value for input_block_shape in order to specify a fixed tiling shape. The code import bioimageio.core import imageio.v3 as imageio from xarray import DataArray # For a ...
X Description: It's unclear how to pass the value for input_block_shape in order to specify a fixed tiling shape. The code import bioimageio.core import imageio.v3 as imageio from xarray import DataArray # Fo...
Opengraph URL: https://github.com/bioimage-io/core-bioimage-io-python/issues/414
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New predict command: how to pass input_block_shape?","articleBody":"It's unclear how to pass the value for `input_block_shape` in order to specify a fixed tiling shape.\r\nThe code\r\n```python\r\nimport bioimageio.core\r\nimport imageio.v3 as imageio\r\nfrom xarray import DataArray\r\n\r\n# For a reproducible example you can use the model test inputs.\r\n# (I cannot easily figure out how to load them from the model ...)\r\nimage = imageio.imread(\"/home/pape/.cache/micro_sam/sample_data/livecell-2d-image.png\")\r\nmodel = bioimageio.core.load_description(\"hiding-tiger\")\r\n\r\ninputs = {model.inputs[0].name: DataArray(image[None, None], dims=(\"batch\", \"channel\", \"y\", \"x\"))}\r\n\r\ntile_shape = {\"y\": 512, \"x\": 512}\r\npred = bioimageio.core.predict(model=model, inputs=inputs, input_block_shape=tile_shape)\r\n```\r\nfails with\r\n```\r\nTraceback (most recent call last):\r\n File \"/home/pape/Work/playground/bioimageio/new-pred/check_new_pred.py\", line 13, in \u003cmodule\u003e\r\n pred = bioimageio.core.predict(model=model, inputs=inputs, input_block_shape=tile_shape)\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/pape/Work/bioimageio/core-bioimage-io-python/bioimageio/core/prediction.py\", line 100, in predict\r\n output = pp.predict_sample_with_fixed_blocking(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/pape/Work/bioimageio/core-bioimage-io-python/bioimageio/core/_prediction_pipeline.py\", line 193, in predict_sample_with_fixed_blocking\r\n n_blocks, input_blocks = sample.split_into_blocks(\r\n ^^^^^^^^^^^^^^^^^^^^^^^^^\r\n File \"/home/pape/Work/bioimageio/core-bioimage-io-python/bioimageio/core/sample.py\", line 68, in split_into_blocks\r\n assert not (\r\n```","author":{"url":"https://github.com/constantinpape","@type":"Person","name":"constantinpape"},"datePublished":"2024-08-22T14:52:54.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/414/core-bioimage-io-python/issues/414"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8a3dcc9c-fe3f-a74d-7202-41bd59bf3b11 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EACE:337729:503F85:71984F:6A4BCB58 |
| html-safe-nonce | 1a95e5df529d9afc4aece8979143287c79d1f342b11cb0e988b83f46b61dddbb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUNFOjMzNzcyOTo1MDNGODU6NzE5ODRGOjZBNEJDQjU4IiwidmlzaXRvcl9pZCI6IjYzNDY0NTkwNDA4OTgwNzU0ODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c20deca8a54439ba05e194b467dee59ad951a055645600010ed1beb1b6b12060 |
| hovercard-subject-tag | issue:2480997033 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/bioimage-io/core-bioimage-io-python/414/issue_layout |
| twitter:image | https://opengraph.githubassets.com/790ae5bbf5bc8225010101da7edf9dc93de09995e68e24b788d4713164c25072/bioimage-io/core-bioimage-io-python/issues/414 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/790ae5bbf5bc8225010101da7edf9dc93de09995e68e24b788d4713164c25072/bioimage-io/core-bioimage-io-python/issues/414 |
| og:image:alt | It's unclear how to pass the value for input_block_shape in order to specify a fixed tiling shape. The code import bioimageio.core import imageio.v3 as imageio from xarray import DataArray # For a ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | constantinpape |
| hostname | github.com |
| expected-hostname | github.com |
| None | 14aa00ce5bdb34d0eefb5facbffd7de9e144c688d8a93ef8df902d5f94b51dd7 |
| turbo-cache-control | no-preview |
| go-import | github.com/bioimage-io/core-bioimage-io-python git https://github.com/bioimage-io/core-bioimage-io-python.git |
| octolytics-dimension-user_id | 54582174 |
| octolytics-dimension-user_login | bioimage-io |
| octolytics-dimension-repository_id | 218790457 |
| octolytics-dimension-repository_nwo | bioimage-io/core-bioimage-io-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 218790457 |
| octolytics-dimension-repository_network_root_nwo | bioimage-io/core-bioimage-io-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 58b8f89190447502561829f30862aa0a99d53367 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width