|
1 | 1 | import numpy as np
|
2 | 2 | import torch
|
3 |
| -from pytorch_toolbelt.inference.tiles import ImageSlicer, CudaTileMerger |
| 3 | +from pytorch_toolbelt.inference.tiles import ImageSlicer, TileMerger |
4 | 4 | from pytorch_toolbelt.utils.torch_utils import tensor_from_rgb_image, rgb_image_from_tensor, to_numpy
|
5 | 5 | from torch import nn
|
6 | 6 | from torch.utils.data import DataLoader
|
@@ -32,7 +32,7 @@ def test_tiles_split_merge_non_dividable_cuda():
|
32 | 32 | tiler = ImageSlicer(image.shape, tile_size=(1280, 1280), tile_step=(1280, 1280), weight="mean")
|
33 | 33 | tiles = tiler.split(image)
|
34 | 34 |
|
35 |
| - merger = CudaTileMerger(tiler.target_shape, channels=image.shape[2], weight=tiler.weight) |
| 35 | + merger = TileMerger(tiler.target_shape, channels=image.shape[2], weight=tiler.weight) |
36 | 36 | for tile, coordinates in zip(tiles, tiler.crops):
|
37 | 37 | # Integrate as batch of size 1
|
38 | 38 | merger.integrate_batch(tensor_from_rgb_image(tile).unsqueeze(0).float().cuda(), [coordinates])
|
@@ -72,7 +72,7 @@ def forward(self, input):
|
72 | 72 |
|
73 | 73 | model = MaxChannelIntensity().eval().cuda()
|
74 | 74 |
|
75 |
| - merger = CudaTileMerger(tiler.target_shape, 1, tiler.weight) |
| 75 | + merger = TileMerger(tiler.target_shape, 1, tiler.weight) |
76 | 76 | for tiles_batch, coords_batch in DataLoader(list(zip(tiles, tiler.crops)), batch_size=8, pin_memory=True):
|
77 | 77 | tiles_batch = tiles_batch.float().cuda()
|
78 | 78 | pred_batch = model(tiles_batch)
|
|
0 commit comments