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
a9f02204
Commit
a9f02204
authored
Oct 08, 2018
by
Kai Chen
Browse files
rename bbox_ops/mask_ops to bbox/mask
parent
5686a375
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
11 additions
and
8 deletions
+11
-8
mmdet/core/__init__.py
mmdet/core/__init__.py
+2
-2
mmdet/core/anchor/anchor_target.py
mmdet/core/anchor/anchor_target.py
+1
-1
mmdet/core/bbox/__init__.py
mmdet/core/bbox/__init__.py
+0
-0
mmdet/core/bbox/bbox_target.py
mmdet/core/bbox/bbox_target.py
+0
-0
mmdet/core/bbox/geometry.py
mmdet/core/bbox/geometry.py
+0
-0
mmdet/core/bbox/sampling.py
mmdet/core/bbox/sampling.py
+6
-3
mmdet/core/bbox/transforms.py
mmdet/core/bbox/transforms.py
+0
-0
mmdet/core/mask/__init__.py
mmdet/core/mask/__init__.py
+0
-0
mmdet/core/mask/mask_target.py
mmdet/core/mask/mask_target.py
+0
-0
mmdet/core/mask/segms.py
mmdet/core/mask/segms.py
+0
-0
mmdet/core/mask/utils.py
mmdet/core/mask/utils.py
+0
-0
mmdet/core/post_processing/merge_augs.py
mmdet/core/post_processing/merge_augs.py
+1
-1
mmdet/datasets/transforms.py
mmdet/datasets/transforms.py
+1
-1
No files found.
mmdet/core/__init__.py
View file @
a9f02204
from
.anchor
import
*
# noqa: F401, F403
from
.anchor
import
*
# noqa: F401, F403
from
.bbox
_ops
import
*
# noqa: F401, F403
from
.bbox
import
*
# noqa: F401, F403
from
.mask
_ops
import
*
# noqa: F401, F403
from
.mask
import
*
# noqa: F401, F403
from
.losses
import
*
# noqa: F401, F403
from
.losses
import
*
# noqa: F401, F403
from
.eval
import
*
# noqa: F401, F403
from
.eval
import
*
# noqa: F401, F403
from
.parallel
import
*
# noqa: F401, F403
from
.parallel
import
*
# noqa: F401, F403
...
...
mmdet/core/anchor/anchor_target.py
View file @
a9f02204
import
torch
import
torch
from
..bbox
_ops
import
bbox_assign
,
bbox2delta
,
bbox_sampling
from
..bbox
import
bbox_assign
,
bbox2delta
,
bbox_sampling
from
..utils
import
multi_apply
from
..utils
import
multi_apply
...
...
mmdet/core/bbox
_ops
/__init__.py
→
mmdet/core/bbox/__init__.py
View file @
a9f02204
File moved
mmdet/core/bbox
_ops
/bbox_target.py
→
mmdet/core/bbox/bbox_target.py
View file @
a9f02204
File moved
mmdet/core/bbox
_ops
/geometry.py
→
mmdet/core/bbox/geometry.py
View file @
a9f02204
File moved
mmdet/core/bbox
_ops
/sampling.py
→
mmdet/core/bbox/sampling.py
View file @
a9f02204
...
@@ -5,6 +5,11 @@ from .geometry import bbox_overlaps
...
@@ -5,6 +5,11 @@ from .geometry import bbox_overlaps
def
random_choice
(
gallery
,
num
):
def
random_choice
(
gallery
,
num
):
"""Random select some elements from the gallery.
It seems that Pytorch's implementation is slower than numpy so we use numpy
to randperm the indices.
"""
assert
len
(
gallery
)
>=
num
assert
len
(
gallery
)
>=
num
if
isinstance
(
gallery
,
list
):
if
isinstance
(
gallery
,
list
):
gallery
=
np
.
array
(
gallery
)
gallery
=
np
.
array
(
gallery
)
...
@@ -12,9 +17,7 @@ def random_choice(gallery, num):
...
@@ -12,9 +17,7 @@ def random_choice(gallery, num):
np
.
random
.
shuffle
(
cands
)
np
.
random
.
shuffle
(
cands
)
rand_inds
=
cands
[:
num
]
rand_inds
=
cands
[:
num
]
if
not
isinstance
(
gallery
,
np
.
ndarray
):
if
not
isinstance
(
gallery
,
np
.
ndarray
):
rand_inds
=
torch
.
from_numpy
(
rand_inds
).
long
()
rand_inds
=
torch
.
from_numpy
(
rand_inds
).
long
().
to
(
gallery
.
device
)
if
gallery
.
is_cuda
:
rand_inds
=
rand_inds
.
cuda
(
gallery
.
get_device
())
return
gallery
[
rand_inds
]
return
gallery
[
rand_inds
]
...
...
mmdet/core/bbox
_ops
/transforms.py
→
mmdet/core/bbox/transforms.py
View file @
a9f02204
File moved
mmdet/core/mask
_ops
/__init__.py
→
mmdet/core/mask/__init__.py
View file @
a9f02204
File moved
mmdet/core/mask
_ops
/mask_target.py
→
mmdet/core/mask/mask_target.py
View file @
a9f02204
File moved
mmdet/core/mask
_ops
/segms.py
→
mmdet/core/mask/segms.py
View file @
a9f02204
File moved
mmdet/core/mask
_ops
/utils.py
→
mmdet/core/mask/utils.py
View file @
a9f02204
File moved
mmdet/core/post_processing/merge_augs.py
View file @
a9f02204
...
@@ -3,7 +3,7 @@ import torch
...
@@ -3,7 +3,7 @@ import torch
import
numpy
as
np
import
numpy
as
np
from
mmdet.ops
import
nms
from
mmdet.ops
import
nms
from
..bbox
_ops
import
bbox_mapping_back
from
..bbox
import
bbox_mapping_back
def
merge_aug_proposals
(
aug_proposals
,
img_metas
,
rpn_test_cfg
):
def
merge_aug_proposals
(
aug_proposals
,
img_metas
,
rpn_test_cfg
):
...
...
mmdet/datasets/transforms.py
View file @
a9f02204
...
@@ -2,7 +2,7 @@ import mmcv
...
@@ -2,7 +2,7 @@ import mmcv
import
numpy
as
np
import
numpy
as
np
import
torch
import
torch
from
mmdet.core.mask
_ops
import
segms
from
mmdet.core.mask
import
segms
__all__
=
[
__all__
=
[
'ImageTransform'
,
'BboxTransform'
,
'PolyMaskTransform'
,
'Numpy2Tensor'
'ImageTransform'
,
'BboxTransform'
,
'PolyMaskTransform'
,
'Numpy2Tensor'
...
...
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