Skip to content
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

questions about get_seg_single #46

Open
cizhenshi opened this issue May 14, 2020 · 1 comment
Open

questions about get_seg_single #46

cizhenshi opened this issue May 14, 2020 · 1 comment

Comments

@cizhenshi
Copy link

HI~I am reading source code of SOLO and I am not sure what strides are in the following code and what role has he taken? I'd appreciate it if you could give me a hint

    # process.
    inds = (cate_preds > cfg.score_thr)
    # category scores.
    cate_scores = cate_preds[inds]
    if len(cate_scores) == 0:
        return None
    # category labels.
    inds = inds.nonzero()
    cate_labels = inds[:, 1]

    # strides.
    size_trans = cate_labels.new_tensor(self.seg_num_grids).pow(2).cumsum(0)
    strides = cate_scores.new_ones(size_trans[-1])
    n_stage = len(self.seg_num_grids)
    strides[:size_trans[0]] *= self.strides[0]
    for ind_ in range(1, n_stage):
        strides[size_trans[ind_ - 1]:size_trans[ind_]] *= self.strides[ind_]
    strides = strides[inds[:, 0]]

    # masks.
    seg_preds = seg_preds[inds[:, 0]]
    seg_masks = seg_preds > cfg.mask_thr
    sum_masks = seg_masks.sum((1, 2)).float()

    # filter.
    keep = sum_masks > strides
    if keep.sum() == 0:
        return None`
@rivercn
Copy link

rivercn commented Aug 30, 2021

we are the same question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants