Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yaoyuping
nnDetection
Commits
9aaa3f43
Unverified
Commit
9aaa3f43
authored
May 02, 2022
by
Michael Baumgartner
Committed by
GitHub
May 02, 2022
Browse files
Merge pull request #75 from MIC-DKFZ/0001_dataloader
fix index in dataloading when object is larger than patch
parents
33f9a1f4
7c170b80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
nndet/io/datamodule/bg_loader.py
nndet/io/datamodule/bg_loader.py
+1
-1
No files found.
nndet/io/datamodule/bg_loader.py
View file @
9aaa3f43
...
@@ -373,7 +373,7 @@ class DataLoader3DOffset(DataLoader3DFast):
...
@@ -373,7 +373,7 @@ class DataLoader3DOffset(DataLoader3DFast):
elif
box_size
[
i
]
>=
self
.
patch_size_final
[
i
]:
# selected instance is larger than patch
elif
box_size
[
i
]
>=
self
.
patch_size_final
[
i
]:
# selected instance is larger than patch
# we can not offset, we select our center point inside the bounding box and hope for the best
# we can not offset, we select our center point inside the bounding box and hope for the best
center
=
np
.
random
.
randint
(
int
(
box
[
ib
])
+
1
,
int
(
box
[
ib2
]))
center
=
np
.
random
.
randint
(
int
(
box
[
ib
])
+
1
,
int
(
box
[
ib2
]))
origins
.
append
(
center
-
(
self
.
patch_size_generator
[
0
]
//
2
))
origins
.
append
(
center
-
(
self
.
patch_size_generator
[
i
]
//
2
))
else
:
# create best effort offset
else
:
# create best effort offset
patch_upper_bound
=
spatial_shape
[
i
]
-
self
.
patch_size_final
[
i
]
patch_upper_bound
=
spatial_shape
[
i
]
-
self
.
patch_size_final
[
i
]
lower_bound
=
np
.
clip
(
box
[
ib
]
-
(
self
.
patch_size_final
[
i
]
-
box_size
[
i
]),
lower_bound
=
np
.
clip
(
box
[
ib
]
-
(
self
.
patch_size_final
[
i
]
-
box_size
[
i
]),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment