Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

170
Views
MediaPipe Selfie Segmentation results are not invoking when moved to other Chrome tabs
const videoElement =document.getElementsByClassName('input_video')[0];
selfieSegmentationObj = new SelfieSegmentation({locateFile: (file) => {
    return `https://cdn.jsdelivr.net/npm/@mediapipe/selfie_segmentation/${file}`;
    }});
selfieSegmentationObj.setOptions({
    modelSelection: 1,
    selfieMode: false,
    effect: 'mask',
});

selfieSegmentationObj.onResults(selfieSegmentationResults);

cameraObj = new Camera(videoElement, {
    onFrame: async () => {
    await selfieSegmentationObj.send({image: videoElement});
    },
    width: 1280,
    height: 720
});

cameraObj.start();


function selfieSegmentationResults(results) {
    const canvasElement = document.getElementsByClassName('output_canvas')[0];
    var canvasCtx = canvasElement.getContext('2d');
    canvasCtx.clearRect(0, 0, canvasElement.width, canvasElement.height);
    canvasCtx.save();
    canvasCtx.drawImage(results.segmentationMask, 0, 0, canvasElement.width, canvasElement.height);
}

When we moved from one tab to another tab then callback function "selfieSegmentationResults" is not getting called from the SelfieSegmentation object.

Please, someone, help if there is any other solution that can get the segmented image data even if we moved to another Chrome tab.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!