Hi,
There is a function to draw binary mask, but there is no function to draw mask on the colored image. How to draw mask on the original input color image?
output = predictor(input_image)
V = Visualizer(input_image[:, :, ::-1],
MetadataCatalog.get(cfg.DATASETS.TRAIN[0]), scale = 1.2)
mask=output["instances"].get("pred_masks")
mask=mask.to("cpu")
V.draw_instance_predictions(output["instances"].to("cpu"))
for m in mask:
V.draw_mask(m) # there is no function to draw colored mask
V = V.get_output()
cv2.imwrite("frame%d.jpg" % count, V.get_image()[:, :, ::-1])
Thank you