Skip to content
Advertisement

Tag: data-conversion

Python convert switch data (text) to dict

I have the following data, which I recieve via a ssh session to a switch. I wish to convert the input which is text to a dict for easy access and the possiblity to monitor certain values. I cannot get the data extracted without a ton of splits and regexes and still get stuck. Which I want to convert to:

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