What: Make LVAE prediction functions compatible with CAREamics tiling pipeline.
Why: The aim is to reimplement the current LVAE prediction functions as the Lightning predict_step method. This means they should be compatible with the existing CAREamics tiling.
How: Allow inputs to the prediction functions to have auxiliary inputs (i.e. inputs are tuples with the first element being the input tensor, for tiled inputs the second element is a TileInformation object). This simulates what the batch argument will be in the predict_step method.
Changes Made
Added: Smoke test of LVAE prediction with CAREamics tiling pipeline in pure Pytorch. Following #207 and a refactor of InMemoryTiledPredDataset, this can be updated to allow for testing the two different tiling strategies.
Modified:
The LVAE prediction functions have been modified to accept tuples as input, and they have also been renamed to reflect that they are intended to predict on a tiled batch.
The stitch prediction function had to be modified to deal with when there is a mismatch between the number of input and target channels. Currently the fix is a bit ugly and really the array_shape attribute in TileInformation should be updated with the correct channels before being passed to stitch prediction, but that would probably take a fair bit of refactoring.
[x] Code builds and passes tests locally, including doctests
[x] New tests have been added (for bug fixes/features)
[x] Pre-commit passes
[ ] PR to the documentation exists (for bug fixes / features)
Description
predict_step
method. This means they should be compatible with the existing CAREamics tiling.TileInformation
object). This simulates what thebatch
argument will be in thepredict_step
method.Changes Made
Added: Smoke test of LVAE prediction with CAREamics tiling pipeline in pure Pytorch. Following #207 and a refactor of
InMemoryTiledPredDataset
, this can be updated to allow for testing the two different tiling strategies.Modified:
array_shape
attribute inTileInformation
should be updated with the correct channels before being passed to stitch prediction, but that would probably take a fair bit of refactoring.[x] Code builds and passes tests locally, including doctests
[x] New tests have been added (for bug fixes/features)
[x] Pre-commit passes
[ ] PR to the documentation exists (for bug fixes / features)