Questions tagged [ml5.js]

ML5 is a Javascript Machine Learning library built on top of Tensorflow.js

55 questions
3
votes
1 answer

How to let Pix2Pix with p5.js run?

I would like to try the ml5.js Pix2Pix example for p5.js. If I just copy the code, update the paths, and try to let it run on my local server, it doesn't work. Same here: // Copyright (c) 2019 ml5 // // This software is released under the MIT…
Anna_B
  • 820
  • 1
  • 4
  • 23
3
votes
1 answer

How to convert tensorflow.js model weights to pytorch tensors, and back?

I am using ml5.js, a wrapper around tensorflowjs. I want to train a neural network in the browser, download the weights, process them as tensors in pyTorch, and load them back into the browser's tensorflowjs model. How do I convert between these…
hazrmard
  • 3,397
  • 4
  • 22
  • 36
2
votes
1 answer

working on the coding train's cocossd tutorial, I cannot seem to find a way to get the squares around the detected things

working on the coding train's cocossd tutorial, I cannot seem to find a way to get the squares around the detected things. Here is the js code: let img; let detector; function preload() { img = loadImage("images/penguin.jpg"); detector =…
2
votes
1 answer

import a local model trained

I am in the process of carrying out a small project to learn the alphabet in sign language (and learn p5.js and ml5.js). I got an already trained model that I want to import into my project. The model was in .h5 and I converted it with this…
Dév05
  • 23
  • 3
2
votes
1 answer

Is it possible to hide the video in ml5.js but keep the hand pose points?

I am trying to hide the video (webcam in this case) but keep the detected points of the hand. I have tried different methods, but I am unsuccessful so far. I appreciate the help. Main code (below) from ml5.js can be found and tested live here: …
ibib
  • 109
  • 5
2
votes
0 answers

Export model as ".pict"

I need to export a model in .pict format from TensorFlow to use it in ml5.js. I can export it in h5 format but I don't know how to translate it to .pict. How can I do it?
2
votes
2 answers

useRef: state becomes undefined after rendering

I'm using ml5.js to train an ML model. I have to add images to the model using the webcam. The train function works fine with the current code. However, when I try to set a state within my if else statement inside the train function, it throws an…
user13067694
2
votes
0 answers

Uncaught (in promise) Error: Input 0 is incompatible with layer lstm_LSTM1: expected ndim=3, found ndim=2

Here's the code: var options = { task: "regression", debug: true, inputs: ["date"], outputs: ["price"], optimizer: "adam", loss: "meanSquaredError", layers: [ { type: 'dense', …
Alex
  • 163
  • 2
  • 15
1
vote
1 answer

How can I number a point list in p5.js

is it possible to number a list of points in p5.js? Right now I am using ml5.pj for face mesh detections, which outputs x and y coordinates for a set of 465 points. I want to select a few. In order to do that, I need to know what are the…
ibib
  • 109
  • 5
1
vote
0 answers

Track multiple shapes using JavaScript Object Detection

How can I track 2 to 3 objects(shapes: circle, square, triangle, etc.) on a webcam feed using JavaScript? It needs to be able to tell me the coordinates and sizes of appearing shapes/objects Is there a pre-trained ml5 model to do it or any teachable…
Md Shuvo
  • 69
  • 1
  • 9
1
vote
2 answers

value becomes undefined because of setState

I am using p5 and ml5.js to train an ML model by adding some images via my webcam. The train function works fine like this. However, if I uncomment the if statement within the train function: if (lossValue == null) the value of classifier because…
user13067694
1
vote
0 answers

Have a problem training simple neural network using ml5js

I'm trying to make some simple nn using ml5js. I have a bunch of data in json format, 16 inputs (numbers from 0 to 15), and 1 output (numbers from 1 to 4) https://raw.githubusercontent.com/dphdmn/aiTest/main/9473_moves_data.json Then i am making a…
1
vote
0 answers

Using p5 and ml5 in React

I'm trying to get a pitch detection feature working in my react application using ml5 and p5. I believe the ml5 code that I'm using here connects to the CREPE pitch recognition model. When I try to compile the component that contains my code I am…
leolibra
  • 11
  • 2
1
vote
1 answer

In ml5 pitch detection using crepe model, how to detect pitch above ±2kHz

I'm successfully using pitch detection features of ml5: tutorial: https://ml5js.org/reference/api-PitchDetection/ model: https://cdn.jsdelivr.net/gh/ml5js/ml5-data-and-models/models/pitch-detection/crepe/ The issue: No pitch above ±2000Hz is…
1
vote
1 answer

WebpackError: TypeError: p5__WEBPACK_IMPORTED_MODULE_4___default.a is not a constructor

This server is running fine in develop mode but throws an error during production build I'm using Gatsby.js Framework and currently, my codes are deployed on netlify server. Here is my gatsby-node.js config file: exports.onCreateWebpackConfig = ({…
Debajit
  • 27
  • 7
1
2 3 4