-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
# This only works when the mode is 'overflow' and in 'C' order. | ||
metadata = { | ||
"mpp": self._mpp, | ||
"dtype": str(batch_dtype), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing dtype
from metadata causes the reader to fail in the _open_file
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two further comments:
- Applying the ICC profiles during training works (tested with TCGA images and Openslide backend).
- When using the CLI functionality of
tiling.py
, a type error indata.py
is raised. Simply ignoring the pylinting with a comment is not enough. I believe addingfrom __future__ import annotations
at the top would solve the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also observe this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Some minor comments added.
@@ -33,18 +57,23 @@ def __init__( | |||
tile_size: tuple[int, int], | |||
tile_overlap: tuple[int, int], | |||
num_samples: int, | |||
is_binary: bool = False, | |||
is_compressed_image: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a bool, i.e., is the behavior completely the same irrespective of the compression type? Or should we make an Enum somewhere with the known compression types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be independent as the compression type is included in the binary blob.
# This only works when the mode is 'overflow' and in 'C' order. | ||
metadata = { | ||
"mpp": self._mpp, | ||
"dtype": str(batch_dtype), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed? It is being used in readers, for example here:
Line 113 in 0ae5c1b
self._dtype = self._metadata["dtype"] |
We could add it with first_batch.dtype
if necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added it back
else: | ||
_mode = "ARRAY" | ||
_format = "RAW" | ||
_num_channels = first_batch.shape[-1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is a typo here, should be first_batch.shape[1]
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's correct as it's the conversion of a PIL Image to an array. If it would be a tensor it would indeed be channels first:
import PIL.Image
import numpy as np
print(np.asarray(PIL.Image.open("image.jpg")).shape)
(1635, 1966, 3)
@jonasteuwen.. this PR also fixes {#16}. It would be nice to add it in the PR description. |
Made this commit to make ahcore compatible with upstream changes made to dlup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is the PR that allows ICC profiles to be used during training.
Furthermore it also fixes #43.