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

[Bug Fix] Call uNet segmentation only after video has loaded #1418

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattelim
Copy link

Dear ml5 community,

I'm making a Pull Request(PR). Please see the details below.

A good PR 🌟

β†’ Step 1: Describe your Pull Request πŸ“

Fixing a Bug? Adding an Update? Submitting a New Feature? Does it introduce a breaking change?

This is small bug fix for the UNET example. The sketch previously had unstable results as the uNet segmentation function may be called before the video has loaded. The tweak moves the segmentation into a callback function videoReady of the video capture function.
video = createCapture(VIDEO, videoReady);
This pattern is copied from the BodyPix example (https://editor.p5js.org/ml5/sketches/BodyPix_Webcam).

A great PR 🌟🌟

β†’ Step 2: Share a Relevant Example πŸ¦„

Here's some example code or a demonstration of my feature as a part of this pull request, a separate pull request, in the https://editor.p5js.org, or codepen/jsfiddle/etc...

Please see the live example on p5 editor:
https://editor.p5js.org/mattelim/sketches/dhNEo78-x

The best PR 🌟🌟🌟

β†’ Step 3: Screenshots or Relevant Documentation πŸ–Ό

Here's some helpful screenshots and/or documentation of the new feature

Previous:
Screen Shot 2022-06-21 at 18 30 30

Now:
Screen Shot 2022-06-21 at 18 34 18

The previous code did not use a callback function for uNet segmentation to occur after video has loaded.
This pattern is copied from the BodyPix example.
@amcc
Copy link

amcc commented Nov 16, 2022

I've also seen this issue very recently - this PR seems a good one to merge asap - seems a sensible fix to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants