Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ml5js/ml5-library
/ functions
Functions
1,175 in github.com/ml5js/ml5-library
⨍
Functions
1,175
◇
Types & classes
88
↓ 65 callers
Function
createCanvas
(w, h)
examples/javascript/YOLO/YOLO_webcam/sketch.js:91
↓ 58 callers
Function
callCallback
(promise, callback)
src/utils/callcallback.js:27
↓ 48 callers
Method
classify
* Assing `value` to a cluster. * @param {array || object} value
src/KMeans/index.js:137
↓ 46 callers
Method
dispose
()
src/KNNClassifier/index.js:168
↓ 23 callers
Method
addData
* addData * @param {Array | Object} xInputs * @param {Array | Object} yInputs * @param {*} options
src/NeuralNetwork/index.js:173
↓ 23 callers
Method
train
* Retrain the model with the provided images and labels using the * models original features as starting point. * @param {function} onProgres
src/FeatureExtractor/Mobilenet.js:267
↓ 21 callers
Method
detect
* .detect() - classifies multiple features by default * @param {*} optionsOrCallback * @param {*} configOrCallback * @param {*} cb
src/FaceApi/index.js:144
↓ 21 callers
Method
generate
* Generate a random result. * @param {String} label - A label of the feature your want to generate * @param {function} callback - A function t
src/CVAE/index.js:54
↓ 21 callers
Method
predict
* Predict the next character based on the model's current state. * @param {number} temp * @param {function} callback - Optional. A function to b
src/CharRNN/index.js:247
↓ 18 callers
Function
loadImage
(imgPath, idx)
examples/javascript/ImageClassification/ImageClassification_MultipleImages/sketch.js:49
↓ 18 callers
Method
normalizeData
* normalizeData * @param {*} _dataRaw * @param {*} _meta
src/NeuralNetwork/index.js:287
↓ 12 callers
Method
infer
(input, endpoint)
src/FeatureExtractor/Mobilenet.js:558
↓ 12 callers
Function
isInstanceOfSupportedElement
(subject)
src/utils/imageUtilities.js:137
↓ 12 callers
Method
load
* Load dataset, find initial centroids, and run model. * @param {string || array || object} dataset
src/KMeans/index.js:77
↓ 12 callers
Method
transfer
* Given an canvas element, applies image-to-image translation using the provided model. Returns an image. * @param {HTMLCanvasElement} inputElement
src/Pix2pix/index.js:46
↓ 11 callers
Function
map
(n, start1, stop1, start2, stop2)
examples/javascript/PitchDetection/PitchDetection_Game/sketch.js:40
↓ 11 callers
Method
segment
(inputOrCallback, cb)
src/UNET/index.js:49
↓ 10 callers
Method
classifySync
* synchronous classify * @param {*} _input
src/NeuralNetwork/index.js:832
↓ 10 callers
Method
speak
(_phrase)
examples/javascript/KNNClassification/KNNClassification_VideoSound/sketch.js:31
↓ 9 callers
Method
checkUndefined
* Check if the given _param is undefined, otherwise return the _default * @param {*} _param * @param {*} _default
src/FaceApi/index.js:355
↓ 8 callers
Method
addExample
* Adding an example to a class. * @param {*} input - An example to add to the dataset, usually an activation from another model. * @param {numbe
src/KNNClassifier/index.js:31
↓ 8 callers
Method
checkP5
* This function will check if the p5 is in the environment * Either it is in the p5Instance mode OR it is in the window * @returns {boolean} if
src/utils/p5Utils.js:49
↓ 8 callers
Method
clearAllLabels
()
src/KNNClassifier/index.js:120
↓ 8 callers
Method
getCountByLabel
* Get the example count for each label. It returns an object that maps class label to example count for each class. * @returns {Number}
src/KNNClassifier/index.js:129
↓ 8 callers
Method
getNumLabels
* It returns the total number of labels. * @returns {String}
src/KNNClassifier/index.js:164
↓ 7 callers
Method
addImage
* Adds a new image element to Mobilenet * @param {HTMLVideoElement || p5.Video || String} inputOrLabel * @param {String || function} labelOrCal
src/FeatureExtractor/Mobilenet.js:190
↓ 7 callers
Function
imgToTensor
(input, size = null)
src/utils/imageUtilities.js:125
↓ 7 callers
Method
reset
* Reset the model state.
src/CharRNN/index.js:211
↓ 6 callers
Method
classify
(img, topk = 3)
src/ImageClassifier/darknet.js:84
↓ 6 callers
Method
clearLabel
* Clear all examples in a label. * @param {number||number} labelIndex - The class index or label, a number or a string.
src/KNNClassifier/index.js:108
↓ 6 callers
Method
convLayer
(input, strides, relu, id)
src/StyleTransfer/index.js:82
↓ 6 callers
Method
dispose
* dispose and release the memory for the model
src/NeuralNetwork/NeuralNetwork.js:280
↓ 6 callers
Function
drawPart
(feature, closed)
examples/p5js/FaceApi/FaceApi_Video_Landmarks/sketch.js:86
↓ 6 callers
Function
drawPart
(feature, closed)
examples/p5js/FaceApi/FaceApi_Video_Landmarks_LocalModels/sketch.js:90
↓ 6 callers
Function
drawPart
(feature, closed)
examples/javascript/FaceApi/FaceApi_Video_Landmarks/sketch.js:91
↓ 6 callers
Function
drawPart
(feature, closed)
examples/javascript/FaceApi/FaceApi_Video_Landmarks_LocalModels/sketch.js:94
↓ 6 callers
Method
getPitch
* Returns the pitch from the model attempting to predict the pitch. * @param {function} callback - Optional. A function to be called when the model
src/PitchDetection/index.js:129
↓ 6 callers
Function
saveBlob
(data, name, type)
src/utils/io.js:8
↓ 5 callers
Function
addClusterButton
(currentClusterCount)
examples/d3/KMeans/KMeans_GaussianClusterDemo/sketch.js:98
↓ 5 callers
Function
addClusterButton
(eps, minPts = 3)
examples/d3/DBSCAN/DBSCAN_Cluster/sketch.js:104
↓ 5 callers
Method
convertToP5Image
* Returns a p5Image * @param {*} tfBrowserPixelImage
src/BodyPix/index.js:85
↓ 5 callers
Method
createNetworkLayers
* add custom layers in options
src/NeuralNetwork/index.js:600
↓ 5 callers
Method
detect
* Detect objects that are in video, returns bounding box, label, and confidence scores * @param {HTMLVideoElement|HTMLImageElement|HTMLCanvasElemen
src/ObjectDetector/YOLO/index.js:96
↓ 5 callers
Method
dispose
* dispose and release memory for a model
src/NeuralNetwork/index.js:1182
↓ 5 callers
Method
mutate
()
examples/p5js/NeuralNetwork/NeuroEvolution_FlappyBird/bird.js:44
↓ 5 callers
Method
normalizeArray
(inputArray, options)
src/NeuralNetwork/NeuralNetworkData.js:387
↓ 5 callers
Method
predict
(inputOrCallback, cb)
src/FeatureExtractor/Mobilenet.js:408
↓ 5 callers
Method
predict
* Will be deprecated soon in favor of ".classify()" - does the same as .classify() * @param {HTMLImageElement | HTMLCanvasElement | object | functi
src/ImageClassifier/index.js:256
↓ 5 callers
Method
residualBlock
(input, id)
src/StyleTransfer/index.js:91
↓ 4 callers
Function
addExample
(label)
examples/p5js/KNNClassification/KNNClassification_VideoSquare/sketch.js:53
↓ 4 callers
Function
addExample
(label)
examples/javascript/KNNClassification/KNNClassification_VideoSquare/sketch.js:61
↓ 4 callers
Function
array3DToImage
(tensor)
src/utils/imageUtilities.js:27
↓ 4 callers
Method
blobToP5Image
* Convert Blob to P5.Image * @param {Blob} blob * Note: may want to reject instead of returning null. * @returns {Promise<p5.Image | null>}
src/utils/p5Utils.js:116
↓ 4 callers
Function
createExampleList
(_example, _sectionDiv, _sectionTitle, _exampleKey)
examples/assets/sketch.js:45
↓ 4 callers
Method
feed
* Feed a string of characters to the model state. * @param {String} inputSeed - A string to feed the charRNN model state. * @param {function} ca
src/CharRNN/index.js:281
↓ 4 callers
Method
formatInputsForPredictionAll
* formatInputsForPredictionAll * @param {*} _input * @param {*} meta * @param {*} inputHeaders
src/NeuralNetwork/index.js:417
↓ 4 callers
Method
getVariableName
(id)
src/StyleTransfer/index.js:164
↓ 4 callers
Method
isAbsoluteURL
(str)
src/DCGAN/index.js:146
↓ 4 callers
Function
mockFunction
src/utils/callcallback_test.js:17
↓ 4 callers
Method
rawToBlob
* convert raw bytes to blob object * @param {number[] | Uint8ClampedArray | ArrayLike<number>} raws * @param {number} width * @param {number}
src/utils/p5Utils.js:93
↓ 4 callers
Method
save
* Download the whole dataset as a JSON file. It's useful for saving state. * @param {String} name - Optional. The name of the JSON file that will b
src/KNNClassifier/index.js:176
↓ 4 callers
Method
segmentWithParts
* Segments the image with partSegmentation * @param {HTMLImageElement | HTMLCanvasElement | object | function | number} optionsOrCallback -
src/BodyPix/index.js:231
↓ 4 callers
Method
show
()
examples/p5js/NeuralNetwork/NeuroEvolution_FlappyBird/pipe.js:26
↓ 3 callers
Function
addExample
(label)
examples/p5js/KNNClassification/KNNClassification_Video/sketch.js:32
↓ 3 callers
Function
addExample
(label)
examples/javascript/KNNClassification/KNNClassification_Video/sketch.js:40
↓ 3 callers
Method
addLayer
* addLayer * @param {*} options
src/NeuralNetwork/index.js:593
↓ 3 callers
Function
classifyVideo
()
examples/javascript/ImageClassification/ImageClassification_VideoScavengerHunt/sketch.js:90
↓ 3 callers
Function
clearLabel
(label)
examples/p5js/KNNClassification/KNNClassification_Video/sketch.js:157
↓ 3 callers
Function
clearLabel
(label)
examples/javascript/KNNClassification/KNNClassification_Video/sketch.js:165
↓ 3 callers
Method
compile
* compile the model * @param {*} _options
src/NeuralNetwork/index.js:753
↓ 3 callers
Method
conv2d
(inputCon, filterCon)
src/Pix2pix/index.js:141
↓ 3 callers
Method
convertToP5Image
(tfBrowserPixelImage)
src/UNET/index.js:87
↓ 3 callers
Method
createMetadata
* create the metadata from the data * this covers: * 1. getting the datatype from the data * 2. getting the min and max from the data *
src/NeuralNetwork/NeuralNetworkData.js:77
↓ 3 callers
Function
createSections
(data)
examples/assets/sketch.js:66
↓ 3 callers
Method
crossover
* create a new neural network with crossover * @param {*} other
src/NeuralNetwork/index.js:1207
↓ 3 callers
Method
detectSingle
* .detecSinglet() - classifies a single feature with higher accuracy * @param {*} optionsOrCallback * @param {*} configOrCallback * @param {*
src/FaceApi/index.js:250
↓ 3 callers
Method
fit
* Run K-Means algorithm.
src/KMeans/index.js:96
↓ 3 callers
Method
formatInputsForPrediction
* format the inputs for prediction * this means applying onehot or normalization * so that the user can use original data units rather * than
src/NeuralNetwork/index.js:388
↓ 3 callers
Function
freqToMidi
(f)
examples/javascript/PitchDetection/PitchDetection_Game/sketch.js:34
↓ 3 callers
Function
getCanvas
()
src/ImageClassifier/index_test.js:33
↓ 3 callers
Function
getImage
()
src/ImageClassifier/index_test.js:23
↓ 3 callers
Function
getReferences
(_examplesRoot, _rootName, _webEditorURL = null)
scripts/update-examples-json.js:31
↓ 3 callers
Function
imageClassifier
(modelName, videoOrOptionsOrCallback, optionsOrCallback, cb)
src/ImageClassifier/index.js:261
↓ 3 callers
Method
loadJSON
* loadJSON * @param {*} _dataUrlOrJson * @param {*} _inputLabelsArray * @param {*} _outputLabelsArray
src/NeuralNetwork/NeuralNetworkData.js:612
↓ 3 callers
Method
loadVideo
* Copies the stream from the source video into a new video element. * The copied element is set to property `this.video` and is also returned by th
src/utils/Video.js:50
↓ 3 callers
Method
prepareForTraining
* Prepare data for training by applying oneHot to raw * @param {*} dataRaw
src/NeuralNetwork/index.js:273
↓ 3 callers
Method
searchAndFormat
* search though the xInputs and format for adding to data.raws * @param {*} input
src/NeuralNetwork/index.js:327
↓ 3 callers
Method
singlePose
(inputOr, cb)
src/PoseNet/index.js:162
↓ 3 callers
Function
transfer
()
examples/p5js/Pix2Pix/Pix2Pix_callback/sketch.js:89
↓ 3 callers
Function
transfer
()
examples/javascript/Pix2Pix/Pix2Pix_callback/sketch.js:131
↓ 3 callers
Method
unnormalizeValue
(value, min, max)
src/NeuralNetwork/NeuralNetworkUtils.js:24
↓ 3 callers
Method
update
()
examples/p5js/NeuralNetwork/NeuroEvolution_FlappyBird/pipe.js:33
↓ 3 callers
Function
updateCounts
()
examples/p5js/KNNClassification/KNNClassification_PoseNet/sketch.js:133
↓ 3 callers
Function
updateCounts
()
examples/p5js/KNNClassification/KNNClassification_VideoSquare/sketch.js:158
↓ 3 callers
Function
updateCounts
()
examples/p5js/KNNClassification/KNNClassification_Video/sketch.js:148
↓ 3 callers
Function
updateCounts
()
examples/javascript/KNNClassification/KNNClassification_PoseNet/sketch.js:145
↓ 3 callers
Function
updateCounts
()
examples/javascript/KNNClassification/KNNClassification_VideoSquare/sketch.js:166
↓ 3 callers
Function
updateCounts
()
examples/javascript/KNNClassification/KNNClassification_Video/sketch.js:156
↓ 2 callers
Method
addDefaultLayers
* addDefaultLayers * @param {*} _task
src/NeuralNetwork/index.js:660
↓ 2 callers
Function
addExample
(label)
examples/p5js/KNNClassification/KNNClassification_PoseNet/sketch.js:49
next →
1–100 of 1,175, ranked by callers