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
efd14a44
Commit
efd14a44
authored
Jun 02, 2022
by
Baumgartner, Michael
Browse files
pt updates
parent
6c286a84
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
nndet/core/boxes/anchors.py
nndet/core/boxes/anchors.py
+2
-2
nndet/core/retina.py
nndet/core/retina.py
+1
-1
No files found.
nndet/core/boxes/anchors.py
View file @
efd14a44
...
...
@@ -146,7 +146,7 @@ class AnchorGenerator2D(torch.nn.Module):
shifts_x
=
torch
.
arange
(
0
,
size0
,
dtype
=
torch
.
float
,
device
=
device
)
*
stride0
shifts_y
=
torch
.
arange
(
0
,
size1
,
dtype
=
torch
.
float
,
device
=
device
)
*
stride1
shift_y
,
shift_x
=
torch
.
meshgrid
(
shifts_y
,
shifts_x
)
shift_y
,
shift_x
=
torch
.
meshgrid
(
shifts_y
,
shifts_x
,
indexing
=
"ij"
)
shift_x
=
shift_x
.
reshape
(
-
1
)
shift_y
=
shift_y
.
reshape
(
-
1
)
shifts
=
torch
.
stack
((
shift_x
,
shift_y
,
shift_x
,
shift_y
),
dim
=
1
)
...
...
@@ -361,7 +361,7 @@ class AnchorGenerator3D(AnchorGenerator2D):
shifts_y
=
torch
.
arange
(
0
,
size1
,
dtype
=
dtype
,
device
=
device
)
*
stride1
shifts_z
=
torch
.
arange
(
0
,
size2
,
dtype
=
dtype
,
device
=
device
)
*
stride2
shift_x
,
shift_y
,
shift_z
=
torch
.
meshgrid
(
shifts_x
,
shifts_y
,
shifts_z
)
shift_x
,
shift_y
,
shift_z
=
torch
.
meshgrid
(
shifts_x
,
shifts_y
,
shifts_z
,
indexing
=
"ij"
)
shift_x
=
shift_x
.
reshape
(
-
1
)
shift_y
=
shift_y
.
reshape
(
-
1
)
shift_z
=
shift_z
.
reshape
(
-
1
)
...
...
nndet/core/retina.py
View file @
efd14a44
...
...
@@ -364,7 +364,7 @@ class BaseRetinaNet(AbstractModel):
keep_idxs
=
probs
>
self
.
score_thresh
probs
,
idx
=
probs
[
keep_idxs
],
idx
[
keep_idxs
]
anchor_idxs
=
idx
//
self
.
num_foreground_classes
anchor_idxs
=
torch
.
div
(
idx
,
self
.
num_foreground_classes
,
rounding_mode
=
"floor"
)
labels
=
idx
%
self
.
num_foreground_classes
boxes
=
boxes
[
anchor_idxs
]
...
...
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