I am using @tensorflow-models/body-segmentation and the contour colour always defaults to rgb(0,255,255). I’m using the toBinaryMask function to segment people from their background and I want the contour to be rgb(0,0,0).
Here is the code I’m using. I can toggle whether the contour is visible or not via “drawContour” but not the colour. Would it be possible to change the colour after the functions are run from the ImageData? Any ideas are welcome.
const foregroundColor = { r: 255, g: 255, b: 255, a: 255 };
const backgroundColor = { r: 205, g: 205, b: 205, a: 0 };
const drawContour = true;
const foregroundThreshold = 0.2;
const opacity = 1;
const maskBlurAmount = 0;
const flipHorizontal = false;
const backgroundDarkeningMask = await bodySegmentation.toBinaryMask(
segmentations,
foregroundColor,
backgroundColor,
drawContour,
foregroundThreshold
);
await bodySegmentation.drawMask(
outputCanvas,
img,
backgroundDarkeningMask,
opacity,
maskBlurAmount,
flipHorizontal
);
I tried editing the package where the contour colour is handled using patch-package and nothing changed at all.