qinenergy/cotta

Understanding of the anchor model in semantic segmentation tasks

Closed this issue · 2 comments

I feel that your code and experiment are wrong, \acdc-submission\mmseg\apis\test.py line 106
with torch.no_grad(): result, probs, preds = ema_model(return_loss=False, **data) _, probs_, _ = anchor_model(return_loss=False, **data)
It feels like model prediction should be used here instead of anchor_model.

Hi, please read our code again. The output(results) are from the ema_model. Not from the anchor_model.

The anchor model is used to generate the mask according to equation 4 in the paper.

with torch.no_grad():
  result, probs, preds = ema_model(return_loss=False, **data)
  _, probs_, _ = anchor_model(return_loss=False, **data)  # used for generating mask according to Equation 4
  mask = (probs_[4][0] > 0.69).astype(np.int64) 
  result = [(mask*preds[4][0] + (1.-mask)*result[0]).astype(np.int64)]

Tanks!