You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Hi @JimmyDevPasto, thank you for submitting this issue! The flipImage function is no longer supported in the newest version of ml5.
If you would like to continue using an older library version with support for flipImage, try version 0.12.2. In the HTML file, change the version number of ml5 in the script tag from 1.0.1 or latest to 0.12.2. The script tag should be changed to something like this:
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 flipped option for videos, which automatically flips a video when it is displayed. The new ml5 models also have a flipped option when applicable, setting it to true will horizontally mirror the output landmarks/masks. Setting both options to true will correctly mirror both the video and the prediction output. Below is an example with handPose model.
In the HTML file, set p5 and ml5 to the latest versions:
lethandPose;letvideo;lethands=[];functionpreload(){// Load the handPose modelhandPose=ml5.handPose({flipped: true});// <----- setting flipped to true}functionsetup(){createCanvas(640,480);// Create the webcam video and hide itvideo=createCapture(VIDEO,{flipped: true});// <----- setting flipped to truevideo.size(640,480);video.hide();// start detecting hands from the webcam videohandPose.detectStart(video,gotHands);}functiondraw(){// Draw the webcam videoimage(video,0,0,width,height);// Draw all the tracked hand pointsfor(leti=0;i<hands.length;i++){lethand=hands[i];for(letj=0;j<hand.keypoints.length;j++){letkeypoint=hand.keypoints[j];fill(0,255,0);noStroke();circle(keypoint.x,keypoint.y,10);}}}// Callback function for when handPose outputs datafunctiongotHands(results){// save the output to the hands variablehands=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: