-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add SSN model. #55
Add SSN model. #55
Conversation
Codecov Report
@@ Coverage Diff @@
## master #55 +/- ##
==========================================
+ Coverage 84.21% 85.08% +0.86%
==========================================
Files 73 75 +2
Lines 4175 4418 +243
Branches 638 674 +36
==========================================
+ Hits 3516 3759 +243
+ Misses 554 549 -5
- Partials 105 110 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
32e4aa2
to
15d853b
Compare
15d853b
to
d3821a2
Compare
mmaction/models/heads/ssn_head.py
Outdated
dim=1) / num_multiplier | ||
if scale_factors is not None: | ||
part_feat = ( | ||
part_feat * scale_factors.view(num_samples, 1)) |
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.
scale_factors[:, 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.
I tried it, but failed, there was an shape error.
assert x.size(1) == self.feat_dim | ||
num_ticks = proposal_ticks.size(0) | ||
|
||
out_activity_scores = torch.zeros((num_ticks, self.activity_score_len), |
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.
zeros_like, so that both the dtype and device are correct
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.
torch.zeors_like() seems not suitable for this case.
mmaction/models/heads/ssn_head.py
Outdated
scale_factor = 1.0 | ||
|
||
sum_parts = sum(stage_cfg) | ||
tick_left = float(ticks[stage_idx]) |
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 it safe to remove float
?
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 it is better to add float to tick_right
. If tick_right
is torch.Tensor(3, dtype=np.int32)
, then torch.arange(tick_left, tick_right+1e-5, num_parts)
will not work.
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.
tick_right+1e-5
-> torch.Tensor(3, dtype=np.int32)
mmaction/models/heads/ssn_head.py
Outdated
raw_scale_score = raw_score.mean( | ||
dim=0) * scale_factor | ||
out_scores[ | ||
index, :] += raw_scale_score.detach().cpu() |
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 it possible to move computations to gpu?
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.
ok, it is in gpu
self.regressor_fc.out_features, | ||
stpp_feat_multiplier, self.activity_fc.in_features).transpose( | ||
0, 1).contiguous().view(-1, self.activity_fc.in_features) | ||
reg_bias = self.regressor_fc.bias.data.view(1, -1).expand( |
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 expand().contiguous() equivalent to repeat() ?
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.
I tried it, but failed, there was an shape error.
3cdfd5c
to
93f260e
Compare
No description provided.