predtiler 0.0.1__tar.gz → 0.0.2__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: predtiler
3
- Version: 0.0.1
4
- Summary: Converting your dataset class into a class that can be used for tiled prediction and eventually obtain stiched prediction.
3
+ Version: 0.0.2
4
+ Summary: Subclassing your dataset class into a new class that can be used for tiled prediction to obtain the stitched prediction.
5
5
  Project-URL: homepage, https://github.com/ashesh-0/PredTiler
6
6
  Project-URL: repository, https://github.com/ashesh-0/PredTiler
7
7
  Author: Ashesh
@@ -86,7 +86,7 @@ For this we also need a tile manager that will manage the tiles.
86
86
 
87
87
  ```python
88
88
 
89
- from predtiler.dataset import get_tiling_dataset, get_tile_manager
89
+ from predtiler import get_tiling_dataset, get_tile_manager, stitch_predictions
90
90
  patch_size = 256
91
91
  tile_size = 128
92
92
  data_shape = (10, 2048, 2048) # size of the data you are working with
@@ -57,7 +57,7 @@ For this we also need a tile manager that will manage the tiles.
57
57
 
58
58
  ```python
59
59
 
60
- from predtiler.dataset import get_tiling_dataset, get_tile_manager
60
+ from predtiler import get_tiling_dataset, get_tile_manager, stitch_predictions
61
61
  patch_size = 256
62
62
  tile_size = 128
63
63
  data_shape = (10, 2048, 2048) # size of the data you are working with
@@ -16,8 +16,8 @@ sources = ["src"]
16
16
  # https://peps.python.org/pep-0621/
17
17
  [project]
18
18
  name = "predtiler"
19
- version = "0.0.1"
20
- description = "Converting your dataset class into a class that can be used for tiled prediction and eventually obtain stiched prediction."
19
+ version = "0.0.2"
20
+ description = "Subclassing your dataset class into a new class that can be used for tiled prediction to obtain the stitched prediction."
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.9"
23
23
  license = { text = "MIT" }
@@ -0,0 +1,8 @@
1
+ from .tile_stitcher import stitch_predictions
2
+ from .dataset import get_tiling_dataset, get_tile_manager
3
+
4
+ __all__ = [
5
+ 'stitch_predictions',
6
+ 'get_tiling_dataset',
7
+ 'get_tile_manager'
8
+ ]
@@ -15,8 +15,7 @@ def stitch_predictions(predictions:np.ndarray, manager):
15
15
  mng = manager
16
16
  shape = list(mng.data_shape)
17
17
  shape.append(predictions.shape[1])
18
- print(shape)
19
-
18
+ assert mng.patch_shape[-2:] == predictions.shape[-2:], 'Patch shape and predictions shape must match. Please set the patch shape correctly'
20
19
  output = np.zeros(shape, dtype=predictions.dtype)
21
20
  for dset_idx in range(predictions.shape[0]):
22
21
  # grid start, grid end
@@ -1,7 +1,6 @@
1
1
  from unittest.mock import Mock
2
2
  import numpy as np
3
- from predtiler.dataset import get_tiling_dataset, get_tile_manager
4
- from predtiler.tile_stitcher import stitch_predictions
3
+ from predtiler import get_tiling_dataset, get_tile_manager, stitch_predictions
5
4
 
6
5
  def get_data_3D(n=5,Z=9, H=512,W=512,C=2):
7
6
  data = np.arange(n*Z*H*W*C).reshape(n,Z,H,W,C)
File without changes
File without changes