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

Using ground truth masks instead of the predicted ones #221

Open
goncayilmaz opened this issue Nov 9, 2023 · 0 comments
Open

Using ground truth masks instead of the predicted ones #221

goncayilmaz opened this issue Nov 9, 2023 · 0 comments

Comments

@goncayilmaz
Copy link

goncayilmaz commented Nov 9, 2023

Hello all,

I wanted to try something so I take the maskformer mask_cls_results and instead of using the mask_pred_results, I want to use the ground truth masks. However, the metric is decreasing a lot instead of increasing. Could you tell me what might be wrong?

  mask_cls_results = outputs["pred_logits"] # [4, 100, 150]
  # mask classification target
  gt_instances = [x["instances"].to(self.device) for x in batched_inputs]
  targets = self.prepare_targets(gt_instances, images)
  masks = [x["masks"].unsqueeze(0).to(self.device) for x in targets]
  # print(len(masks)) 4
  # print(masks[0].shape) # [7, 640, 896]
  masks = [torch.cat([x, torch.zeros(1, (100-x.size(1)), x.size(2), x.size(3)).to(self.device)], dim=1) for x in masks]
  mask_pred_results = torch.cat(masks, dim=0)
  # print(mask_pred_results.shape) # [4, 100, 640, 896]

Note: it gives me error if number of instances is not 100

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

1 participant