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
4adbed5d
Commit
4adbed5d
authored
Aug 19, 2021
by
mibaumgartner
Browse files
instances_to_boxes 2d support
parent
ea565ddd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
nndet/io/transforms/instances.py
nndet/io/transforms/instances.py
+2
-2
No files found.
nndet/io/transforms/instances.py
View file @
4adbed5d
...
@@ -120,8 +120,8 @@ def instances_to_boxes(seg: Tensor,
...
@@ -120,8 +120,8 @@ def instances_to_boxes(seg: Tensor,
for
_idx
in
instances
:
for
_idx
in
instances
:
instance_idx
=
(
_seg
==
_idx
).
nonzero
(
as_tuple
=
False
)
instance_idx
=
(
_seg
==
_idx
).
nonzero
(
as_tuple
=
False
)
_mins
=
instance_idx
[:,
-
3
:].
min
(
dim
=
0
)[
0
]
_mins
=
instance_idx
[:,
-
dim
:].
min
(
dim
=
0
)[
0
]
_maxs
=
instance_idx
[:,
-
3
:].
max
(
dim
=
0
)[
0
]
_maxs
=
instance_idx
[:,
-
dim
:].
max
(
dim
=
0
)[
0
]
box
=
[
_mins
[
-
dim
]
-
1
,
_mins
[(
-
dim
)
+
1
]
-
1
,
_maxs
[
-
dim
]
+
1
,
_maxs
[(
-
dim
)
+
1
]
+
1
]
box
=
[
_mins
[
-
dim
]
-
1
,
_mins
[(
-
dim
)
+
1
]
-
1
,
_maxs
[
-
dim
]
+
1
,
_maxs
[(
-
dim
)
+
1
]
+
1
]
if
dim
>
2
:
if
dim
>
2
:
...
...
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