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
ac9cc5e5
Commit
ac9cc5e5
authored
Aug 28, 2021
by
mibaumgartner
Browse files
improved box visualisation
parent
fade0f46
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
scripts/utils.py
scripts/utils.py
+9
-3
No files found.
scripts/utils.py
View file @
ac9cc5e5
...
...
@@ -15,6 +15,9 @@ limitations under the License.
"""
def
boxes2nii
():
"""
Only for visualisation purposes.
"""
import
os
import
argparse
from
pathlib
import
Path
...
...
@@ -87,11 +90,11 @@ def boxes2nii():
prediction_meta
=
{}
for
instance_id
,
(
pbox
,
pscore
,
plabel
)
in
enumerate
(
zip
(
boxes
,
scores
,
labels
),
start
=
1
):
mask_slicing
=
[
slice
(
int
(
pbox
[
0
]),
int
(
pbox
[
2
])),
slice
(
int
(
pbox
[
1
]),
int
(
pbox
[
3
])),
mask_slicing
=
[
slice
(
int
(
pbox
[
0
])
+
1
,
int
(
pbox
[
2
])),
slice
(
int
(
pbox
[
1
])
+
1
,
int
(
pbox
[
3
])),
]
if
instance_mask
.
ndim
==
3
:
mask_slicing
.
append
(
slice
(
int
(
pbox
[
4
]),
int
(
pbox
[
5
])))
mask_slicing
.
append
(
slice
(
int
(
pbox
[
4
])
+
1
,
int
(
pbox
[
5
])))
instance_mask
[
tuple
(
mask_slicing
)]
=
instance_id
prediction_meta
[
int
(
instance_id
)]
=
{
...
...
@@ -112,6 +115,9 @@ def boxes2nii():
def
seg2nii
():
"""
Only for visualisation purposes.
"""
import
os
import
argparse
from
pathlib
import
Path
...
...
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