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
6c286a84
Commit
6c286a84
authored
Jun 02, 2022
by
Baumgartner, Michael
Browse files
remove sorting
parent
cbfdb1d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
nndet/io/transforms/instances.py
nndet/io/transforms/instances.py
+4
-4
No files found.
nndet/io/transforms/instances.py
View file @
6c286a84
...
@@ -190,8 +190,8 @@ def get_instance_class_from_properties(
...
@@ -190,8 +190,8 @@ def get_instance_class_from_properties(
Returns:
Returns:
Tensor: extracted instance classes
Tensor: extracted instance classes
"""
"""
instance_idx
,
_
=
instance_idx
.
sort
()
_map_dict
=
{
int
(
k
):
int
(
i
)
for
k
,
i
in
map_dict
.
items
()
}
classes
=
[
int
(
map_dict
[
str
(
int
(
idx
.
detach
().
item
())
)
])
for
idx
in
instance_idx
]
classes
=
[
int
(
_
map_dict
[
int
(
idx
.
detach
().
item
())])
for
idx
in
instance_idx
]
return
torch
.
tensor
(
classes
,
device
=
instance_idx
.
device
)
return
torch
.
tensor
(
classes
,
device
=
instance_idx
.
device
)
...
@@ -207,8 +207,8 @@ def get_instance_class_from_properties_seq(
...
@@ -207,8 +207,8 @@ def get_instance_class_from_properties_seq(
Returns:
Returns:
Sequence[int]: extracted instance classes
Sequence[int]: extracted instance classes
"""
"""
instance_idx
=
sorted
(
instance_idx
)
_map_dict
=
{
int
(
k
):
int
(
i
)
for
k
,
i
in
map_dict
.
items
()}
classes
=
[
int
(
map_dict
[
str
(
int
(
idx
)
)
])
for
idx
in
instance_idx
]
classes
=
[
int
(
_
map_dict
[
int
(
idx
)])
for
idx
in
instance_idx
]
return
classes
return
classes
...
...
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