Skip to content

Commit

Permalink
Added example notebook to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fercer committed May 7, 2024
1 parent 0f1d718 commit 4afb0bd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/source/examples/advanced_example_pytorch_inference.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
---
jupytext:
text_representation:
extension: .md
format_name: myst
format_version: 0.13
jupytext_version: 1.15.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
execution:
timeout: 120
---

# Integration of ZarrDataset with PyTorch's DataLoader for inference (Advanced)

```python
import zarrdataset as zds

Expand Down Expand Up @@ -32,7 +49,7 @@ random.seed(478965)
## Extracting patches of size 1024x1024 pixels from a Whole Slide Image (WSI)

Retrieve samples for inference. Add padding to each patch to avoid edge artifacts when stitching the inference result.
Finally, let the PatchSampler retrieve patches from the edge of the image that would be otherwise smaller than the patch size.
Finally, let the PatchSampler retrieve patches from the edge of the image that would be otherwise smaller than the patch size by setting `allow_incomplete_patches=True`.


```python
Expand Down
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Welcome to ZarrDataset's documentation!

examples/advanced_example_pytorch

examples/advanced_example_pytorch_inference


REFERENCE
=========
Expand Down

0 comments on commit 4afb0bd

Please sign in to comment.