50 idle, winw, winh = helper.startFrame()
53 x, y, w, h = helper.drawInputFrame(
"c", inframe,
False,
False)
54 helper.itext(
'JeVois-Pro Selfie Segmentation')
57 image = inframe.getCvRGBp()
58 iw, ih = image.shape[1], image.shape[0]
67 mask = self.
cmapRGBA[results.segmentation_mask.astype(np.uint8)]
68 helper.drawImage(
"m", mask,
True,
False,
True)
71 fps = self.
timer.stop()
72 helper.iinfo(inframe, fps, winw, winh);
79 """Creates a label colormap used in PASCAL VOC segmentation benchmark.
81 A Colormap for visualizing segmentation results.
83 colormap = np.zeros((256, 4), dtype=int)
84 indices = np.arange(256, dtype=int)
86 for shift
in reversed(range(8)):
87 for channel
in range(3):
88 colormap[:, channel] |= ((indices >> channel) & 1) << shift
91 colormap[:, 3] = alpha
93 return colormap.astype(np.uint8)