Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BodySegmentation errors when flipped option is set to true #235

Open
1 task done
ziyuan-linn opened this issue Dec 5, 2024 · 0 comments
Open
1 task done

BodySegmentation errors when flipped option is set to true #235

ziyuan-linn opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ziyuan-linn
Copy link
Member

ziyuan-linn commented Dec 5, 2024

Issue Type

Broken API/Method

ml5.js Version

1.2.0 and 1.2.1

Development Environment

p5.js Web Editor

Browser & Operating System

Chrome 131.0.6778.108 on Windows 11

Issue Description

Screenshot 2024-12-04 231919

It is expected that the BodySegmentation starts outputting flipped masks without any error. However no masks predicted and the error in the above screenshot is produced.

Minimal Reproducible Example

// This is the same code from ml5 example sketch
// I just added flipped = true
let bodySegmentation;
let video;
let segmentation;

let options = {
  maskType: "person",
  flipped: true
};

function preload() {
  bodySegmentation = ml5.bodySegmentation("SelfieSegmentation", options);
}

function setup() {
  createCanvas(640, 480);
  // Create the video
  video = createCapture(VIDEO);
  video.size(640, 480);
  video.hide();

  bodySegmentation.detectStart(video, gotResults);
}

function draw() {
  background(0, 255, 0);

  if (segmentation) {
    video.mask(segmentation.mask);
    image(video, 0, 0);
  }
}

// callback function for body segmentation
function gotResults(result) {
  segmentation = result;
}

Thank you @demizhou8 for surfacing this bug!

Code of Conduct

  • I agree to follow this project's Code of Conduct
@ziyuan-linn ziyuan-linn added the bug Something isn't working label Dec 5, 2024
@ziyuan-linn ziyuan-linn self-assigned this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant