-
Notifications
You must be signed in to change notification settings - Fork 57
Update of features/LoadImage #383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
* documented channel2d func * unit tests: channelfirst2d * type hints * Update features.py * NDArray type hint * included Image type hint and xp usage * unit test checks for torch_available * Update features.py * u * docs * linebreak * docs * Update test_features.py * Update test_features.py * deprecation warning & tests * Added support for Image objects * Tests for image objects * docs * tests and axis compatibility * fix for repeated calls * revert changes to upscale * Implemented feedback --------- Co-authored-by: Giovanni Volpe <giovanni.volpe@physics.gu.se>
…ms sometimes arising when unittesting
@@ -397,7 +397,7 @@ def get( | |||
n: int | list[int], | |||
m: int | list[int], | |||
coefficient: float | list[float], | |||
**kwargs: dict[str, Any], | |||
**kwargs: Any, | |||
) -> np.ndarray: |
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.
Type hint should be NDArray
if we are swapping from np.ndarray
as_list: bool, | ||
get_one_random: bool, | ||
**kwargs: Any | ||
) -> np.ndarray | torch.tensor | list` |
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 ) -> NDArray | torch.Tensor | list
.
As torch.Tensor and torch.tensor are not the same we should do a revisal at some point and homogenize this across features
.
Made LoadImage compatible with torch, and updated the documetation and unittesting.
When I tried loading a list, I got an error from the line
while ndim and image.ndim < ndim:
,so I changed it to
if not isinstance(image, list) and ndim:
while image.ndim < ndim: