Skip to content

Commit 6cb1f60

Browse files
authored
bump to v1.0.2 (#4)
* added various fixes and improvements. bump to v0.1.1 * set fetch to global this closes issue #3 * version bump and changes to readme file
1 parent 8fee5fc commit 6cb1f60

File tree

4 files changed

+50
-5
lines changed

4 files changed

+50
-5
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
# Changelog
2+
## [0.1.2] - 2020-04-12
3+
### Added
4+
* Improvements on `README` file
5+
6+
### Fixed
7+
* Loading model error `response.arrayBuffer is not a function` found in issue [#3](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/3)
8+
9+
## [0.1.1] - 2020-04-11
10+
### Added
11+
* Comments in the code
12+
13+
### Changed
14+
* Downgraded `@tensorflow/tfjs-node` from version `v1.4.0` to `v1.3.1` for better compatibility
15+
* Output has changed from `checkbox` to a `list`, you can now select `Best predictions` or `All predictions`
16+
* Code cleaning
17+
18+
### Fixed
19+
* WebGL loading error in JSDOM
20+
* When installing the node -> `npm WARN @teachablemachine/image@0.8.4 requires a peer of @tensorflow/tfjs@1.3.1 but none is installed`
21+
222

323
## [0.1.1] - 2020-04-11
424
### Added

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
# node-red-contrib-teachable-machine
2-
A TensorFlow.js node for Node-RED that enables to run custom trained Teachable Machine image classification online models.
2+
A Node-RED](https://nodered.org) node based in [tensorFlow.js](https://www.tensorflow.org/js) that enables to run custom trained models using [Teachable Machine](https://teachablemachine.withgoogle.com/train/image) tool.
33

4-
More content to be generated...
4+
## Install
5+
Use `Manage Palette` option in `Node-RED` Menu or run the following command in your `Node-RED` user directory (typically `~/.node-red`).
6+
```
7+
npm install node-red-contrib-teachable-machine
8+
```
59

6-
Inspired by [@dceejay](https://github.com/dceejay) with [node-red-contrib-tfjs-coco-ssd](https://github.com/dceejay/tfjs-coco-ssd/)
10+
## Node usage
11+
### Step 1
12+
Go to [Teachable Machine](https://teachablemachine.withgoogle.com/train/image) and follow the steps to train your custom classification model.
13+
14+
### Step 2
15+
Once trained the model, click on the `Export Model` button and select `Tensorflow.js` format. Then upload your trained model for free and copy the generated URL.
16+
![upload_teachable](https://user-images.githubusercontent.com/37800834/79056723-8431a100-7c59-11ea-9488-346f4f8e6004.png)
17+
18+
### Step 3
19+
Paste the saved URL into the node. That URL hosts all the information to load your trained model.
20+
![model_URL](https://user-images.githubusercontent.com/37800834/79056644-ec33b780-7c58-11ea-9b69-8e8d4fbfda0c.png)
21+
22+
### Step 4
23+
In 1Node-RED1 Send a buffered image to the node.
24+
25+
## Requirements
26+
* `Node-RED v1.0.0+`
27+
* Supported OS: MacOSX Catalina, Windows 10, Ubuntu 18.04
28+
29+
**NOTE**: This not is not working using official `docker nodered/node-red` [image](https://hub.docker.com/r/nodered/node-red/) since it is based on Alpine and it has an incompatibility found in this [issue](https://github.com/tensorflow/tfjs/issues/1425).
30+
31+
Inspired by [@dceejay](https://github.com/dceejay) with [node-red-contrib-tfjs-coco-ssd](https://github.com/dceejay/tfjs-coco-ssd/).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-contrib-teachable-machine",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"description": "A node to integrate teachable machine models easily.",
55
"dependencies": {
66
"@tensorflow/tfjs-node": "1.3.1",

teachable_machine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function(RED) {
99
// Require basic libraries
1010
tmImage = require('@teachablemachine/image');
1111
Canvas = require('canvas');
12-
fetch = require('node-fetch');
12+
global.fetch = require('node-fetch');
1313
// Teachable Machine needs global scope of HTMLVideoElement class to do a check
1414
global.HTMLVideoElement = class HTMLVideoElement {};
1515

0 commit comments

Comments
 (0)