aim-uofa / AdelaiDet

AdelaiDet is an open source toolbox for multiple instance-level detection and recognition tasks.
https://git.io/AdelaiDet
Other
3.39k stars 652 forks source link

Question about CondInst #137

Open lucasjinreal opened 4 years ago

lucasjinreal commented 4 years ago

From the paper it shows CondInst using FCOS output directly feed into mask head generate mask. While looking into the code, it still using proposals (which compute every coodinates of boxes) then feed into mask head for predict mask.

def _forward_mask_heads_train(self, proposals, mask_feats, gt_instances):
        # prepare the inputs for mask heads
        pred_instances = proposals["instances"]

        if 0 <= self.max_proposals < len(pred_instances):
            inds = torch.randperm(len(pred_instances), device=mask_feats.device).long()
            logger.info("clipping proposals from {} to {}".format(
                len(pred_instances), self.max_proposals
            ))
            pred_instances = pred_instances[inds[:self.max_proposals]]

        pred_instances.mask_head_params = pred_instances.top_feats

        loss_mask = self.mask_head(
            mask_feats, self.mask_branch.out_stride,
            pred_instances, gt_instances
        )

my question is, if using features directly from FCOS outputs, why it necessary wrap it into Instance object which is a list of bboxes?

lucasjinreal commented 4 years ago

Just saw this: image

In this case, how to disable detector in code avoid compute precise cooridinates of every ROI?

tianzhi0549 commented 4 years ago

@jinfagang the mask head does not use the boxes in the Instances. We use Instances here just for the simplicity of implementation.

lucasjinreal commented 4 years ago

@tianzhi0549 I see.. does it need retrain the model if open DISABLE_REL_COORDS on?

tianzhi0549 commented 4 years ago

Yes, because the number of generated parameters is changed.

lucasjinreal commented 4 years ago

@tianzhi0549 Does there any model provided with disable boxes? Hoping to see the model performance without detector for instance segmentation task.

tianzhi0549 commented 4 years ago

@tianzhi0549 The results are reported in Table 3 of our paper. We do not have the model for this implementation.

lucasjinreal commented 4 years ago

@tianzhi0549 Will u consider update such a model? I think just resnet50 is enough for comparasion. Also, I have one last question, even it can be disable in:

if not self.disable_rel_coords:

It still need a value of:

mask_head_inputs = mask_feats[im_inds].reshape(n_inst, self.in_channels, H * W)  <- how to get n_inst if not compute boxes?

It would be great if you guys can provide just one model without detector!

tianzhi0549 commented 4 years ago

@jinfagang 1) Sorry, we do not have such a plan. 2) The number of instances will be the number of positive locations determined by the classification branch.