NameOfFeature
Description
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Quickstart
// Initialize the magicFeature
const magic = ml5.magicFeature('sparkles', modelLoaded);
// When the model is loaded
function modelLoaded() {
console.log('Model Loaded!');
}
// Make some sparkles
magic.makeSparkles(100, (err, results) => {
console.log(results);
});
Usage
Initialize
const magic = ml5.magicFeature(requiredInput, ?optionalInput1, ?optionalInput2);
Parameters
requiredInput: REQUIRED. Notice there is no question mark in front of the input.
optionalInput1: OPTIONAL. Notice the
?
indicates an optional parameter.optionalInput2: OPTIONAL. A description of some kind of object with some properties. Notice the
?
indicates an optional parameter.{
sparkleCount: 100,
delightFactor: 1.0,
party: true,
};
Properties
.property1
String. A description of the property associated with the new model instance.
.property2
Object. A description of the property associated with the new model instance.
.property3
Object. A description of the property associated with the new model instance.
Methods
.makeSparkles()
Given a number, will make magicSparkles
classifier.makeSparkles(?numberOfSparkles, ?callback);
📥 Inputs
- numberOfSparkles: Optional. Number. The number of sparkles you want to return.
- callback: Optional. Function. A function to handle the results of
.makeSparkles()
. Likely a function to do something with the results of makeSparkles.
📤 Outputs
- Object: Returns an array of objects. Each object contains
{something, anotherThing}
.
.makeDisappear()
Given an image, will make objects in the image disappear
classifier.makeDisappear(input, ?numberOfObjects, ?callback);
📥 Inputs
- input: REQUIRED. HTMLImageElement | HTMLVideoElement | ImageData | HTMLCanvasElement. The image or video you want to run the function on.
- numberOfObjects: Optional. Number. The number of objects you want to disappear.
- callback: Optional. Function. A function to handle the results of
.makeDisappear()
. Likely a function to do something with the results of the image where objects have disappeared.
📤 Outputs
- Image: Returns an image.
Examples
p5.js
p5 web editor
plain javascript
Demo
No demos yet - contribute one today!
Tutorials
MagicFeature Tutorial 1 via CodingTrain
MagicFeature Tutorial 2 via CodingTrain
Acknowledgements
Contributors:
- Name 1
- Name 2
Credits:
- Paper Reference | Website URL | Github Repo | Book reference | etc