-
Notifications
You must be signed in to change notification settings - Fork 9.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSD #150
SSD #150
Conversation
configs/ssd300_coco.py
Outdated
ceil_mode=True, | ||
out_indices=(3, 4), | ||
out_feature_indices=(22, 34), | ||
l2_dim=512, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param can be obtained from previous layers.
mmdet/core/anchor/anchor_target.py
Outdated
@@ -13,7 +13,8 @@ def anchor_target(anchor_list, | |||
cfg, | |||
gt_labels_list=None, | |||
cls_out_channels=1, | |||
sampling=True): | |||
sampling=True, | |||
need_unmap=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename need_unmap
to unmap
.
mmdet/datasets/custom.py
Outdated
# if use extra augmentation | ||
if extra_aug is not None: | ||
self.extra_aug = ExtraAugmentation( | ||
img_norm_cfg.mean, img_norm_cfg.to_rgb, **extra_aug) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set mean
, std
and to_rgb
in config files so that we can initialize it with ExtraAugmentation(**extra_aug)
mmdet/datasets/custom.py
Outdated
# extra augmentation | ||
if self.extra_aug is not None: | ||
img, gt_bboxes, gt_labels = self.extra_aug( | ||
img.astype(np.float32), gt_bboxes, gt_labels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call img.astype(np.float32)
inside aug transforms.
mmdet/datasets/custom.py
Outdated
test_mode=False): | ||
test_mode=False, | ||
extra_aug=None, | ||
keep_ratio_rescale=True): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe resize_keep_ratio
sounds better.
mmdet/models/backbones/ssd_vgg.py
Outdated
self.n_dims = n_dims | ||
self.weight = nn.Parameter(torch.Tensor(self.n_dims)) | ||
self.eps = eps | ||
constant_init(self, scale) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to initialize weights outside the init method.
self.anchor_strides = anchor_strides | ||
for k in range(len(anchor_strides)): | ||
base_size = min_sizes[k] | ||
s_k = base_size / 300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard coded number found.
if isinstance(m, nn.Conv2d): | ||
nn.init.xavier_uniform_(m.weight) | ||
if getattr(m, 'bias') is not None: | ||
nn.init.constant_(m.bias, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use xavier_init
instead.
mmdet/datasets/extra_aug.py
Outdated
|
||
class Expand(object): | ||
|
||
def __init__(self, mean=(104, 117, 123), min_ratio=1, max_ratio=4): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set default values to (0, 0, 0)
.
mmdet/datasets/extra_aug.py
Outdated
class ExtraAugmentation(object): | ||
|
||
def __init__(self, | ||
mean=(104, 117, 123), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default value issue.
* unzip return foldername or a tuple of foldernames
No description provided.