yolact
yolact copied to clipboard
How can i convert the segment output from json file to mark the image?
I got the JSON output file. I found the counts field that is the marking information but its encode to ASCII code string (I think that from eval.py code.). How can I convert the count's field to binary or NumPy type to mark in my image?
This is my sample output.
@beebrain can you tell me how you extracted the output mask polygon coordinates. I just want to extraxt the polygon/contour points of the detected/masked object from the output.
@beebrain
import cv2
import numpy as np
from pycocotools import mask
segmentation= {}
segmentation["counts"] = "gR_>3..."
segmentation["size"] = [1080, 1920]
segmentation= mask.decode(segmentation)
Hi @beebrain
I tried the approach mentioned by @PL-96, but got a blank image as output.
Did it work for you?
I got the JSON output file. I found the counts field that is the marking information but its encode to ASCII code string (I think that from eval.py code.). How can I convert the count's field to binary or NumPy type to mark in my image?
This is my sample output.
hii, how did you get this json file? can you share the code oder others.