Skip to content
Advertisement

Tag: detectron

Converting Detectron2 instance segmentation to opencv Mat array

I am trying to get a binary image from the instance segmentation output performed using Detectron2. According to the official documentation the mask’s output format is the following: “pred_masks”: a Tensor of shape (N, H, W), masks for each detected instance. So i tried converting it to numpy: mask = outputs[“instances”].get(“pred_masks”).numpy() The output was the following: However the data type

Advertisement