-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Code Release of ECCV 2020 Spotlight paper for Side-Aware Boundary Localization for More Precise Object Detection #3603
Conversation
Unit tests are missing. |
return decoded_bboxes | ||
|
||
|
||
def generat_buckets(proposals, bucket_num, scale_factor=1.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.
Follow the naming conventions: bucket_num
-> num_buckets
scale_factor (float): Scale factor to rescale proposals. | ||
offset_topk (int): Topk buckets are used to generate \ | ||
bucket fine regression targets. Defaults to 2. | ||
offset_allow (float): Offset allowance to generate \ |
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.
We may consider a more comprehensive variable name.
# generate bucket labels and weight | ||
side_num = int(np.ceil(bucket_num / 2.0)) | ||
labels = torch.cat([ | ||
l_label[:, 0][:, None], r_label[:, 0][:, None], t_label[:, 0][:, None], |
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.
labels = torch.stack([l_label[:, 0], r_label[:, 0], t_label[:, 0], d_label[:, 0]], dim=-1)
self.reg_pos_conv_xs[i].init_weights() | ||
self.reg_pos_conv_ys[i].init_weights() | ||
nn.init.normal_(self.reg_conv_att_x.weight, 0, 0.01) | ||
nn.init.constant_(self.reg_conv_att_x.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 the init methods in mmcv.cnn
self.reg_pre_convs[i].init_weights() | ||
for i in range(self.reg_pos_num): | ||
self.reg_pos_conv_xs[i].init_weights() | ||
self.reg_pos_conv_ys[i].init_weights() |
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.
ConvModules are initialized during construction by default.
reg_fy = (reg_fy * reg_fy_att).sum(dim=3) | ||
return reg_fx, reg_fy | ||
|
||
def direction_feature_extractor(self, reg_x): |
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 terms that are consistent with the paper.
reg_fy = torch.transpose(reg_fy, 1, 2) | ||
return reg_fx.contiguous(), reg_fy.contiguous() | ||
|
||
def reg_pred(self, x, offfset_fcs, cls_fcs): |
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.
Docstring.
bucket_offset_targets, bucket_offset_weights) | ||
|
||
def _bucket_target_single(self, pos_proposals, neg_proposals, | ||
pos_gt_bboxes, pos_gt_labels, cfg): |
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.
Docstring.
Codecov Report
@@ Coverage Diff @@
## master #3603 +/- ##
==========================================
- Coverage 61.31% 61.14% -0.18%
==========================================
Files 213 216 +3
Lines 14531 15187 +656
Branches 2441 2520 +79
==========================================
+ Hits 8910 9286 +376
- Misses 5177 5442 +265
- Partials 444 459 +15
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Args: | ||
num_buckets (int): Number of buckets. | ||
scale_factor (int): Scale factor of proposals to generate buckets. | ||
offset_topk (int): Topk buckets are used to generate \ |
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.
'\' is unnecessary here in arguments, we can remove them for simplicity.
self.cls_ignore_neighbor = cls_ignore_neighbor | ||
|
||
def encode(self, bboxes, gt_bboxes): | ||
"""Get bucketing estimation and fine regression targets during |
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 use standard docstrings here rather than a simple line.
return bucket_w, bucket_h, l_buckets, r_buckets, t_buckets, d_buckets | ||
|
||
|
||
def label2onehot(labels, num_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.
F.one_hot
reg_post_kernel=3, | ||
reg_pre_num=2, | ||
reg_post_num=1, | ||
num_classes=80, |
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.
Make num_classes
positional.
No description provided.