-
Notifications
You must be signed in to change notification settings - Fork 1
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
Missing patches when zarr-chunks is not "full" #5
Comments
Related to the possible solution of this issue: In case of z = zarr.zeros((1, 1, 5), chunks=(1, 1, 4), dtype='uint8')
zarr.save(filename, z)
patch_size = dict(Z=1, Y=1, X=2) what would you expect as output?
tensor([[[0, 1],
[0, 1],
[0, 2]]])
tensor([[[0, 1],
[0, 1],
[2, 4]]])
tensor([[[0, 1],
[0, 1],
[4, 5]]]) # <--- this one is smaller than the model might expect
tensor([[[0, 1],
[0, 1],
[0, 2]]])
tensor([[[0, 1],
[0, 1],
[2, 4]]])
# <--- But the border of this image won't be represented
tensor([[[0, 1],
[0, 1],
[0, 2]]])
tensor([[[0, 1],
[0, 1],
[2, 4]]])
tensor([[[0, 1],
[0, 1],
[3, 5]]]) # <--- But the img[...,4] will be loaded twice Intuitively I would choose the adapted grid solution. |
Hi @ClementCaporal, thanks for noticing this issue! The reason for missing patches from non-full chunks is highly related to the previous way of computing patch locations based on the chunk size instead of the patch size. Thanks again! |
This is solved by PR #4, where patch size is used as base to compute the sampleable chunks in the input image. |
Related to #3 (Inference Sampler)
The grid created by
zds.PatchSampler
doesn't take into account border of zarr if the zarr.shape is not a multiple of chunk.shapeSmall example:
result:
Is there a reason it doesn't return (or is it a bug?)
The text was updated successfully, but these errors were encountered: