How to use the @tensorflow-models/body-pix.PART_CHANNELS function in @tensorflow-models/body-pix

To help you get started, we’ve selected a few @tensorflow-models/body-pix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tensorflow / tfjs-models / body-pix / demos / index.js View on Github external
function setShownPartColorScales(colorScale) {
  const colors = document.getElementById('colors');
  colors.innerHTML = '';

  const partColors = partColorScales[colorScale];
  const partNames = bodyPix.PART_CHANNELS;

  for (let i = 0; i < partColors.length; i++) {
    const partColor = partColors[i];
    const child = document.createElement('li');

    child.innerHTML = `
        <div style="background-color:rgb(${partColor[0]},${
        partColor[1]},${partColor[2]})" class="color"></div>
        ${partNames[i]}`;

    colors.appendChild(child);
  }
}