Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Lower boundary of clipping needs to be -1 #23

Open
JiaminRen opened this issue Aug 15, 2021 · 3 comments
Open

[Bug] Lower boundary of clipping needs to be -1 #23

JiaminRen opened this issue Aug 15, 2021 · 3 comments
Labels
fix with next release Will be fixed after the next release

Comments

@JiaminRen
Copy link

馃拃 Bug

Environment

Please provide some information about the used environment.

How was nnDetection installed [docker | source]:

Environment Information:

[paste here]

If necessary, please provide the used run command with all overwrites:

[paste here]
@JiaminRen
Copy link
Author

box = [_mins[-dim] - 1, _mins[(-dim) + 1] - 1, _maxs[-dim] + 1, _maxs[(-dim) + 1] + 1]

Plus one and minus one may exceed the image boundary.

@mibaumgartner
Copy link
Collaborator

Hi @JiaminRen ,

the transformation intends to provide a generic bounding box representation and no special handling of image borders is done here on purpose, i.e. if the object starts at index 0 of the image, the network is expected to output a bounding box starting at -1 (the same principle applies to the other image borders as well).

Clipping to 0 would introduce an ambiguity because objects starting at index 1 and at index 0 would be mapped to a bounding box starting at 0. Removing +-1 is also difficult since this could lead to objects with 0 sizes. As a result, we used the above rule without clipping or any other modification.

There is an inconsistency in the detection postprocessing which I'll fix after the first release was tagged. The detection network outputs are currently clipped at 0 during inference, which needs to be corrected to -1. The performance difference should be rather small though.

(the corresponding line of code for the 3D case)

boxes[..., 0::6].clamp_(min=0, max=s0)
boxes[..., 1::6].clamp_(min=0, max=s1)
boxes[..., 2::6].clamp_(min=0, max=s0)
boxes[..., 3::6].clamp_(min=0, max=s1)
boxes[..., 4::6].clamp_(min=0, max=s2)
boxes[..., 5::6].clamp_(min=0, max=s2)

Best,
Michael

@mibaumgartner mibaumgartner added the fix with next release Will be fixed after the next release label Aug 15, 2021
@mibaumgartner mibaumgartner changed the title [Bug]https://github.com/MIC-DKFZ/nnDetection/blob/3416b80cc90346349951dcc805b260f72b80fc16/nndet/io/transforms/instances.py#L126 [Bug] Lower boundary of clipping needs to be -1 Aug 15, 2021
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale Issue without activity, will be closed soon label Jan 11, 2024
@mibaumgartner mibaumgartner removed the stale Issue without activity, will be closed soon label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix with next release Will be fixed after the next release
Projects
None yet
Development

No branches or pull requests

2 participants