I use detectron2 to run semantic segmentation on images. Detectron2 has a prebuilt function for visualizing the results. I am interested in saving the results of the segmentation and parsing them when needed. Hence I backtracked the code and found instances_to_coco_json function to be the one outputting the results of segmentation. I tried saving the results.
The result is in the following format:
{
"image_id": 1,
"segmentation": {
"counts": "R[W<=Sf0001O000000000000000000000000000000000000000^_\\?",
"size": [
720,
1280
]
},
"category_id": 1,
"score": 0.992115
},
I was expecting to get the segmentation results as coordinates of the segmentation points like the following:
"segmentation": [
[
662.1764705882352,
387,
686,
386.5882352941176,
686,
398,
662.7647058823529,
399
]
Given the output is in the coco format, how do I make sense of it?