Skip to content
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

Support Promises for imageClassifier #151

Merged
merged 30 commits into from
Jul 19, 2018

Conversation

tmcw
Copy link
Contributor

@tmcw tmcw commented Jun 13, 2018

This includes:

  • The return values of imageClassifier() and ImageClassifier.predict()
    are now promises.
  • Uncomments, updates, and implements tests for ImageClassifier

The changes

ml5 classes have traditional constructors but many of them have asynchronous 'loading' requirements and then synchronous methods. ES6 class constructors can't be async methods (you can't say await new Foo()), so this does the following:

  • All classes that need some async setup phase have a ready property that is a Promise that is resolved when they're ready
  • The 'factory functions' that people use to get instances of those classes (like the imageClassifier class for ImageClassifier) have two behaviors:
    • The user provides a callback and they return the class instance
    • The user does not provide a callback and they return the class instance's 'ready' property, which is a promise that resolves to that class instance once it's ready.

So:

// callbacks
var ifier = imageClassifier('MobileNet', undefined, {}, onReady);
function onReady() {
  // do stuff with ifier
}

// promises
imageClassifier('MobileNet', undefined, {}).then(iffier => {
  // do stuff with iffier
});

// async/await syntax
async function run() {
  let iffier = await imageClassifier('MobileNet', undefined, {});
  // do stuff with iffier
}

Other changes

  • Implements tests for everything that's testable!
    • This doesn't include ImageClassifier. The @tf-models/mobilenet module that powers ImageClassifier doesn't run in the karma/webpack environment for reasons I can't quite ascertain right now.
  • Switches the karma reporter from progress, which is very minimal, to mocha, which is a bit more human. Karma re-runs portions of your tests and, especially developing new tests, I wanted to know which tests were running and which had passed/failed, instead of only getting details on failures and only getting summary numbers.
📖 The error around mobilenet

Error message:

    Error: Argument 'x' passed to 'conv2d' must be a Tensor, but got object.
        at c (src/ImageClassifier/index.test.js:1:2672)
        at a (src/ImageClassifier/index.test.js:1:2126)
        at n (src/ImageClassifier/index.test.js:1:2330)
        at Object.i (src/ImageClassifier/index.test.js:1:2355)
        at e.conv2d (src/ImageClassifier/index.test.js:1:25150)
        at src/ImageClassifier/index.test.js:1:82279
        at e.tidy (src/ImageClassifier/index.test.js:1:142745)
        at Object.n.value (src/ImageClassifier/index.test.js:1:82256)
        at src/ImageClassifier/index.test.js:1:487368
        at e.tidy (src/ImageClassifier/index.test.js:1:142745)

Having dug into this a bit, my best guess is that it's a problem with 2 instances of Tensorflow, so that there's a check in Tensorflow that does obj instanceof Tensor and it's comparing it to the wrong copy of tensorflow's Tensor. But I haven't been able to confirm this - it really does look like there's one copy of tfjs-core in the mix.

Things this doesn't resolve but I've noticed

  • pitchDetection almost certainly has a race condition - its constructor loads a tf model asynchronously but nothing waits for that loading to end, and methods like processMicrophoneBuffer could conceivably run before this.model is defined / usable.
  • poseNet's implementation doesn't appear to precisely match its docs - at least in my reading of the code, it'll call its callback for each frame with a new prediction, rather than calling the callback once with an array.
  • I'm pretty sure that the YOLO documentation is also off by a bit: creating a YOLO object without a video parameter is not valid - i always calls this.loadVideo() right now.
  • It appears that YOLO only works for 416x416 images?

Callback situation

Right now this doesn't attempt to change or make the callback system uniform, because the conversation in #143 is still ongoing. I don't anticipate a lot of code change based on the outcome of that discussion, it's mostly a design problem rather than a technical challenge.

@tmcw
Copy link
Contributor Author

tmcw commented Jun 13, 2018

I'm going to guess that CircleCI is unhappy because of a WebGL support issue? Tests pass locally for me.

@cvalenzuela
Copy link
Member

This is great, thanks @tmcw!

I'm not super familiar with running tests with WebGL support. Maybe @nsthorat might help with this?

@nsthorat
Copy link
Contributor

nsthorat commented Jun 13, 2018

I would use browserstack via travis! They are phenomenal and free for small projects (it's still free for us), they actually run your tests on real devices with WebGL enabled.

Here is our travis config which kicks off our tests:
https://github.com/tensorflow/tfjs-core/blob/master/.travis.yml#L6

Karma, the test runner, gets kicked off here:
https://github.com/tensorflow/tfjs-core/blob/master/scripts/test-travis.sh

Here is the karma config, which has info about browserstack as well as local testing:
https://github.com/tensorflow/tfjs-core/blob/master/karma.conf.js

Through travis, you add the environments for your browserstack key, which you can see above.

Let me know if you need any help!

@tmcw
Copy link
Contributor Author

tmcw commented Jun 13, 2018

Okay, so - moving along with some of this:

  • The karma setup could really use some sourcemaps - right now errors in tests all come from the same line of the same file - so I'm trying to add that in this PR, with... unfortunately pretty limited success, karma seems to hang once sourcemaps are added. Any karma whizzes, help would be appreciated; there aren't many clues for debugging, the browser page opens but is blank, no console errors.
  • Looks like the answer to that question of promises or callbacks is - with the API as it is currently, it would be necessary to return the object if a callback is provided and a promise if it isn't - because right now the callbacks don't have any argument values.

@cvalenzuela
Copy link
Member

cvalenzuela commented Jun 13, 2018

@oveddan helped us with some setup of karma and sourcemaps, he might help us on this.

As for the promises/callback, I think that's the right approach. Return the object if a callback is provided and Promise if not.

@@ -76,83 +74,86 @@ class LSTM {
const temperature = +options.temperature || this.defaults.temperature;
const results = [];

if (this.ready) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bugfix - the previous behavior is that calling this method before the model is fully loaded would do nothing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, thanks for the catch!

@@ -16,12 +16,12 @@ class PitchDetection {
this.modelName = modelName;
this.audioContext = audioContext;
this.stream = stream;
this.loadModel();
this.ready = this.loadModel().then(() => this);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also posit that this is a bugfix; pitchdetection has an async loading step but no callback.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this doesn't actually add a callback to the constructor.

@tmcw tmcw force-pushed the image-classifier-promises branch 3 times, most recently from c92c7c2 to 6dc4fe5 Compare June 14, 2018 22:07
});
}
getVariable(varName) {
if (!(varName in this.checkpointManifest)) {
throw new Error(`Cannot load non-existant variable ${varName}`);
throw new Error(`Cannot load non-existent variable ${varName}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor typo fix here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

});
async loadManifest() {
try {
this.checkpointManifest = await (await fetch(this.urlPath + MANIFEST_FILE)).json();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possibly there was some reason why this bit of code used XMLHttpRequest? It's not apparent in the source before, and I think it'd be ideal if fetch is used uniformly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably taken from the old checkpoint loader in deeplearnjs, there's likely no reason not to use fetch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we took this from the previous checkpoint loader. thanks for the update.

@tmcw tmcw force-pushed the image-classifier-promises branch from 6dc4fe5 to be83e85 Compare June 14, 2018 22:16
@tmcw tmcw force-pushed the image-classifier-promises branch from be83e85 to 650a569 Compare June 14, 2018 23:19
@tmcw
Copy link
Contributor Author

tmcw commented Jun 14, 2018

Okay - we're getting there! This PR now includes promisification for all of the basic methods in ml5, and I've released a scoped testing module which works pretty well: https://beta.observablehq.com/d/d421a46185d4f063 This also confirms (phew) that Mobilenet isn't actually broken in general or anything - it's just being cranky about the testing environment.

The main tricky one is PoseNet:

The docs for PoseNet describe callback as A function to run once the model has been loaded. - which is definitely pretty far from what it actually does - the callback is called every time that poses are gotten from a video feed. The actual behavior is kind of tricky: If you don't provide a callback initially, then getting those poses is not obvious - it really looks like you'll end up with two tf.nextFrame() loops.

The most common abstraction for this is an event emitter:

let pn = await poseNet(video);
pn.on('pose', pose => {
   // do something with pose
});

Because really there are two stages here:

  1. The asynchronous setup stage of posenet
  2. The many poses that are emitted from it

My take is that we'd want to separate these and make the first one a promise or callback, and make the second one an event. But I'm happy to implement another thing if it fits better into the p5/ml5 ecosystem.

This is ready for a directional review if any folks have the time to spare!

@cvalenzuela
Copy link
Member

This is a really amazing work @tmcw! thanks for all your work and help!

Since these are a lot of changes and some might affect the API, we will possible merge this after the beta release. I hope to go over all the changes more throughly tomorrow and also get some feedback from @shiffman.

@shiffman
Copy link
Member

Wow, this is fantastic! @cvalenzuela, yes, I think a discussion at a working session would be great. Thank you @tmcw, we are so grateful for your contribution!

@oveddan
Copy link
Contributor

oveddan commented Jun 15, 2018

My two cents: if you want to use promises/async, why not just call the original posenet api?

Copy link
Contributor

@nsthorat nsthorat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmcw most of these comments aren't necessarily geared towards you, sort of a code review of already submitted stuff :).

Feel free to ignore, just my 2c.

if (this.usageType === 'classifier') {
y = tf.tidy(() => tf.oneHot(tf.tensor1d([label], 'int32'), this.numClasses));
} else if (this.usageType === 'regressor') {
y = tf.tidy(() => tf.tensor2d([[label]]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for tidy() here this actually won't do anything (there are no intermediate tensors)

epochs: 20,
numClasses: 2,
batchSize: 0.4,
import imageClassifier from './index';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @cvalenzuela one really useful thing to unit tests is memory usage.

One pattern we do is something like this:

const numTensors = tf.memory().numTensors;
apiCall();
expect(tf.memory().numTensors).toEqual(numTensors);

This makes sure you don't introduce leaks.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great!, I didn't knew that.

});
async loadManifest() {
try {
this.checkpointManifest = await (await fetch(this.urlPath + MANIFEST_FILE)).json();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was probably taken from the old checkpoint loader in deeplearnjs, there's likely no reason not to use fetch.

let yolo;

beforeEach(async () => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @cvalenzuela you may want to mock the actual fetch call in your unit tests so your tests are hermetic

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you expand a bit on this? I'm not sure what hermetic means in this context.

LSTMCells.push(lstm(i));
}
await this.ready;
const forgetBias = tf.tensor(1.0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvalenzuela here and below the tensors are leaking. Same comment above, I'd add a unit test that asserts generate() doesn't create more tensors than you expect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we wrap this in tf.tidy()?

@@ -57,17 +56,23 @@ class Mobilenet {
return tf.model({ inputs: this.mobilenet.inputs, outputs: layer.output });
}

classification(video, callback) {
classification(video, callback = () => {}) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not promise-ify these as well?

@meiamsome
Copy link
Contributor

I'm not sure how I feel about the callback = () => {} and then not checking the value of callback later pattern - you might end up in a case where someone passes in a null to this function (Perhaps to add an errorCallback where these are supported without a regular callback, or as part of a wrapping function)

@tmcw
Copy link
Contributor Author

tmcw commented Jun 15, 2018

@meiamsome I haven't converted this to the 'two callbacks pattern' or the 'node-style error argument' pattern because that discussion is ongoing. Regardless, if the two callbacks pattern is adopted, they could use undefined and it would properly fall back to the optional value. ml5/p5's APIs are very tolerant, I suppose, so maybe it should also check whether the value is falsy, but that's really a style decision for the maintainers.

@cvalenzuela
Copy link
Member

Sorry for the delay in reviewing this @tmcw. I'm still learning about best practices and patterns with await/ES6.

My personal take with the callback pattern is to go with the conventional JS style. Since this would play better with more JS libraries. Although I should mention that we have been also discussing a more formal p5 support (#92). That support might change the callback pattern conversation a bit. I hope this will be something we can resolve in the next few days.

Regarding the other comments:

  • pitchDetection needs some clean up and changes. We are tracking it here Pitch Detection API changes #158 and @handav was working on it. Once this PR is merged we should also update that method to follow the pattern we take here.
  • poseNet will also get a general clean up and better usage with the original api.
  • YOLO does only work with 416x416 videos for now. That's why that class creates a custom video element.
  • After this gets merged, I will pushed another PR with better testing/docs, Browserstack support and a few changes following @nsthorat recommendations.

thanks!

@tmcw
Copy link
Contributor Author

tmcw commented Jun 18, 2018

Okay!

  • Implemented the (error, callback) pattern everywhere I could find, implementing a tiny helper method callCallback to cut down on the boilerplate and to make sure that it's all well-behaved, so that if you use callbacks you never get warnings about uncaught errors in promises. This PR is about +45loc net, which isn't that bad.
  • PoseNet now extends EventEmitter and emits pose events.
  • Added a small test for LSTMGenerator that will pass once the testing environment is tensorflow-friendly.

This doesn't yet include the bits about counting tensors and memory leaks because, unfortunately, tensorflow is not yet happy in the Karma setup. Besides that, ready for a re-review.

@nsthorat
Copy link
Contributor

Just curious, what is not happy in the karma setup?

Moved the YOLO weights to the examples repo.
Fix eslint in some files
fix video issue in imageclassifier
- Add test for Imageclassifier
- Resize img if necessary in utils
- Style transfer test
- remove .test file in posenet
- fix event emmiter in posenet
- fix constructor in yolo
- async video util
@shiffman shiffman self-requested a review July 19, 2018 16:23
Copy link
Member

@shiffman shiffman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good for this and ml5js/ml5-examples#44 to merge whenever you like @cvalenzuela!

@cvalenzuela cvalenzuela merged commit c8c58ff into ml5js:master Jul 19, 2018
@cvalenzuela cvalenzuela mentioned this pull request Sep 18, 2018
joeyklee pushed a commit that referenced this pull request Jun 2, 2019
joeyklee pushed a commit that referenced this pull request Jun 2, 2019
joeyklee pushed a commit that referenced this pull request Jun 2, 2019
joeyklee pushed a commit that referenced this pull request Jun 2, 2019
joeyklee pushed a commit that referenced this pull request Jun 2, 2019
Support Promises for imageClassifier
joeyklee added a commit that referenced this pull request Jun 2, 2019
* changing vector->word in word2vec results

* added pix2pix class, pix2pix.transfer method, a checkpointsloader for pix2pix model

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve #151 (comment)

* Address #151 (comment)

* Address #151 (comment)

* Address #151 (comment)

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
#244

#244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. #279 (comment)

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in #313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in #313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated readme and package.json with v0.3.1

* add /dist to .gitignore
joeyklee added a commit that referenced this pull request Jun 2, 2019
* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve #151 (comment)

* Address #151 (comment)

* Address #151 (comment)

* Address #151 (comment)

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
#244

#244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. #279 (comment)

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in #313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in #313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated readme and package.json with v0.3.1

* add /dist to .gitignore

* rm dist files
joeyklee added a commit that referenced this pull request Jun 3, 2019
…re dev (#479)

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve #151 (comment)

* Address #151 (comment)

* Address #151 (comment)

* Address #151 (comment)

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
#244

#244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. #279 (comment)

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in #313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: #295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in #313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated package-lock
joeyklee added a commit that referenced this pull request Oct 17, 2019
* Updates dev with release and Removes /dist from past commits and future dev (#479)

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve https://github.com/ml5js/ml5-library/pull/151#discussion_r196475143

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196484426

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196517984

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196518890

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
https://github.com/ml5js/ml5-library/issues/244

https://github.com/ml5js/ml5-library/issues/244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. https://github.com/ml5js/ml5-library/pull/279#issuecomment-465890231

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146450d65aa1ad9f1ef67bf912a792b0d8a0.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated package-lock

* pass vector to dcgan compute

* Adds face-api.js to ml5.js (#482)

* initial commit - add classifyExpressions

* added classifyExpressionsMultiple() and classifyExpressionsSingle()

* remove modelPath requirement in favor of defaults

* updated index with links to tiny landmarks

* adds option to add relative path or absolute url

* updated url checking for models

* changed function names

* updated functions to .detect() and .detectSingle()

* check undefined, otherwise assign

* added resize function to results by default

* code cleanup

* added test to faceapi

* added tests

* added face parts to result.parts

* code cleanup

* changed options from withFaceX to withX

* code cleanup

* code cleanup

* fixed conditional to include face .withFaceDescriptor(s)

* docs: add jepster-dk as a contributor (#489)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xanderjakeq as a contributor (#490)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add catarak as a contributor (#491)

* docs: update README.md

* docs: update .all-contributorsrc

* [WIP]Change p5Utils into a class

* dcgan: use random vector if no latent vector is given

* dcgan check if arg is array

* updated code of conduct with adapted p5 community statement (#492)

* updated code of conduct with adapted p5 community statement

* Update CODE_OF_CONDUCT.md

rm coding train from donation // todo - add other relevant orgs next

Co-Authored-By: Daniel Shiffman <daniel.shiffman@gmail.com>

* updated enforcement with ashley and dan

* rm redundant all contributors badge (#497)

* Readme updates (#505)

* added package.lock

* updates links to latest website

* rm 'with no external deps'

* set correct url to image (#507)

* docs: add dcbriccetti as a contributor (#506)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Sblob1 as a contributor (#513)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* Fu

* add command line arguments for testing single model

* Handling p5 Image in PoseNet singlePose

I have changed singlePose function in order to handle p5 Image types. 

However I'm not sure if the check is thorough enough. Any pointers are welcome.

* Adds ImageData support for all image handling functions (#525)

* added ImageData support to YOLO

* adds ImageData support to UNET

* adds ImageData support to StyleTransfer

* adds ImageData support to PoseNet

* adds ImageData support for ImageClassifier/darknet

* adds ImageData support for ImageClassifier/doodlenet

* adds ImageData support for BodyPix and cleans up conditionals

* adds ImageData support to faceApi and cleans up conditionals

* adds ImageData support for imageclassifier and cleans up conditional

* fix image handling for bodypix faceapi and imageclassifier

* update mobilenet imageData support

* check imagedata in yolo

* adds ImageData test to BodyPix

* adds check for canvas (#526)

* Fixes Posenet input arguments and related issues (#529)

* adds this.multiPose() to else{}

* fixes conditional check on object or string

* added kmeans

* added randomSample function

* re-ordered name placement

* fixed weird indentation error

* indentation

* removed optional keyword in docstring

* updates issue and pull request templates (#530)

* Created config class attribute to store instance params

* Adds release script helper (#534)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* Adds release script helper (#535)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* adds tagging to release:publish

* fixes typo

* added test to kmeans (#536)

* docs: add jwilber as a contributor (#537)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add tezzutezzu as a contributor (#538)

* docs: update README.md

* docs: update .all-contributorsrc

* Update Contributing and Github docs (#539)

* updated issue template:

* update PR template

* added new release how to

* docs: add EmmaGoodliffe as a contributor (#545)

* docs: update README.md

* docs: update .all-contributorsrc

* Update tfjs ~v1.2.2 (#544)

* updated tfjs to 1.2.2 and bumped face-api to 0.20.1

* bump tensorflow models

* bump body-pix version

* adds version 2 to feature extractor

* updated to mobilenetv2 api

* updates to posenet 2 api

* always process and resize images in mobilenet

* update test with version 2

* update posenet inputs and test

* fix issue with params in posenet

* updates conditional in p5Utils

* add loadImage test (#549)

* Update npm helper scripts for making releases (#552)

* updating release process scripts and docs

* updated release proces npm scripts and docs

* added release:sync and developement:sync"
"

* set fe to mobilenet v1 - use layers model (#554)

* Adds Docsify to consolidate documentation (#556)

* add docsify-cli as dev dep

* adds docs structure for docsify

* adds bodyPix documentation example

* update bodypix documentation

* adds imageClassifer docs

* added styleguide template and updated docs

* changed name of reference template

* added dev guidelines

* update dev guidelines

* adds posenet docs

* adds tutorials and faq

* add dev:docs npm script

* adds char rnn to docs

* Adds documentation for references to docsify docs (#557)

* add note on all contributors bot

* adds faceapi header img"

* adds design guidelines

* adds design guidelines to sidebar

* adds section for p5 web editor examples

* adds cvae refs

* update bodypix and charrnn docs

* added dcgan docs

* adds pitch detection docs

* adds featureExtractor docs

* adds knn classifier

* update tutorial refs

* adds pix2pix doc

* adds sentiment docs

* adds sketchrnn ref

* adds sound classifier

* adds styletransfer docs

* adds unet docs

* adds word2vec docs

* adds yolo docs

* adds acknowledgements section

* adds acknowledgements section

* Fixes Doodlenet - set new axes and .floor() (#559)

* change split axis to 3 axes

* use floor() instead of round()

* adds options for detection confidence (#561)

* Adds labels to custom image classification model from Teachable Machine output

* Addressing issue #590 part 1 (#592)
>The saved labels from Teachable Machine should be loaded by ml5. I believe this is working for sound classification, but not for images.

Fetching labels from metadata.json when loading models from the new Teachable Machine.

* docs: add EonYang as a contributor (#593)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lydiajessup as a contributor (#594)

* docs: update README.md

* docs: update .all-contributorsrc

* set alias for sidebar (#598)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* [Docs] Uses gh-pages to serve docsify docs (#599)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* adds header nav to docs

* updates alt text and image url

* adds getting started url

* adds reference index

* updates href to reference in nav (#601)

* [face-api] Removes expressions support from face-api in ml5.js (#602)

* rm faceapi expressions support

* rm expression ref in comment

* updates tests for faceapi

* fixes single detection and tests

* Update docs (#603)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* Revert "Update docs (#603)" (#604)

This reverts commit c6b78d0a7aedc7050a095386ad88300d91a761b2.

* Updates docsify docs (#605)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* rm neural net class from update-docs branch

* moves bodyPix to support preload() (#610)

* Adds preload support to faceApi  (#611)

* moves bodyPix to support preload()

* adds faceapi to preload

* Updates Docs with latest features (#612)

* adds face-api updates and neural network docs updates

* adds docs for nn functions

* adds save and load docs

* adds neural Network documentation

* fixes backticks

* adds sidebar dividers

* adds docs on model loading and contributors (#616)

* Updates gh templates (#617)

* updates PR template

* updates gh issues template

* updates template

* Generic Neural Network class (#485)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds blob reader for json

* [diy nn] moves tf-vis visualizations to helper class (#583)

* adds tfvis to neuralNetworkVis.js

* adds tfvis to class

* handle text and convert to json (#584)

* allow user more control in the case of classification

* allow user more control in the case of classification (#585)

* Refactoring DIY Neural Network (#591)

* [wip] refactoring data handling and logic separation

* wip adding convertRawToTensor

* adds conversion to tensor

* adds normalization step

* adds train()

* adds predictInternal()

* fixes unique value mapping issue

* comment out .print()

* return all regression results

* adds experimental normalizationOptions object

* quick fix for checking if normalizationOptions exists

* commenting out auto tensor printing

* adds checks for normalizationOptions

* fix obj ref in conditional

* adds .normalizeData() - keeps .normalize() for now

* changes whileTraining function when debug is true

* adds layer options for adding more than 2 layers - experimentalgit add .

* remove .normalize() in favor of .normalizeData()

* adds save() and load()

* adds data.warmUp() to allow training without normalization - handled internally on train

* updates outputs of .predict() and .classify() to be array

* Divide by 0 issue when data is not normalized (#596)

* skipping calculating inputMin and inputMax when data not normalized

* adds check for this.data.meta.isNormalized in predictInternal

* Diy nn code cleanup (#606)

* adds input/output checks to specify number or array of input/output names

* moves model creation to training to compile after input and output units have been calcd

* cleanup code in .trainInternal()

* move vars up to top of function in .trainInternal()

* rm model creation from .createModelFromDataInternal()

* code cleanup and adds comments to .initializeIOUnits()

* code cleanup

* [DIY NN] Adds .saveData() and .loadData() (#607)

* adds saveData function

* updates saveData() with input checks

* adds loadData function

* [Diy NN] Adds .predictMultiple() for batch predictions/classifications (#609)

* adds predictMultiple()

* rm ys.print()

* moves bodypix and faceapi to preload support to match base branch

* [DIY nn] Neural Net Fixes loading pre-trained model (#613)

* adds model_meta.json to savedfiles

* adds loading of model_meta.json - temp fix

* use substring method for url checking

* adds check for if input is JSON

* loadData and text variables mixed up (#615)

* [Diy nn] fix model loading load (Work in progress) (#618)

* adds input object as param to .load()

* adds fetch to retrieve data from urls in .load() based on object

* updates object handler

* fixes check for model.json

* fixes parsing and ordering files

* adds fix for p5 web editor - must use explicit json object to load models

* allows user to add video to .segment() and .segmentWithParts() (#619)

* updates unet docs (#620)

* adds basic test for defaults (#621)

* docs: add EmmaGoodliffe as a contributor (#622)

* docs: update README.md

* docs: update .all-contributorsrc

* adds fix for unet image return for p5 (#625)

* updates webpack dev server to 3.1.11 (#629)

* Fixes vulnerabilities noted by npm (#630)

* run npm audit fix

* bumps commitizen dep

* updated readme and readme updater (#632)

* Update NeuralNetwork docs (#631)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

…
joeyklee added a commit that referenced this pull request Nov 4, 2019
…ch (#676)

* ml5 release v0.4.0 (#640)

* Updates dev with release and Removes /dist from past commits and future dev (#479)

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve https://github.com/ml5js/ml5-library/pull/151#discussion_r196475143

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196484426

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196517984

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196518890

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
https://github.com/ml5js/ml5-library/issues/244

https://github.com/ml5js/ml5-library/issues/244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. https://github.com/ml5js/ml5-library/pull/279#issuecomment-465890231

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146450d65aa1ad9f1ef67bf912a792b0d8a0.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated package-lock

* pass vector to dcgan compute

* Adds face-api.js to ml5.js (#482)

* initial commit - add classifyExpressions

* added classifyExpressionsMultiple() and classifyExpressionsSingle()

* remove modelPath requirement in favor of defaults

* updated index with links to tiny landmarks

* adds option to add relative path or absolute url

* updated url checking for models

* changed function names

* updated functions to .detect() and .detectSingle()

* check undefined, otherwise assign

* added resize function to results by default

* code cleanup

* added test to faceapi

* added tests

* added face parts to result.parts

* code cleanup

* changed options from withFaceX to withX

* code cleanup

* code cleanup

* fixed conditional to include face .withFaceDescriptor(s)

* docs: add jepster-dk as a contributor (#489)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xanderjakeq as a contributor (#490)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add catarak as a contributor (#491)

* docs: update README.md

* docs: update .all-contributorsrc

* [WIP]Change p5Utils into a class

* dcgan: use random vector if no latent vector is given

* dcgan check if arg is array

* updated code of conduct with adapted p5 community statement (#492)

* updated code of conduct with adapted p5 community statement

* Update CODE_OF_CONDUCT.md

rm coding train from donation // todo - add other relevant orgs next

Co-Authored-By: Daniel Shiffman <daniel.shiffman@gmail.com>

* updated enforcement with ashley and dan

* rm redundant all contributors badge (#497)

* Readme updates (#505)

* added package.lock

* updates links to latest website

* rm 'with no external deps'

* set correct url to image (#507)

* docs: add dcbriccetti as a contributor (#506)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Sblob1 as a contributor (#513)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* Fu

* add command line arguments for testing single model

* Handling p5 Image in PoseNet singlePose

I have changed singlePose function in order to handle p5 Image types. 

However I'm not sure if the check is thorough enough. Any pointers are welcome.

* Adds ImageData support for all image handling functions (#525)

* added ImageData support to YOLO

* adds ImageData support to UNET

* adds ImageData support to StyleTransfer

* adds ImageData support to PoseNet

* adds ImageData support for ImageClassifier/darknet

* adds ImageData support for ImageClassifier/doodlenet

* adds ImageData support for BodyPix and cleans up conditionals

* adds ImageData support to faceApi and cleans up conditionals

* adds ImageData support for imageclassifier and cleans up conditional

* fix image handling for bodypix faceapi and imageclassifier

* update mobilenet imageData support

* check imagedata in yolo

* adds ImageData test to BodyPix

* adds check for canvas (#526)

* Fixes Posenet input arguments and related issues (#529)

* adds this.multiPose() to else{}

* fixes conditional check on object or string

* added kmeans

* added randomSample function

* re-ordered name placement

* fixed weird indentation error

* indentation

* removed optional keyword in docstring

* updates issue and pull request templates (#530)

* Created config class attribute to store instance params

* Adds release script helper (#534)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* Adds release script helper (#535)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* adds tagging to release:publish

* fixes typo

* added test to kmeans (#536)

* docs: add jwilber as a contributor (#537)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add tezzutezzu as a contributor (#538)

* docs: update README.md

* docs: update .all-contributorsrc

* Update Contributing and Github docs (#539)

* updated issue template:

* update PR template

* added new release how to

* docs: add EmmaGoodliffe as a contributor (#545)

* docs: update README.md

* docs: update .all-contributorsrc

* Update tfjs ~v1.2.2 (#544)

* updated tfjs to 1.2.2 and bumped face-api to 0.20.1

* bump tensorflow models

* bump body-pix version

* adds version 2 to feature extractor

* updated to mobilenetv2 api

* updates to posenet 2 api

* always process and resize images in mobilenet

* update test with version 2

* update posenet inputs and test

* fix issue with params in posenet

* updates conditional in p5Utils

* add loadImage test (#549)

* Update npm helper scripts for making releases (#552)

* updating release process scripts and docs

* updated release proces npm scripts and docs

* added release:sync and developement:sync"
"

* set fe to mobilenet v1 - use layers model (#554)

* Adds Docsify to consolidate documentation (#556)

* add docsify-cli as dev dep

* adds docs structure for docsify

* adds bodyPix documentation example

* update bodypix documentation

* adds imageClassifer docs

* added styleguide template and updated docs

* changed name of reference template

* added dev guidelines

* update dev guidelines

* adds posenet docs

* adds tutorials and faq

* add dev:docs npm script

* adds char rnn to docs

* Adds documentation for references to docsify docs (#557)

* add note on all contributors bot

* adds faceapi header img"

* adds design guidelines

* adds design guidelines to sidebar

* adds section for p5 web editor examples

* adds cvae refs

* update bodypix and charrnn docs

* added dcgan docs

* adds pitch detection docs

* adds featureExtractor docs

* adds knn classifier

* update tutorial refs

* adds pix2pix doc

* adds sentiment docs

* adds sketchrnn ref

* adds sound classifier

* adds styletransfer docs

* adds unet docs

* adds word2vec docs

* adds yolo docs

* adds acknowledgements section

* adds acknowledgements section

* Fixes Doodlenet - set new axes and .floor() (#559)

* change split axis to 3 axes

* use floor() instead of round()

* adds options for detection confidence (#561)

* Adds labels to custom image classification model from Teachable Machine output

* Addressing issue #590 part 1 (#592)
>The saved labels from Teachable Machine should be loaded by ml5. I believe this is working for sound classification, but not for images.

Fetching labels from metadata.json when loading models from the new Teachable Machine.

* docs: add EonYang as a contributor (#593)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lydiajessup as a contributor (#594)

* docs: update README.md

* docs: update .all-contributorsrc

* set alias for sidebar (#598)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* [Docs] Uses gh-pages to serve docsify docs (#599)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* adds header nav to docs

* updates alt text and image url

* adds getting started url

* adds reference index

* updates href to reference in nav (#601)

* [face-api] Removes expressions support from face-api in ml5.js (#602)

* rm faceapi expressions support

* rm expression ref in comment

* updates tests for faceapi

* fixes single detection and tests

* Update docs (#603)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* Revert "Update docs (#603)" (#604)

This reverts commit c6b78d0a7aedc7050a095386ad88300d91a761b2.

* Updates docsify docs (#605)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* rm neural net class from update-docs branch

* moves bodyPix to support preload() (#610)

* Adds preload support to faceApi  (#611)

* moves bodyPix to support preload()

* adds faceapi to preload

* Updates Docs with latest features (#612)

* adds face-api updates and neural network docs updates

* adds docs for nn functions

* adds save and load docs

* adds neural Network documentation

* fixes backticks

* adds sidebar dividers

* adds docs on model loading and contributors (#616)

* Updates gh templates (#617)

* updates PR template

* updates gh issues template

* updates template

* Generic Neural Network class (#485)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds blob reader for json

* [diy nn] moves tf-vis visualizations to helper class (#583)

* adds tfvis to neuralNetworkVis.js

* adds tfvis to class

* handle text and convert to json (#584)

* allow user more control in the case of classification

* allow user more control in the case of classification (#585)

* Refactoring DIY Neural Network (#591)

* [wip] refactoring data handling and logic separation

* wip adding convertRawToTensor

* adds conversion to tensor

* adds normalization step

* adds train()

* adds predictInternal()

* fixes unique value mapping issue

* comment out .print()

* return all regression results

* adds experimental normalizationOptions object

* quick fix for checking if normalizationOptions exists

* commenting out auto tensor printing

* adds checks for normalizationOptions

* fix obj ref in conditional

* adds .normalizeData() - keeps .normalize() for now

* changes whileTraining function when debug is true

* adds layer options for adding more than 2 layers - experimentalgit add .

* remove .normalize() in favor of .normalizeData()

* adds save() and load()

* adds data.warmUp() to allow training without normalization - handled internally on train

* updates outputs of .predict() and .classify() to be array

* Divide by 0 issue when data is not normalized (#596)

* skipping calculating inputMin and inputMax when data not normalized

* adds check for this.data.meta.isNormalized in predictInternal

* Diy nn code cleanup (#606)

* adds input/output checks to specify number or array of input/output names

* moves model creation to training to compile after input and output units have been calcd

* cleanup code in .trainInternal()

* move vars up to top of function in .trainInternal()

* rm model creation from .createModelFromDataInternal()

* code cleanup and adds comments to .initializeIOUnits()

* code cleanup

* [DIY NN] Adds .saveData() and .loadData() (#607)

* adds saveData function

* updates saveData() with input checks

* adds loadData function

* [Diy NN] Adds .predictMultiple() for batch predictions/classifications (#609)

* adds predictMultiple()

* rm ys.print()

* moves bodypix and faceapi to preload support to match base branch

* [DIY nn] Neural Net Fixes loading pre-trained model (#613)

* adds model_meta.json to savedfiles

* adds loading of model_meta.json - temp fix

* use substring method for url checking

* adds check for if input is JSON

* loadData and text variables mixed up (#615)

* [Diy nn] fix model loading load (Work in progress) (#618)

* adds input object as param to .load()

* adds fetch to retrieve data from urls in .load() based on object

* updates object handler

* fixes check for model.json

* fixes parsing and ordering files

* adds fix for p5 web editor - must use explicit json object to load models

* allows user to add video to .segment() and .segmentWithParts() (#619)

* updates unet docs (#620)

* adds basic test for defaults (#621)

* docs: add EmmaGoodliffe as a contributor (#622)

* docs: update README.md

* docs: update .all-contributorsrc

* adds fix for unet image return for p5 (#625)

* updates webpack dev server to 3.1.11 (#629)

* Fixes vulnerabilities noted by npm (#630)

* run npm audit fix

* bumps commitizen dep

* updated readme and readme updater (#632)

* Update NeuralNetwork docs (#631)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] …
joeyklee added a commit that referenced this pull request Nov 6, 2019
* [neural net fix] Merges neural net fix in release to development branch (#676)

* ml5 release v0.4.0 (#640)

* Updates dev with release and Removes /dist from past commits and future dev (#479)

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve https://github.com/ml5js/ml5-library/pull/151#discussion_r196475143

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196484426

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196517984

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196518890

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
https://github.com/ml5js/ml5-library/issues/244

https://github.com/ml5js/ml5-library/issues/244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. https://github.com/ml5js/ml5-library/pull/279#issuecomment-465890231

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146450d65aa1ad9f1ef67bf912a792b0d8a0.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated package-lock

* pass vector to dcgan compute

* Adds face-api.js to ml5.js (#482)

* initial commit - add classifyExpressions

* added classifyExpressionsMultiple() and classifyExpressionsSingle()

* remove modelPath requirement in favor of defaults

* updated index with links to tiny landmarks

* adds option to add relative path or absolute url

* updated url checking for models

* changed function names

* updated functions to .detect() and .detectSingle()

* check undefined, otherwise assign

* added resize function to results by default

* code cleanup

* added test to faceapi

* added tests

* added face parts to result.parts

* code cleanup

* changed options from withFaceX to withX

* code cleanup

* code cleanup

* fixed conditional to include face .withFaceDescriptor(s)

* docs: add jepster-dk as a contributor (#489)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xanderjakeq as a contributor (#490)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add catarak as a contributor (#491)

* docs: update README.md

* docs: update .all-contributorsrc

* [WIP]Change p5Utils into a class

* dcgan: use random vector if no latent vector is given

* dcgan check if arg is array

* updated code of conduct with adapted p5 community statement (#492)

* updated code of conduct with adapted p5 community statement

* Update CODE_OF_CONDUCT.md

rm coding train from donation // todo - add other relevant orgs next

Co-Authored-By: Daniel Shiffman <daniel.shiffman@gmail.com>

* updated enforcement with ashley and dan

* rm redundant all contributors badge (#497)

* Readme updates (#505)

* added package.lock

* updates links to latest website

* rm 'with no external deps'

* set correct url to image (#507)

* docs: add dcbriccetti as a contributor (#506)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Sblob1 as a contributor (#513)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* Fu

* add command line arguments for testing single model

* Handling p5 Image in PoseNet singlePose

I have changed singlePose function in order to handle p5 Image types. 

However I'm not sure if the check is thorough enough. Any pointers are welcome.

* Adds ImageData support for all image handling functions (#525)

* added ImageData support to YOLO

* adds ImageData support to UNET

* adds ImageData support to StyleTransfer

* adds ImageData support to PoseNet

* adds ImageData support for ImageClassifier/darknet

* adds ImageData support for ImageClassifier/doodlenet

* adds ImageData support for BodyPix and cleans up conditionals

* adds ImageData support to faceApi and cleans up conditionals

* adds ImageData support for imageclassifier and cleans up conditional

* fix image handling for bodypix faceapi and imageclassifier

* update mobilenet imageData support

* check imagedata in yolo

* adds ImageData test to BodyPix

* adds check for canvas (#526)

* Fixes Posenet input arguments and related issues (#529)

* adds this.multiPose() to else{}

* fixes conditional check on object or string

* added kmeans

* added randomSample function

* re-ordered name placement

* fixed weird indentation error

* indentation

* removed optional keyword in docstring

* updates issue and pull request templates (#530)

* Created config class attribute to store instance params

* Adds release script helper (#534)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* Adds release script helper (#535)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* adds tagging to release:publish

* fixes typo

* added test to kmeans (#536)

* docs: add jwilber as a contributor (#537)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add tezzutezzu as a contributor (#538)

* docs: update README.md

* docs: update .all-contributorsrc

* Update Contributing and Github docs (#539)

* updated issue template:

* update PR template

* added new release how to

* docs: add EmmaGoodliffe as a contributor (#545)

* docs: update README.md

* docs: update .all-contributorsrc

* Update tfjs ~v1.2.2 (#544)

* updated tfjs to 1.2.2 and bumped face-api to 0.20.1

* bump tensorflow models

* bump body-pix version

* adds version 2 to feature extractor

* updated to mobilenetv2 api

* updates to posenet 2 api

* always process and resize images in mobilenet

* update test with version 2

* update posenet inputs and test

* fix issue with params in posenet

* updates conditional in p5Utils

* add loadImage test (#549)

* Update npm helper scripts for making releases (#552)

* updating release process scripts and docs

* updated release proces npm scripts and docs

* added release:sync and developement:sync"
"

* set fe to mobilenet v1 - use layers model (#554)

* Adds Docsify to consolidate documentation (#556)

* add docsify-cli as dev dep

* adds docs structure for docsify

* adds bodyPix documentation example

* update bodypix documentation

* adds imageClassifer docs

* added styleguide template and updated docs

* changed name of reference template

* added dev guidelines

* update dev guidelines

* adds posenet docs

* adds tutorials and faq

* add dev:docs npm script

* adds char rnn to docs

* Adds documentation for references to docsify docs (#557)

* add note on all contributors bot

* adds faceapi header img"

* adds design guidelines

* adds design guidelines to sidebar

* adds section for p5 web editor examples

* adds cvae refs

* update bodypix and charrnn docs

* added dcgan docs

* adds pitch detection docs

* adds featureExtractor docs

* adds knn classifier

* update tutorial refs

* adds pix2pix doc

* adds sentiment docs

* adds sketchrnn ref

* adds sound classifier

* adds styletransfer docs

* adds unet docs

* adds word2vec docs

* adds yolo docs

* adds acknowledgements section

* adds acknowledgements section

* Fixes Doodlenet - set new axes and .floor() (#559)

* change split axis to 3 axes

* use floor() instead of round()

* adds options for detection confidence (#561)

* Adds labels to custom image classification model from Teachable Machine output

* Addressing issue #590 part 1 (#592)
>The saved labels from Teachable Machine should be loaded by ml5. I believe this is working for sound classification, but not for images.

Fetching labels from metadata.json when loading models from the new Teachable Machine.

* docs: add EonYang as a contributor (#593)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lydiajessup as a contributor (#594)

* docs: update README.md

* docs: update .all-contributorsrc

* set alias for sidebar (#598)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* [Docs] Uses gh-pages to serve docsify docs (#599)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* adds header nav to docs

* updates alt text and image url

* adds getting started url

* adds reference index

* updates href to reference in nav (#601)

* [face-api] Removes expressions support from face-api in ml5.js (#602)

* rm faceapi expressions support

* rm expression ref in comment

* updates tests for faceapi

* fixes single detection and tests

* Update docs (#603)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* Revert "Update docs (#603)" (#604)

This reverts commit c6b78d0a7aedc7050a095386ad88300d91a761b2.

* Updates docsify docs (#605)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* rm neural net class from update-docs branch

* moves bodyPix to support preload() (#610)

* Adds preload support to faceApi  (#611)

* moves bodyPix to support preload()

* adds faceapi to preload

* Updates Docs with latest features (#612)

* adds face-api updates and neural network docs updates

* adds docs for nn functions

* adds save and load docs

* adds neural Network documentation

* fixes backticks

* adds sidebar dividers

* adds docs on model loading and contributors (#616)

* Updates gh templates (#617)

* updates PR template

* updates gh issues template

* updates template

* Generic Neural Network class (#485)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds blob reader for json

* [diy nn] moves tf-vis visualizations to helper class (#583)

* adds tfvis to neuralNetworkVis.js

* adds tfvis to class

* handle text and convert to json (#584)

* allow user more control in the case of classification

* allow user more control in the case of classification (#585)

* Refactoring DIY Neural Network (#591)

* [wip] refactoring data handling and logic separation

* wip adding convertRawToTensor

* adds conversion to tensor

* adds normalization step

* adds train()

* adds predictInternal()

* fixes unique value mapping issue

* comment out .print()

* return all regression results

* adds experimental normalizationOptions object

* quick fix for checking if normalizationOptions exists

* commenting out auto tensor printing

* adds checks for normalizationOptions

* fix obj ref in conditional

* adds .normalizeData() - keeps .normalize() for now

* changes whileTraining function when debug is true

* adds layer options for adding more than 2 layers - experimentalgit add .

* remove .normalize() in favor of .normalizeData()

* adds save() and load()

* adds data.warmUp() to allow training without normalization - handled internally on train

* updates outputs of .predict() and .classify() to be array

* Divide by 0 issue when data is not normalized (#596)

* skipping calculating inputMin and inputMax when data not normalized

* adds check for this.data.meta.isNormalized in predictInternal

* Diy nn code cleanup (#606)

* adds input/output checks to specify number or array of input/output names

* moves model creation to training to compile after input and output units have been calcd

* cleanup code in .trainInternal()

* move vars up to top of function in .trainInternal()

* rm model creation from .createModelFromDataInternal()

* code cleanup and adds comments to .initializeIOUnits()

* code cleanup

* [DIY NN] Adds .saveData() and .loadData() (#607)

* adds saveData function

* updates saveData() with input checks

* adds loadData function

* [Diy NN] Adds .predictMultiple() for batch predictions/classifications (#609)

* adds predictMultiple()

* rm ys.print()

* moves bodypix and faceapi to preload support to match base branch

* [DIY nn] Neural Net Fixes loading pre-trained model (#613)

* adds model_meta.json to savedfiles

* adds loading of model_meta.json - temp fix

* use substring method for url checking

* adds check for if input is JSON

* loadData and text variables mixed up (#615)

* [Diy nn] fix model loading load (Work in progress) (#618)

* adds input object as param to .load()

* adds fetch to retrieve data from urls in .load() based on object

* updates object handler

* fixes check for model.json

* fixes parsing and ordering files

* adds fix for p5 web editor - must use explicit json object to load models

* allows user to add video to .segment() and .segmentWithParts() (#619)

* updates unet docs (#620)

* adds basic test for defaults (#621)

* docs: add EmmaGoodliffe as a contributor (#622)

* docs: update README.md

* docs: update .all-contributorsrc

* adds fix for unet image return for p5 (#625)

* updates webpack dev server to 3.1.11 (#629)

* Fixes vulnerabilities noted by npm (#630)

* run npm audit fix

* bumps commitizen dep

* updated readme and readme updater (#632)

* Update NeuralNetwork docs (#631)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extract…
joeyklee added a commit that referenced this pull request Nov 14, 2019
* [v0.4.2] v0.4.2 (#685)

* [neural net fix] Merges neural net fix in release to development branch (#676)

* ml5 release v0.4.0 (#640)

* Updates dev with release and Removes /dist from past commits and future dev (#479)

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve https://github.com/ml5js/ml5-library/pull/151#discussion_r196475143

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196484426

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196517984

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196518890

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
https://github.com/ml5js/ml5-library/issues/244

https://github.com/ml5js/ml5-library/issues/244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. https://github.com/ml5js/ml5-library/pull/279#issuecomment-465890231

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146450d65aa1ad9f1ef67bf912a792b0d8a0.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated package-lock

* pass vector to dcgan compute

* Adds face-api.js to ml5.js (#482)

* initial commit - add classifyExpressions

* added classifyExpressionsMultiple() and classifyExpressionsSingle()

* remove modelPath requirement in favor of defaults

* updated index with links to tiny landmarks

* adds option to add relative path or absolute url

* updated url checking for models

* changed function names

* updated functions to .detect() and .detectSingle()

* check undefined, otherwise assign

* added resize function to results by default

* code cleanup

* added test to faceapi

* added tests

* added face parts to result.parts

* code cleanup

* changed options from withFaceX to withX

* code cleanup

* code cleanup

* fixed conditional to include face .withFaceDescriptor(s)

* docs: add jepster-dk as a contributor (#489)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xanderjakeq as a contributor (#490)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add catarak as a contributor (#491)

* docs: update README.md

* docs: update .all-contributorsrc

* [WIP]Change p5Utils into a class

* dcgan: use random vector if no latent vector is given

* dcgan check if arg is array

* updated code of conduct with adapted p5 community statement (#492)

* updated code of conduct with adapted p5 community statement

* Update CODE_OF_CONDUCT.md

rm coding train from donation // todo - add other relevant orgs next

Co-Authored-By: Daniel Shiffman <daniel.shiffman@gmail.com>

* updated enforcement with ashley and dan

* rm redundant all contributors badge (#497)

* Readme updates (#505)

* added package.lock

* updates links to latest website

* rm 'with no external deps'

* set correct url to image (#507)

* docs: add dcbriccetti as a contributor (#506)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Sblob1 as a contributor (#513)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* Fu

* add command line arguments for testing single model

* Handling p5 Image in PoseNet singlePose

I have changed singlePose function in order to handle p5 Image types. 

However I'm not sure if the check is thorough enough. Any pointers are welcome.

* Adds ImageData support for all image handling functions (#525)

* added ImageData support to YOLO

* adds ImageData support to UNET

* adds ImageData support to StyleTransfer

* adds ImageData support to PoseNet

* adds ImageData support for ImageClassifier/darknet

* adds ImageData support for ImageClassifier/doodlenet

* adds ImageData support for BodyPix and cleans up conditionals

* adds ImageData support to faceApi and cleans up conditionals

* adds ImageData support for imageclassifier and cleans up conditional

* fix image handling for bodypix faceapi and imageclassifier

* update mobilenet imageData support

* check imagedata in yolo

* adds ImageData test to BodyPix

* adds check for canvas (#526)

* Fixes Posenet input arguments and related issues (#529)

* adds this.multiPose() to else{}

* fixes conditional check on object or string

* added kmeans

* added randomSample function

* re-ordered name placement

* fixed weird indentation error

* indentation

* removed optional keyword in docstring

* updates issue and pull request templates (#530)

* Created config class attribute to store instance params

* Adds release script helper (#534)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* Adds release script helper (#535)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* adds tagging to release:publish

* fixes typo

* added test to kmeans (#536)

* docs: add jwilber as a contributor (#537)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add tezzutezzu as a contributor (#538)

* docs: update README.md

* docs: update .all-contributorsrc

* Update Contributing and Github docs (#539)

* updated issue template:

* update PR template

* added new release how to

* docs: add EmmaGoodliffe as a contributor (#545)

* docs: update README.md

* docs: update .all-contributorsrc

* Update tfjs ~v1.2.2 (#544)

* updated tfjs to 1.2.2 and bumped face-api to 0.20.1

* bump tensorflow models

* bump body-pix version

* adds version 2 to feature extractor

* updated to mobilenetv2 api

* updates to posenet 2 api

* always process and resize images in mobilenet

* update test with version 2

* update posenet inputs and test

* fix issue with params in posenet

* updates conditional in p5Utils

* add loadImage test (#549)

* Update npm helper scripts for making releases (#552)

* updating release process scripts and docs

* updated release proces npm scripts and docs

* added release:sync and developement:sync"
"

* set fe to mobilenet v1 - use layers model (#554)

* Adds Docsify to consolidate documentation (#556)

* add docsify-cli as dev dep

* adds docs structure for docsify

* adds bodyPix documentation example

* update bodypix documentation

* adds imageClassifer docs

* added styleguide template and updated docs

* changed name of reference template

* added dev guidelines

* update dev guidelines

* adds posenet docs

* adds tutorials and faq

* add dev:docs npm script

* adds char rnn to docs

* Adds documentation for references to docsify docs (#557)

* add note on all contributors bot

* adds faceapi header img"

* adds design guidelines

* adds design guidelines to sidebar

* adds section for p5 web editor examples

* adds cvae refs

* update bodypix and charrnn docs

* added dcgan docs

* adds pitch detection docs

* adds featureExtractor docs

* adds knn classifier

* update tutorial refs

* adds pix2pix doc

* adds sentiment docs

* adds sketchrnn ref

* adds sound classifier

* adds styletransfer docs

* adds unet docs

* adds word2vec docs

* adds yolo docs

* adds acknowledgements section

* adds acknowledgements section

* Fixes Doodlenet - set new axes and .floor() (#559)

* change split axis to 3 axes

* use floor() instead of round()

* adds options for detection confidence (#561)

* Adds labels to custom image classification model from Teachable Machine output

* Addressing issue #590 part 1 (#592)
>The saved labels from Teachable Machine should be loaded by ml5. I believe this is working for sound classification, but not for images.

Fetching labels from metadata.json when loading models from the new Teachable Machine.

* docs: add EonYang as a contributor (#593)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lydiajessup as a contributor (#594)

* docs: update README.md

* docs: update .all-contributorsrc

* set alias for sidebar (#598)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* [Docs] Uses gh-pages to serve docsify docs (#599)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* adds header nav to docs

* updates alt text and image url

* adds getting started url

* adds reference index

* updates href to reference in nav (#601)

* [face-api] Removes expressions support from face-api in ml5.js (#602)

* rm faceapi expressions support

* rm expression ref in comment

* updates tests for faceapi

* fixes single detection and tests

* Update docs (#603)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* Revert "Update docs (#603)" (#604)

This reverts commit c6b78d0a7aedc7050a095386ad88300d91a761b2.

* Updates docsify docs (#605)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* rm neural net class from update-docs branch

* moves bodyPix to support preload() (#610)

* Adds preload support to faceApi  (#611)

* moves bodyPix to support preload()

* adds faceapi to preload

* Updates Docs with latest features (#612)

* adds face-api updates and neural network docs updates

* adds docs for nn functions

* adds save and load docs

* adds neural Network documentation

* fixes backticks

* adds sidebar dividers

* adds docs on model loading and contributors (#616)

* Updates gh templates (#617)

* updates PR template

* updates gh issues template

* updates template

* Generic Neural Network class (#485)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds blob reader for json

* [diy nn] moves tf-vis visualizations to helper class (#583)

* adds tfvis to neuralNetworkVis.js

* adds tfvis to class

* handle text and convert to json (#584)

* allow user more control in the case of classification

* allow user more control in the case of classification (#585)

* Refactoring DIY Neural Network (#591)

* [wip] refactoring data handling and logic separation

* wip adding convertRawToTensor

* adds conversion to tensor

* adds normalization step

* adds train()

* adds predictInternal()

* fixes unique value mapping issue

* comment out .print()

* return all regression results

* adds experimental normalizationOptions object

* quick fix for checking if normalizationOptions exists

* commenting out auto tensor printing

* adds checks for normalizationOptions

* fix obj ref in conditional

* adds .normalizeData() - keeps .normalize() for now

* changes whileTraining function when debug is true

* adds layer options for adding more than 2 layers - experimentalgit add .

* remove .normalize() in favor of .normalizeData()

* adds save() and load()

* adds data.warmUp() to allow training without normalization - handled internally on train

* updates outputs of .predict() and .classify() to be array

* Divide by 0 issue when data is not normalized (#596)

* skipping calculating inputMin and inputMax when data not normalized

* adds check for this.data.meta.isNormalized in predictInternal

* Diy nn code cleanup (#606)

* adds input/output checks to specify number or array of input/output names

* moves model creation to training to compile after input and output units have been calcd

* cleanup code in .trainInternal()

* move vars up to top of function in .trainInternal()

* rm model creation from .createModelFromDataInternal()

* code cleanup and adds comments to .initializeIOUnits()

* code cleanup

* [DIY NN] Adds .saveData() and .loadData() (#607)

* adds saveData function

* updates saveData() with input checks

* adds loadData function

* [Diy NN] Adds .predictMultiple() for batch predictions/classifications (#609)

* adds predictMultiple()

* rm ys.print()

* moves bodypix and faceapi to preload support to match base branch

* [DIY nn] Neural Net Fixes loading pre-trained model (#613)

* adds model_meta.json to savedfiles

* adds loading of model_meta.json - temp fix

* use substring method for url checking

* adds check for if input is JSON

* loadData and text variables mixed up (#615)

* [Diy nn] fix model loading load (Work in progress) (#618)

* adds input object as param to .load()

* adds fetch to retrieve data from urls in .load() based on object

* updates object handler

* fixes check for model.json

* fixes parsing and ordering files

* adds fix for p5 web editor - must use explicit json object to load models

* allows user to add video to .segment() and .segmentWithParts() (#619)

* updates unet docs (#620)

* adds basic test for defaults (#621)

* docs: add EmmaGoodliffe as a contributor (#622)

* docs: update README.md

* docs: update .all-contributorsrc

* adds fix for unet image return for p5 (#625)

* updates webpack dev server to 3.1.11 (#629)

* Fixes vulnerabilities noted by npm (#630)

* run npm audit fix

* bumps commitizen dep

* updated readme and readme updater (#632)

* Update NeuralNetwork docs (#631)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

…
joeyklee added a commit that referenced this pull request Nov 14, 2019
* [devops] Merges fixes in release to development (#698)

* [v0.4.2] v0.4.2 (#685)

* [neural net fix] Merges neural net fix in release to development branch (#676)

* ml5 release v0.4.0 (#640)

* Updates dev with release and Removes /dist from past commits and future dev (#479)

* Remove unnecessary tf.tidy call

* Implement (err, value) callback style, add test for LSTMGenerator

* Callbackify Mobilenet.classify and Mobilenet.regressor

* Add events dep

* add travis.yml

* remove circleci

* removing test script

* removing package-lock.json

* update yarn.lock

* set up browserstack

* snapshot

* yarn test-travis from .travis.yml

* chmod +x trest-travis

* shebang

* bs launcher

* access key

* add a log

* kick travis

* snapshot

* change browserstack env names

* Added Browserstack badge

* Resolve https://github.com/ml5js/ml5-library/pull/151#discussion_r196475143

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196484426

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196517984

* Address https://github.com/ml5js/ml5-library/pull/151#discussion_r196518890

* Add license to callCallback, return this from ImageClassifier#loadModel

* Add mocha reporter back, try to make classes thenable

* Update karma configuration

- Fixes a weird bug where tensors were spuriously disposed by tfjs in testing environment due to there being multiple tfjs instances present on the page from the different builds
- Improves stack traces to make debugging easier by disabling minification in karma webpack.
- Only webpack the main package, this means that the test files have to use the global ml5 object.

* Add tests for Word2Vec

- validates that there are no leaked tensors
- validates basic functionality of nearest
- validates that add, subtract and average return things

- Fixes memory leaks in add, subtract, average, and addOrSubtract functions
- Adds a general dispose to the Word2Vec class

* Remove console.log

* Add an easy way to run test suite once

* Handle rejected promises

* fix eslint errors in lstm and w2v

* Support for callbacks in word2vec and fix tests.
Moved the YOLO weights to the examples repo.
Fix eslint in some files

* Add tests to imageclassifier
fix video issue in imageclassifier

* - Add test for YOLO
- Add test for Imageclassifier
- Resize img if necessary in utils

* - Add license to test files
- Style transfer test
- remove .test file in posenet

* - Update poseNet version to 0.1.3
- Add posnet test

* test commit

* - Fix issues in imageclassifier

* - update pitch detection to #158
- fix event emmiter in posenet
- fix constructor in yolo
- async video util

* temp fix to test leak

* Fix posenet on video ready

* refactor pix2pix to support promises

* support promise when create a new styletransfer method

* bump to version 0.1.0

* bump to 0.1.1

* update readme

* clarification and formatting changes to ensure steps are easy to follow

* ImageClassifier: predict: handle unsupported input

* add proper attributions for models

* Update index.js

* fix eslint for links

* Update index.js

* Update index.js

* Update index.js

* Update README.md (#207)

* Support canvas elements and canvases from p5.js in ImageClassifier (#206)

* Bugfix: PitchDetection returning the wrong pitch (#187)

When converted to the current syntax, the operation was the wrong way around.
See https://github.com/marl/crepe/blob/gh-pages/crepe.js#L141 for the original.

*  fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video) (#191)

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with v

* fix(addImage, classify, predict): now featureExtractor works with images (it was working only with video

* added darknet reference and darknet tiny classifiers (#201)

* added darknet reference and darknet tiny classifiers

* fixed linting stuff

* edits..

* edits2.0

* clean comments

* SketchRNN  (#189)

* init sketchrnn

* strokes

* add models

* stylefixes

* some more bugfixes

* comments

* update dependencies

* Load and save a custom model created with FeatureExtractor  (#219)

* load and save feature extractor model

* update learning rate

* add string an callback

* KNN Classifier (#171)

* added KNNClassifier class, and getFeatures method in ImageClassifier

* added knnclassifer.loaddataset, and savedataset from/as json file

* added featureExtractor.infer() to take in p5 videoelement

* support callback, and add 'label' for each class

* added getClassExampleCountByLabel, support label when save/load dataset

* update function naming, predictClass to classify, classLabel to label

* updates to way of handling strokes (#228)

* Fixing up SketchRNN (#232)

* Code of Conduct (#225)

Just noticing we don't have a code of conduct so adding to the main library repo (we can discuss whether we should put this across all repos -- probably, yes?) This is the [Contributor Covenant](https://www.contributor-covenant.org/).

* saving feature extrctor model with ml5Specs (#233)

* Stateful LSTM (#234)

* allow passing in of lstm state c and h. return more lstm info (c, h, probabilities)

* fix LSTM Stateful ness and other tweaks

* LSTM probabilities class property

* remove weird ind<100 check

* remove unnessecary initCells

* add LSTM methods state getter, setter and reset

* rename to charRNN and update stateful to match discussed api

* add callback to feed

* fix bug in predict

* adding new probabilites object

* new build

* Additional arguments option for SketchRNN (#237)

* Fixing up SketchRNN

* arguments fix for SketchRNN interactive

* adding build

* update version

* KNN update (#256)

* let knn.addExample() and classify() accept a plain array as input

* simplify and shorten knn api function names

* rename a variable in clearlabel()

* knn.save checks if file name has .json

* remove timestamp in the filename for .save()

* update package-loack to fix travis test on node 10

* update yarn lock

* fix - adds callback support for single functions in posenet re: #244 (#254)

* fix(adds callback support for single functions in posenet https://github.com/ml5js/ml5-library/issue

adds callback support for single functions in posenet
https://github.com/ml5js/ml5-library/issues/244

https://github.com/ml5js/ml5-library/issues/244

* rm package-lock.json

* fix(PoseNet/index.js): Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244

Add support for PoseNet `.singlePose()` & `.multiPose()` callback #244 & updated callback error
handling

#244

* rm error check when returning callback in posenet singlePose & multiPose

* fixed indentation

* temp rm cb function

* added cb function back in

* added yarn and package lock

* added lock files from ml5 master

* updating to version 0.2.0 (#264)

* V0.2.1 Tagged Release (#267)

* updating to version 0.2.0

* run build process and built lib

* Release v0.2.1 - npm publish issue

* added github issue template (#275)

* add different ways of including ml5js on the HTML header (#268)

(We will follow up and update the version to the latest which is v0.2.1)

* updated readme specifying versions for lib (#282)

* fix: Use Blobs to save files of larger sizes (#271)

* fix: Use Blobs to save files of larger sizes

fix #270

* use saveBlob() to save knn models, delete io.saveFile(), because saveBlob does the same thing and can handle big files

* Show the version number of the library. (#283)

Adds the library version from the package.json for each build.

* fix issue that server fails to listen dev folder (#287)

*     feat(KNNClassifier): Add loadData() that enables user to load dat… (#279)

*     feat(KNNClassifier): Add loadData() that enables user to load dataset from raw data instead of file

    With load(), file path needs to be provided to load dataset. This means that JSON file that has
    dataset needs to be located on the server. You can give a way to download dataset using save(), but
    you cannot give a way to upload that file and load the dataset. This commit adds loadData() that
    enables user to load dataset from raw data. By combining this method and <INPUT type="file"> tag,
    you can give a way for user to upload dataset file.

* Merge load(path, callback) and loadData(data, callback) into load(pathOrJson, callback).

* Merge load() and loadData() in a cleaner way without using Symbol.

Ref. https://github.com/ml5js/ml5-library/pull/279#issuecomment-465890231

* feat(src/PoseNet/index.js): Ability to access parts of pose by name.

Now can simply do pose.nose.x or pose.nose.confidence. Using original PoseNet naming scheme (i.e.
rightShoulder).

re #245

* Update ImageClassifier and FeatureExtractor to return [{label, confidence}] (#292)

* change imageClassifier.predict() to classify(), keep predict until later version

* update imageclassifier.classify results to [{label: .., confidence: ..}]

* update featureExtractor regressor return {value: 0-1}

* update featureextractor.classify to return [{label, confidence}]

* Support p5 preload with ml5 functions (#288)

* support p5 preload with ml5 functions

* make withPreload object clean

* an automatic script to initialize experiments dir (#295)

* an alternative way to test with experiments dir

* revert change for webpack.dev

* Change experiments to manual-test

* rename folder to manual-test

* update .gitignore

* patch style transfer for non-square and canvas-derived inputs (#311)

* fix preload bugs (#305)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* Release v0.2.2 🎉 (#331)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Hi! I noticed that the changes made here: https://github.com/ml5js/ml5-library/pull/295 have not made their way into the documentation! (#318) (#319)

* Updated issues template and added PR template (#315)

* added github issue template

* updated issue template

* updated ISSUE_TEMPLATE with friendlier wording and structure

* added pr template

* added branch notes

* Updated CONTRIBUTING.md with npm run manual-test

* Add tests to CharRNN (#307) (#320)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Updated CONTRIBUTING docs and README (#322)

* updated readme specifying versions for lib

* added documentation to contributing.md

* added updates

* added label and confidence as output for yolo results (#316)

* added label and confidence as output

* updates yolo test to use label instead of className

* Increase test timeout (#321)

* added label and confidence as output

* updates yolo test to use label instead of className

* set jasmine.DEFAULT_TIMEOUT_INTERVAL to 60000ms

* Merges in https://github.com/ml5js/ml5-library/pull/313 via master using deprecating-master branch (#323)

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* added v0.2.2 to package.json in anticipation of new release

* Fixing an issue with prettier and eslint (#324)

* Fixing an issue with prettier and eslint

There is a conflict between arrow syntax rules in airbnb eslint
configuration and the way default prettier works in VSCode. These
additional setting should help anyone using VSCode with autoformat +
prettier to not run into problems building the library.

I am open to better ways of handling this of course!

(Note the changes in ImageClassifier are trivial and just testing).

* adding eslint-config-prettier as dev dependency

* trivial change to run tests again

* Adjust charrnn test option length (#326)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* Adjust charrnn length - comment 2nd test for now (#329)

* changed 500 to 100 to shorted test time

* fixed .tobe() to match option

* changed vocab size to 64

* changed timeout to 12000

* comment out second charRNN test for now to allow merging PRs

* Forcing magenta dependency to 0.1.2 (#328)

The SketchRNN example doesn't work with more recent magenta (0.1.4)
probably due to us lagging behind in versions of tf.js?

* SketchRNN creation function should be lowercase (#325)

This is related to the discussion in #297.

* added v0.2.2 to package.json in anticipation of new release (#330)

hooray adding release v0.2.2

* added latest v0.2.2

* Some minor README adjustments (#334)

* I am de-emphasizing `@latest` as in my experience this can lead to confusion.
* I don't think my name needs to be referenced!

* V0.2.3 (#341)

* ran npm install, added new package json version, and built dist

* updated package lock

* updated package lock and ran build

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* 🌈 New Release: ml5.js v0.3.0 🎉 (#386)

* add ImageData as valid image type

* add CVAE

* add latent dim

* add random generate

* fix p5Image support

* fix CVAE parameter

* Added a parameter to the save function so that it is possible to add a custom filename to the model that is saved.

* Unet fix (#357)

Add uNet model and additional fixes

- adds uNet model from @zaidalyafeai ✨
- adds preload() for uNet
- uses loadImage on window.loadImage vs. window.p5.loadImage

* Added sentiment analysis (#339)

* Added sentiment analysis

* delete files

* fixed issues for pull request

* add p5 utils (#358)

* fix charRNN tests (#349)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* Add tests to CharRNN (#307)

* add tests to CharRNN

* test(CharRNN): add tests to CharRNN

added descriptive tests to ensure CharRNN behaves like its example

* remove dist

* check preload support for other nets and classifiers (#313)

Adds specified nets to support preload // TODO: add examples showing appropriate use of preload

* change CharRNN specs to meet time limit, add initial code for videoClassifier

* videoClassifier functioning

* charRNN functional

* fix out of date file

* add preload support for cvae (#360)

* Update TensorFlow.js to 1.0.2 (#336)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* Adds fixes to PR #332 for tfjs 1.0.2 updates (#366)

* upgrade to tfjs1.0.0

* fix loadModel

* fix buffer

* fix getLayer

* updated package lock

* added @tensorflow/tfjs-core as dependency

* add graphmodel for infer (#365)

* Add DCGAN Model into ml5 (#351)

* Create index.js

* updated index.js and DCGAN/index.js

* DCGAN updates and fixes (#362)

* Create index.js

* fixed DCGAN errors

* updates p5Utils destructuring, fixes linting issues, and updates tfjs to 1.0.2 to match dcgan reqs

* fixed cvae

* use this.model instead of using model as param to this.compute()

* Makes UNET compatible with tfjs 1.0.2 (#367)

* added package-lock

* updated UNET for use with tfjs 1.0.2

* Makes Sentiment compatible with tfjs 1.0.2 (#368)

* added package-lock

* rm sentiment-node

* changed loadModel to loadLayersModel

* Makes CVAE compatible with tfjs 1.0.2 (#369)

* added package-lock

* updates cvae to tfjs 1.0.2 api

* update tfjs to 1.1.2 (#373)

* featureExtractor: accept HTML canvas or p5 canvas when addImage(), classify() or predict()

* fix: KNNClassifier accepts a number as class index when addExample(features, number)

* added check for moz browser ref:https://stackoverflow.com/questions/48623376/typeerror-capturestream-is-not-a-function (#375)

This addresses the video capture breaking in YOLO and potentially other video based functions that require the use of .captureStream(). As the .captureStream() function is still experimental, this adds the moz prefix and a browser check to see if we are using firefox or not.

* rm todo

* updated package-lock.json

* Adds label number option to featureExtractor.classification()  (#376)

* changed numClasses to numLabels

* added num label as option to classification()

* updated FeatureExtractor Test with numLabels

* adds object as param to .classificaiton()

* moved options into this.config

* fix feature extractor test - add .config

* added pose:poseWithParts into .singlePose() (#381)

* Adds jsdoc inline-documentation - work in progress (#378)

* added jsdoc documentation for imageClassifier

* adds dcgan documentation - needs checking

* Add jsdoc (#382)

* Add jsdocs for CharRNN

* Add jsdocs for CVAE

* Add jsdocs for FeatureExtractor

* Add jsdocs for KNN

* Add jsdocs for PitchDetection

* Add jsdocs for Pix2pix

* Add jsdocs for posenet

* Add jsdocs for Sentiment

* Add jsdocs for styletransfer

* add linebreaks to long lines

* added basic docs to sketchRnn

* added basic docs to unet

* added basic docs to word2vec

* added basic yolo docs

* Adds V0.3.0 to package.json and Readme for new release (#385)

* changed package.json to v0.3.0

* added latest version reference in readme

* added lib min - will remove after this release

* added ml5.imageClassifier(doodleNet)

* doodlenet: transfer input img to black white image

* warm up model, comments

* added ml5.soundClassifier(speech-command)

* Revert "added ml5.soundClassifier(speech-command)"

This reverts commit 317c146450d65aa1ad9f1ef67bf912a792b0d8a0.

* update darknet link to use jsdelivr instead (#391)

* changed cdn link to doodlenet model (#390)

* adding ml5.soundClassifier(speech-commands) (#389)

* added ml5.soundClassifier(speech-commands)

* not require fs node module for testing

* Reuse getTopKClasses in doodlenet, darkneet and speech-commands

* fix: getTopKClasses return className and probability

* DCGAN refactor + preload (#398)

* restructure dcgan to accept path to manifest.json

* added check for absolute or relative url path

* rm console.log

* added DEFAULT if modelPath is null or undefined in jsonLoader

* use async/await in loadModel

* add dcgan to preload

* fixed breaking change

* updated index

* added modelReady prop

* shows preload working without additional async call to load manifest

* allows for preload

* added a bird image for testing purpose

* update bird image link from ml5-library for testing (#403)

* renaming model names to ml5.soundClassifier(SpeechCommands18w) (#404)

* ml5.featureExtractor loading models from the new teachable machine (#395)

* load model from new teachable machine

* featureExtractor use jointModel

* only train custom model but save the joint model

* Bodypix (#400)

* added BodyPix placeholder

* "@tensorflow-models/body-pix": "1.0.1",

* initial commit placeholder for bodypix

* added bodypix as bp and loadModel()

* added segment and segmentInternal

* change promise to async

* return result maskPerson and maskBackground

* adds part segmentation

* rm log

* add segmentation as result.raw

* add function to create bodyParts spec object

* added test

* added optional segmentationOptions param to segment() and segmentWithParts()

* added package.lock

* updated DEFAULTS to BODYPIX_DEFAULTS

* code cleanup

* added comments

* added jsdoc comments

* add check p5 color()

* updated bodyPartSpec image color handling for p5

* changed palette spec to object

* ml5.imageClassifier() loads pre-trained custom model (#408)

* imageClassifier load a model from url

* added options to local model from local files

* supports imageClassifier.classify(video)

* ml5.soundClassifier(url)

* docs: add shiffman as a contributor (#410)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#414)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* rm files to start fresh (#417)

* docs: add shiffman as a contributor (#418)

* docs: update README.md

* docs: create .all-contributorsrc

* docs: add cvalenzuela as a contributor (#419)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add yining1023 as a contributor (#421)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add handav as a contributor (#423)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add joeyklee as a contributor (#424)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AshleyJaneLewis as a contributor (#425)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add ellennickles as a contributor (#426)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add itayniv as a contributor (#427)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nikitahuggins as a contributor (#428)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AbolTaabol as a contributor (#429)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AidanNelson as a contributor (#430)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add WenheLI as a contributor (#431)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add dariusk as a contributor (#432)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Derek-Wds as a contributor (#433)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add garym140 as a contributor (#434)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add genekogan as a contributor (#435)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hhayley as a contributor (#436)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lisajamhoury as a contributor (#437)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add matamalaortiz as a contributor (#438)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add mayaman as a contributor (#439)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add MimiOnuoha as a contributor (#440)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add NHibiki as a contributor (#441)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add oveddan as a contributor (#442)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add stephkoltun as a contributor (#443)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add viztopia as a contributor (#444)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add wenqili as a contributor (#446)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add brondle as a contributor (#447)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Jonarod as a contributor (#448)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add JazzTap as a contributor (#449)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add zaidalyafeai as a contributor (#450)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add AlcaDesign as a contributor (#451)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add memo as a contributor (#452)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add TheHidden1 as a contributor (#453)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add meiamsome as a contributor (#454)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add marshalhayes as a contributor (#455)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add reiinakano as a contributor (#456)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nsthorat as a contributor (#457)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add irealva as a contributor (#458)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add vndrewlee as a contributor (#459)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add fjcamillo as a contributor (#460)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add achimkoh as a contributor (#461)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add hx2A as a contributor (#462)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add champierre as a contributor (#465)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add micuat as a contributor (#466)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add montoyamoraga as a contributor (#467)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add b2renger as a contributor (#468)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add adityaas26 as a contributor (#469)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add okuna291 as a contributor (#470)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xujenna as a contributor (#471)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add nicoleflloyd as a contributor (#472)

* docs: update README.md

* docs: update .all-contributorsrc

* updated package-lock

* pass vector to dcgan compute

* Adds face-api.js to ml5.js (#482)

* initial commit - add classifyExpressions

* added classifyExpressionsMultiple() and classifyExpressionsSingle()

* remove modelPath requirement in favor of defaults

* updated index with links to tiny landmarks

* adds option to add relative path or absolute url

* updated url checking for models

* changed function names

* updated functions to .detect() and .detectSingle()

* check undefined, otherwise assign

* added resize function to results by default

* code cleanup

* added test to faceapi

* added tests

* added face parts to result.parts

* code cleanup

* changed options from withFaceX to withX

* code cleanup

* code cleanup

* fixed conditional to include face .withFaceDescriptor(s)

* docs: add jepster-dk as a contributor (#489)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add xanderjakeq as a contributor (#490)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add catarak as a contributor (#491)

* docs: update README.md

* docs: update .all-contributorsrc

* [WIP]Change p5Utils into a class

* dcgan: use random vector if no latent vector is given

* dcgan check if arg is array

* updated code of conduct with adapted p5 community statement (#492)

* updated code of conduct with adapted p5 community statement

* Update CODE_OF_CONDUCT.md

rm coding train from donation // todo - add other relevant orgs next

Co-Authored-By: Daniel Shiffman <daniel.shiffman@gmail.com>

* updated enforcement with ashley and dan

* rm redundant all contributors badge (#497)

* Readme updates (#505)

* added package.lock

* updates links to latest website

* rm 'with no external deps'

* set correct url to image (#507)

* docs: add dcbriccetti as a contributor (#506)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add Sblob1 as a contributor (#513)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: update README.md

* docs: update .all-contributorsrc

* Fu

* add command line arguments for testing single model

* Handling p5 Image in PoseNet singlePose

I have changed singlePose function in order to handle p5 Image types. 

However I'm not sure if the check is thorough enough. Any pointers are welcome.

* Adds ImageData support for all image handling functions (#525)

* added ImageData support to YOLO

* adds ImageData support to UNET

* adds ImageData support to StyleTransfer

* adds ImageData support to PoseNet

* adds ImageData support for ImageClassifier/darknet

* adds ImageData support for ImageClassifier/doodlenet

* adds ImageData support for BodyPix and cleans up conditionals

* adds ImageData support to faceApi and cleans up conditionals

* adds ImageData support for imageclassifier and cleans up conditional

* fix image handling for bodypix faceapi and imageclassifier

* update mobilenet imageData support

* check imagedata in yolo

* adds ImageData test to BodyPix

* adds check for canvas (#526)

* Fixes Posenet input arguments and related issues (#529)

* adds this.multiPose() to else{}

* fixes conditional check on object or string

* added kmeans

* added randomSample function

* re-ordered name placement

* fixed weird indentation error

* indentation

* removed optional keyword in docstring

* updates issue and pull request templates (#530)

* Created config class attribute to store instance params

* Adds release script helper (#534)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* Adds release script helper (#535)

* adds release helper function

* update name and sep step for release:push

* add release:publish

* adds tagging to release:publish

* fixes typo

* added test to kmeans (#536)

* docs: add jwilber as a contributor (#537)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add tezzutezzu as a contributor (#538)

* docs: update README.md

* docs: update .all-contributorsrc

* Update Contributing and Github docs (#539)

* updated issue template:

* update PR template

* added new release how to

* docs: add EmmaGoodliffe as a contributor (#545)

* docs: update README.md

* docs: update .all-contributorsrc

* Update tfjs ~v1.2.2 (#544)

* updated tfjs to 1.2.2 and bumped face-api to 0.20.1

* bump tensorflow models

* bump body-pix version

* adds version 2 to feature extractor

* updated to mobilenetv2 api

* updates to posenet 2 api

* always process and resize images in mobilenet

* update test with version 2

* update posenet inputs and test

* fix issue with params in posenet

* updates conditional in p5Utils

* add loadImage test (#549)

* Update npm helper scripts for making releases (#552)

* updating release process scripts and docs

* updated release proces npm scripts and docs

* added release:sync and developement:sync"
"

* set fe to mobilenet v1 - use layers model (#554)

* Adds Docsify to consolidate documentation (#556)

* add docsify-cli as dev dep

* adds docs structure for docsify

* adds bodyPix documentation example

* update bodypix documentation

* adds imageClassifer docs

* added styleguide template and updated docs

* changed name of reference template

* added dev guidelines

* update dev guidelines

* adds posenet docs

* adds tutorials and faq

* add dev:docs npm script

* adds char rnn to docs

* Adds documentation for references to docsify docs (#557)

* add note on all contributors bot

* adds faceapi header img"

* adds design guidelines

* adds design guidelines to sidebar

* adds section for p5 web editor examples

* adds cvae refs

* update bodypix and charrnn docs

* added dcgan docs

* adds pitch detection docs

* adds featureExtractor docs

* adds knn classifier

* update tutorial refs

* adds pix2pix doc

* adds sentiment docs

* adds sketchrnn ref

* adds sound classifier

* adds styletransfer docs

* adds unet docs

* adds word2vec docs

* adds yolo docs

* adds acknowledgements section

* adds acknowledgements section

* Fixes Doodlenet - set new axes and .floor() (#559)

* change split axis to 3 axes

* use floor() instead of round()

* adds options for detection confidence (#561)

* Adds labels to custom image classification model from Teachable Machine output

* Addressing issue #590 part 1 (#592)
>The saved labels from Teachable Machine should be loaded by ml5. I believe this is working for sound classification, but not for images.

Fetching labels from metadata.json when loading models from the new Teachable Machine.

* docs: add EonYang as a contributor (#593)

* docs: update README.md

* docs: update .all-contributorsrc

* docs: add lydiajessup as a contributor (#594)

* docs: update README.md

* docs: update .all-contributorsrc

* set alias for sidebar (#598)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* [Docs] Uses gh-pages to serve docsify docs (#599)

* update docsify config

* testing pathways

* adds sublevel 2

* rm sidebar comment

* testing sidebar nested list issue

* relative path is false - using gh-pages

* testing - pls ignore

* testing plugin issue

* drop alias

* added no jekyll to root"

* testing pathway for images

* rm dot from path

* set rel path

* changed images to _media

* use _media path for images

* adds header nav to docs

* updates alt text and image url

* adds getting started url

* adds reference index

* updates href to reference in nav (#601)

* [face-api] Removes expressions support from face-api in ml5.js (#602)

* rm faceapi expressions support

* rm expression ref in comment

* updates tests for faceapi

* fixes single detection and tests

* Update docs (#603)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* Revert "Update docs (#603)" (#604)

This reverts commit c6b78d0a7aedc7050a095386ad88300d91a761b2.

* Updates docsify docs (#605)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds face-api and neural-network placeholder

* adds section for web editor

* set to /tree/development and adds posenet examples

* adds link to src code

* updates references to examples

* sets tree/development as path

* updates face-api and neural net docs

* rm neural net class from update-docs branch

* moves bodyPix to support preload() (#610)

* Adds preload support to faceApi  (#611)

* moves bodyPix to support preload()

* adds faceapi to preload

* Updates Docs with latest features (#612)

* adds face-api updates and neural network docs updates

* adds docs for nn functions

* adds save and load docs

* adds neural Network documentation

* fixes backticks

* adds sidebar dividers

* adds docs on model loading and contributors (#616)

* Updates gh templates (#617)

* updates PR template

* updates gh issues template

* updates template

* Generic Neural Network class (#485)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#581)

* changes for class

* values not value, but this does not match feature extractor regression

* [Diy nn] Fixes output reversal and gives unnormalized data as outputs of predict() (#582)

* unnormalize outputs for regression

* use .reverse() - note: we should use .unshift() where order matters

* code cleanup

* updates config inputs learning rate and code cleanup

* changed value to return result.outputs

* adds blob reader for json

* [diy nn] moves tf-vis visualizations to helper class (#583)

* adds tfvis to neuralNetworkVis.js

* adds tfvis to class

* handle text and convert to json (#584)

* allow user more control in the case of classification

* allow user more control in the case of classification (#585)

* Refactoring DIY Neural Network (#591)

* [wip] refactoring data handling and logic separation

* wip adding convertRawToTensor

* adds conversion to tensor

* adds normalization step

* adds train()

* adds predictInternal()

* fixes unique value mapping issue

* comment out .print()

* return all regression results

* adds experimental normalizationOptions object

* quick fix for checking if normalizationOptions exists

* commenting out auto tensor printing

* adds checks for normalizationOptions

* fix obj ref in conditional

* adds .normalizeData() - keeps .normalize() for now

* changes whileTraining function when debug is true

* adds layer options for adding more than 2 layers - experimentalgit add .

* remove .normalize() in favor of .normalizeData()

* adds save() and load()

* adds data.warmUp() to allow training without normalization - handled internally on train

* updates outputs of .predict() and .classify() to be array

* Divide by 0 issue when data is not normalized (#596)

* skipping calculating inputMin and inputMax when data not normalized

* adds check for this.data.meta.isNormalized in predictInternal

* Diy nn code cleanup (#606)

* adds input/output checks to specify number or array of input/output names

* moves model creation to training to compile after input and output units have been calcd

* cleanup code in .trainInternal()

* move vars up to top of function in .trainInternal()

* rm model creation from .createModelFromDataInternal()

* code cleanup and adds comments to .initializeIOUnits()

* code cleanup

* [DIY NN] Adds .saveData() and .loadData() (#607)

* adds saveData function

* updates saveData() with input checks

* adds loadData function

* [Diy NN] Adds .predictMultiple() for batch predictions/classifications (#609)

* adds predictMultiple()

* rm ys.print()

* moves bodypix and faceapi to preload support to match base branch

* [DIY nn] Neural Net Fixes loading pre-trained model (#613)

* adds model_meta.json to savedfiles

* adds loading of model_meta.json - temp fix

* use substring method for url checking

* adds check for if input is JSON

* loadData and text variables mixed up (#615)

* [Diy nn] fix model loading load (Work in progress) (#618)

* adds input object as param to .load()

* adds fetch to retrieve data from urls in .load() based on object

* updates object handler

* fixes check for model.json

* fixes parsing and ordering files

* adds fix for p5 web editor - must use explicit json object to load models

* allows user to add video to .segment() and .segmentWithParts() (#619)

* updates unet docs (#620)

* adds basic test for defaults (#621)

* docs: add EmmaGoodliffe as a contributor (#622)

* docs: update README.md

* docs: update .all-contributorsrc

* adds fix for unet image return for p5 (#625)

* updates webpack dev server to 3.1.11 (#629)

* Fixes vulnerabilities noted by npm (#630)

* run npm audit fix

* bumps commitizen dep

* updated readme and readme updater (#632)

* Update NeuralNetwork docs (#631)

* skeleton of generic Neural Network

* proof of concept for training and prediction

* use ml5 callcallbac to handle callback or promisek

* added activation to options

* load save model

* adds placeholder to test and adds defaults

* DIY Neural Net Updates  (#568)

* begins restructuring

* adds tfjs-vis and adds generic createModel() function

* adds tf viz and adds loadData function

* adds normalization function

* adds train function

* adds predict function

* work on DIY Neural Network (#569)

* fixing output and hidden activations

* moving data fields config to loadData()

Eventually this should be ml5.utils() or ml5.data()

* trimming whitespace

* rename labels to targets for training output

* using camelCase

* moves shuffle out of normalize

* [WIP] DIY Neural Net with focus on handling data internally (#571)

* adds data obj in class

* adds initialization step

* creates nn data class

* moves functions to data class

* working with titanic

* adds tf vis for training

* changes tf viz show on training is debug is true

* changes optimizer for regression

* adds unNormalize function

* fix normalization

* rm log

* refactors out to sep modules

* adds options to train

* adds options to train

* adds comments

* adds input/output array function

* removes i/o label check

* fixes optionOrCallback

* fix test

* adds comments

* updates data handling

* updates normalization data handling

* DIY NN data handling updates (#572)

* set up scaffold for creating inputs

* added output scaffolding - turn into functions todo

* adds function to encode data with ontHot or not

* ensure inputTypes/outputTypes exist

* [In progress] DIY NN - handles json and csv loading (#573)

* adds placeholders for json and csv loader'

* add json parsing

* adds true flag to normalization to fix broken function

* Fixes normalization function for NN (#575)

* adds possible fix - moves norm to external function

* adds correctly ordered data

* DIY Neural Network: Handles onehot() encoding for inputs and outputs in normalization (#576)

* adds correct input structure - accounts for onehot inputs

* code formatting and cleaning

* fixes need for onehot in classification for numeric output

* adds whileTraining cb support to train (#577)

* regression needs to pickup learning rate

* Adds temporary fixes for i/o values given to/output by .predict() (#578)

* adds min and max to meta and checks predict sample and forces array

* adds onehot encoding legend

* updating input handling for predict()

* adds label,confidence output for classification

* fix merge conflicts

* rm log

* need to use inputUnits and not input length

* [WIP] Fixes for before class (#58…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants