Skip to content

Commit 3155da2

Browse files
authored
Adds teachable machine references in docs (#633)
* adds teachable machine reference in imageClassifier * adds soundClassifier Teachable machine references
1 parent 76a5eed commit 3155da2

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

docs/reference/image-classifier.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ You can use neural networks to recognize the content of images. ml5.imageClassif
1111

1212
It should be noted that the pre-trained model provided by the example below was trained on a database of approximately 15 million images (ImageNet). The ml5 library accesses this model from the cloud. What the algorithm labels an image is entirely dependent on that training data -- what is included, excluded, and how those images are labeled (or mislabeled).
1313

14+
**Train your own image classification model with Teachable Machine**: If you'd like to train your own custom image classification model, try [Google's Teachable Machine - coming soon!](https://teachablemachine.withgoogle.com/io19)
15+
1416
## Quickstart
1517

1618
```js
@@ -38,7 +40,23 @@ const classifier = ml5.imageClassifier(model, ?video, ?options, ?callback)
3840
```
3941
4042
#### Parameters
41-
* **model**: REQUIRED. A String value of a valid model OR a url to a model.json that contains a pre-trained model. Case insensitive. Models available are: 'MobileNet', 'Darknet' and 'Darknet-tiny', or any image classifiation model trained in Teachable Machine.
43+
* **model**: REQUIRED. A String value of a valid model OR a url to a model.json that contains a pre-trained model. Case insensitive. Models available are: 'MobileNet', 'Darknet' and 'Darknet-tiny','DoodleNet', or any image classification model trained in Teachable Machine. Below are some examples of creating a new image classifier:
44+
* `mobilenet`:
45+
```js
46+
const classifier = ml5.imageClassifier('MobileNet', modelReady)
47+
```
48+
* `Darknet`:
49+
```js
50+
const classifier = ml5.imageClassifier('Darknet', modelReady)
51+
```
52+
* `DoodleNet`:
53+
```js
54+
const classifier = ml5.imageClassifier('DoodleNet', modelReady)
55+
```
56+
* Custom Model from Teachable Machine:
57+
```js
58+
const classifier = ml5.imageClassifier('path/to/custom/model.json', modelReady)
59+
```
4260
* **video**: OPTIONAL. An HTMLVideoElement
4361
* **callback**: OPTIONAL. A function to run once the model has been loaded. If no callback is provided, it will return a promise that will be resolved once the model has loaded.
4462
* **options**: OPTIONAL. An object to change the defaults (shown below). The available options are:

docs/reference/sound-classifier.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
The ml5.soundClassifier() allows you to classify audio. With the right pre-trained models, you can detect whether a certain noise was made (e.g. a clapping sound or a whistle) or a certain word was said (e.g. Up, Down, Yes, No). At this moment, with the ml5.soundClassifier(), you can use your own custom pre-trained speech commands or use the the "SpeechCommands18w" which can recognize "the ten digits from "zero" to "nine", "up", "down", "left", "right", "go", "stop", "yes", "no", as well as the additional categories of "unknown word" and "background noise"."
1212

13+
**Train your own sound classifier model with Teachable Machine**: If you'd like to train your own custom sound classification model, try [Google's Teachable Machine - coming soon!](https://teachablemachine.withgoogle.com/io19)
14+
1315
## Quickstart
1416

1517
```js
@@ -44,7 +46,15 @@ const soundclassifier = ml5.soundClassifier(?model, ?options, ?callback)
4446
By default the soundClassifier will start the default microphone.
4547
4648
#### Parameters
47-
* **model**: Optional. Model name or URL path to a `model.json`
49+
* **model**: Optional. Model name or URL path to a `model.json`. Here are some options:
50+
* `SpeechCommands18w`: loads the 18w speech commands
51+
```js
52+
const classifier = ml5.soundClassifier('SpeechCommands18w', modelReady);
53+
```
54+
* Custom model made in Google's Teachable Machine:
55+
```js
56+
const classifier = ml5.soundClassifier('path/to/model.json', modelReady);
57+
```
4858
* **callback**: Optional. A function to run once the model has been loaded.
4959
* **options**: Optional. An object describing a model accuracy and performance. The available parameters are:
5060

0 commit comments

Comments
 (0)