yolact icon indicating copy to clipboard operation
yolact copied to clipboard

How can i convert the segment output from json file to mark the image?

Open beebrain opened this issue 4 years ago • 4 comments

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. image

beebrain avatar Sep 28 '20 00:09 beebrain

@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.

areebsyed avatar Oct 16 '20 08:10 areebsyed

@beebrain

import cv2
import numpy as np
from pycocotools import mask

segmentation= {}
segmentation["counts"] = "gR_>3..."
segmentation["size"] = [1080, 1920]

segmentation= mask.decode(segmentation)

2Fe-vatech avatar Dec 02 '20 04:12 2Fe-vatech

Hi @beebrain

I tried the approach mentioned by @PL-96, but got a blank image as output.

Did it work for you?

piseabhijeet avatar Apr 21 '21 09:04 piseabhijeet

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. image

hii, how did you get this json file? can you share the code oder others.

BinZhou-23 avatar Mar 28 '23 15:03 BinZhou-23