Repository navigation
Conversation
|
Hello @noahstier! Thanks for submitting the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #2587 +/- ##
==========================================
+ Coverage 90.75% 90.76% +<.01%
==========================================
Files 308 308
Lines 21886 21894 +8
Branches 1884 1885 +1
==========================================
+ Hits 19863 19871 +8
Misses 1677 1677
Partials 346 346
Continue to review full report at Codecov.
|
| new_dims.append(new_dim) | ||
|
|
||
| return resize(image, output_shape, order=order, mode=mode, cval=cval, | ||
| return resize(image, new_dims, order=order, mode=mode, cval=cval, |
There was a problem hiding this comment.
resize doesn't not support arbitrary number of dimension, does it?
| new_dims = [] | ||
| for (orig_dim, dim_scale) in zip(orig_dims, scale): | ||
| new_dim = np.round(dim_scale * orig_dim) | ||
| new_dims.append(new_dim) |
There was a problem hiding this comment.
FWIW, this could be a one-liner:
new_dims = list([np.round(orig_dim * dim_scale)
for (orig_dim, dim_scale) in zip(orig_dims, scale)])
jni
left a comment
There was a problem hiding this comment.
LGTM, @soupault's style recommendation is good, but it's optional afaic. If anyone wants to merge, go ahead. =) Thanks @noahstier!
|
I don't like how the multichannel case is handled now. We should probably add |
|
It looks like @soupault is the idea behind a |
|
@noahstier I agree with you that |
|
@noahstier indeed converting both functions to take arbitrary dimensions would be fantastic! |
|
I had also proposed this long ago in #1522, but it was not reviewed at the time and I neglected to follow up on it recently. I am fine with @noahstier cherry-picking/merging things from that PR as well if there are things there which are helpful. definitely +1 on getting additional |
|
@jni My opinion is that we should stick to a single design, and the most clear and explicit one is the one with |
|
@soupault I kind of agree with you with regards to the ambiguity. However, when len(scale) == len(image.shape) - 1, I think it is unambiguous and clear what the user wants. At any rate, I'm not opposed to @noahstier at any rate, we certainly can't merge this until it does what it intends to do. ;) Would you like to update the PR to rescale nD images correctly? |
|
I revisited #1522 today to rebase on master after the big |
Description
Handle n-dimensional arrays in transform.rescale
Previously it only handled 1- and 2-dimensional arrays
Checklist
./doc/examples(new features only)References
implements enhancement #2568