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
ModelZoo
SOLOv2-pytorch
Commits
9acb38be
"vscode:/vscode.git/clone" did not exist on "77e0c654e914ddb303d4f5671886aa13f84ca498"
Commit
9acb38be
authored
Jan 15, 2019
by
yhcao6
Browse files
expose dcn extension interfaces
parent
6bd60eac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
7 deletions
+27
-7
mmdet/ops/__init__.py
mmdet/ops/__init__.py
+9
-1
mmdet/ops/dcn/__init__.py
mmdet/ops/dcn/__init__.py
+13
-0
mmdet/ops/dcn/modules/deform_conv.py
mmdet/ops/dcn/modules/deform_conv.py
+1
-2
mmdet/ops/dcn/modules/modulated_dcn.py
mmdet/ops/dcn/modules/modulated_dcn.py
+2
-2
mmdet/ops/dcn/setup.py
mmdet/ops/dcn/setup.py
+2
-2
No files found.
mmdet/ops/__init__.py
View file @
9acb38be
from
.dcn
import
(
DeformConv
,
DeformRoIPooling
,
ModulatedDeformRoIPoolingPack
,
ModulatedDeformConv
,
ModulatedDeformConvPack
,
deform_conv
,
modulated_deform_conv
,
deform_roi_pooling
)
from
.nms
import
nms
,
soft_nms
from
.roi_align
import
RoIAlign
,
roi_align
from
.roi_pool
import
RoIPool
,
roi_pool
__all__
=
[
'nms'
,
'soft_nms'
,
'RoIAlign'
,
'roi_align'
,
'RoIPool'
,
'roi_pool'
]
__all__
=
[
'nms'
,
'soft_nms'
,
'RoIAlign'
,
'roi_align'
,
'RoIPool'
,
'roi_pool'
,
'DeformConv'
,
'DeformRoIPooling'
,
'ModulatedDeformRoIPoolingPack'
,
'ModulatedDeformConv'
,
'ModulatedDeformConvPack'
,
'deform_conv'
,
'modulated_deform_conv'
,
'deform_roi_pooling'
]
mmdet/ops/dcn/__init__.py
0 → 100644
View file @
9acb38be
from
.functions
import
deform_conv
from
.functions.modulated_dcn_func
import
(
modulated_deform_conv
,
deform_roi_pooling
)
from
.modules.deform_conv
import
DeformConv
from
.modules.modulated_dcn
import
(
DeformRoIPooling
,
ModulatedDeformRoIPoolingPack
,
ModulatedDeformConv
,
ModulatedDeformConvPack
)
__all__
=
[
'DeformConv'
,
'DeformRoIPooling'
,
'ModulatedDeformRoIPoolingPack'
,
'ModulatedDeformConv'
,
'ModulatedDeformConvPack'
,
'deform_conv'
,
'modulated_deform_conv'
,
'deform_roi_pooling'
]
mmdet/ops/dcn/modules/deform_conv.py
View file @
9acb38be
...
...
@@ -2,7 +2,6 @@ import math
import
torch
import
torch.nn
as
nn
from
mmcv.cnn
import
uniform_init
from
torch.nn.modules.module
import
Module
from
torch.nn.modules.utils
import
_pair
...
...
@@ -38,7 +37,7 @@ class DeformConv(Module):
for
k
in
self
.
kernel_size
:
n
*=
k
stdv
=
1.
/
math
.
sqrt
(
n
)
uniform_init
(
self
,
-
stdv
,
stdv
)
self
.
weight
.
data
.
uniform_
(
-
stdv
,
stdv
)
def
forward
(
self
,
input
,
offset
):
return
deform_conv
(
input
,
offset
,
self
.
weight
,
self
.
stride
,
...
...
mmdet/ops/dcn/modules/modulated_dcn.py
View file @
9acb38be
...
...
@@ -6,7 +6,6 @@ from __future__ import print_function
import
math
import
torch
from
mmcv.cnn
import
uniform_init
from
torch
import
nn
from
torch.nn.modules.utils
import
_pair
...
...
@@ -47,7 +46,8 @@ class ModulatedDeformConv(nn.Module):
for
k
in
self
.
kernel_size
:
n
*=
k
stdv
=
1.
/
math
.
sqrt
(
n
)
uniform_init
(
self
,
-
stdv
,
stdv
)
self
.
weight
.
data
.
uniform_
(
-
stdv
,
stdv
)
self
.
bias
.
data
.
zero_
()
def
forward
(
self
,
input
,
offset
,
mask
):
return
modulated_deform_conv
(
input
,
offset
,
mask
,
self
.
weight
,
...
...
mmdet/ops/dcn/setup.py
View file @
9acb38be
...
...
@@ -2,9 +2,9 @@ from setuptools import setup
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
setup
(
name
=
'deform_conv'
,
name
=
'deform_conv
_cuda
'
,
ext_modules
=
[
CUDAExtension
(
'deform_conv'
,
[
CUDAExtension
(
'deform_conv
_cuda
'
,
[
'src/deform_conv_cuda.cpp'
,
'src/deform_conv_cuda_kernel.cu'
,
]),
...
...
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