-
Notifications
You must be signed in to change notification settings - Fork 20
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
Uncaught (in promise) TypeError: ml5.flipImage is not a function #163
Comments
Hi @JimmyDevPasto, thank you for submitting this issue! The If you would like to continue using an older library version with support for <script src="https://unpkg.com/[email protected]/dist/ml5.min.js"></script> This should bring back the Below is some info if you decide to try the new version of the library. The new version of the ml5 library handles the mirroring differently. The latest version of the p5.js library has a In the HTML file, set p5 and ml5 to the latest versions: <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.4/p5.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/ml5.min.js"></script> The sketch: let handPose;
let video;
let hands = [];
function preload() {
// Load the handPose model
handPose = ml5.handPose({ flipped: true }); // <----- setting flipped to true
}
function setup() {
createCanvas(640, 480);
// Create the webcam video and hide it
video = createCapture(VIDEO, { flipped: true }); // <----- setting flipped to true
video.size(640, 480);
video.hide();
// start detecting hands from the webcam video
handPose.detectStart(video, gotHands);
}
function draw() {
// Draw the webcam video
image(video, 0, 0, width, height);
// Draw all the tracked hand points
for (let i = 0; i < hands.length; i++) {
let hand = hands[i];
for (let j = 0; j < hand.keypoints.length; j++) {
let keypoint = hand.keypoints[j];
fill(0, 255, 0);
noStroke();
circle(keypoint.x, keypoint.y, 10);
}
}
}
// Callback function for when handPose outputs data
function gotHands(results) {
// save the output to the hands variable
hands = results;
} |
Best regards, this ml5 function does not work, it worked fine a few days ago, something changed in the library, I bought the function from my code
function classifyVideo() { flippedVideo = ml5.flipImage(video); classifier.classify(flippedVideo, gotResult); flippedVideo.remove(); }
the error is: Uncaught (in promise) TypeError: ml5.flipImage is not a function
classifyVideo index.js:136
setup index.js:43
_setup p5.min.js:2
_runIfPreloadsAreDone p5.min.js:2
_decrementPreload p5.min.js:2
registerPreloads/e.prototype.ml5Init/</t[n]/< p5Utils.js:144
promise callbackregisterPreloads/e.prototype.ml5Init/</t[n] p5Utils.js:143
preload index.js:17
_start p5.min.js:2
g p5.min.js:2
[277]</< p5.min.js:2
promise callback[277]< p5.min.js:2
a p5.min.js:2
a p5.min.js:2
[264]< p5.min.js:2
a p5.min.js:2
o p5.min.js:2
p5.min.js:2
p5.min.js:2
p5.min.js:2
The text was updated successfully, but these errors were encountered: