Skip to content

Commit 8109f39

Browse files
committed
bump to 1.1.0 changing requirements to tfjs-node to 1.4.0
1 parent 92ec709 commit 8109f39

File tree

4 files changed

+17
-12
lines changed

4 files changed

+17
-12
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [1.1.0] - 2020-04-22
5+
### Changed
6+
* Updated image on how to use Teachable Machine and configuration node on Step 3
7+
* Use standard image treatment for `README` instead of HTML
8+
* Upgraded to `@tensorflow/tfjs-node v1.4.0` to enable coexistantce with [tfjs-nodes](https://github.com/dceejay/tfjs-nodes) nodes - [#8](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/8)
9+
410
## [1.0.1] - 2020-04-15
511
### Changed
612
* Updated information help node

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# node-red-contrib-teachable-machine
2-
[![platform](https://img.shields.io/badge/platform-Node--RED-red)](https://nodered.org)
2+
[![Platform](https://img.shields.io/badge/platform-Node--RED-red)](https://nodered.org)
33
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bonastreyair/node-red-contrib-teachable-machine)](https://github.com/bonastreyair/node-red-contrib-teachable-machine/blob/master/CHANGELOG.md)
44
[![npm total downloads](https://img.shields.io/npm/dt/node-red-contrib-teachable-machine)](https://github.com/bonastreyair/node-red-contrib-teachable-machine/archive/master.zip)
55
<br>[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
66
[![GitHub license](https://img.shields.io/github/license/dceejay/tfjs-nodes)](https://github.com/dceejay/tfjs-nodes/blob/master/LICENSE)
77

8-
9-
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.
8+
A [Node-RED](https://nodered.org) node based in [tensorflow.js](https://www.tensorflow.org/js) that enables to run custom image classification trained models using [Teachable Machine](https://teachablemachine.withgoogle.com/train/image) tool.
109

1110
<p align="center">
12-
<img src="https://user-images.githubusercontent.com/37800834/79343223-736d7d80-7f2e-11ea-9c85-b83fc73b0952.png" height="100">
11+
<img src="https://user-images.githubusercontent.com/37800834/79343223-736d7d80-7f2e-11ea-9c85-b83fc73b0952.png" height="80">
1312
</p>
1413

1514
## Install
@@ -27,17 +26,17 @@ You have two options to install the node.
2726
### Step 1
2827
Go to [Teachable Machine](https://teachablemachine.withgoogle.com/train/image) and follow the steps to train your custom classification model. Once trained click on the `Export Model` button.
2928

30-
<img src="https://user-images.githubusercontent.com/37800834/79070802-4c1d7300-7cd8-11ea-9c12-03e1d7d8b01d.png" height="300">
29+
![teachable_steps](https://github.com/googlecreativelab/teachablemachine-community/blob/master/teachablemachine.gif)
3130

3231
### Step 2
3332
Select `Tensorflow.js` format and upload your trained model (for free). Once it is uploaded, copy the generated URL.
3433

35-
<img src="https://user-images.githubusercontent.com/37800834/79056723-8431a100-7c59-11ea-9488-346f4f8e6004.png" height="250">
34+
![use_teachable_machine](https://user-images.githubusercontent.com/37800834/79056723-8431a100-7c59-11ea-9488-346f4f8e6004.png)
3635

3736
### Step 3
3837
Paste the saved URL into the node configuration. That URL hosts all the information to load your trained model. Make sure you copy all the given URL including the `https://...`.
3938

40-
<img src="https://user-images.githubusercontent.com/37800834/79343720-10c8b180-7f2f-11ea-90c6-7e70ef7034b1.png" height="250">
39+
![use_url](https://user-images.githubusercontent.com/37800834/80016824-f749db80-84d3-11ea-8817-9f7e42732f8a.png)
4140

4241
### Step 4
4342
In `Node-RED` send a buffered image to the node. Check the example in the `Import` section.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"name": "node-red-contrib-teachable-machine",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "Simplifies integration with Teachable Machine models from Google",
55
"dependencies": {
6-
"@tensorflow/tfjs-node": "1.3.1",
6+
"@tensorflow/tfjs-node": "1.4.0",
77
"@teachablemachine/image": "0.8.4",
8-
"jsdom": "16.2.2",
8+
"jsdom": "16.2.2",
99
"canvas": "2.6.1"
1010
},
1111
"keywords": [

teachable_machine.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports = function (RED) {
66
global.document = dom.window.document
77
// Require basic libraries
88
const tmImage = require('@teachablemachine/image')
9-
const Canvas = require('canvas')
9+
const canvas = require('canvas')
1010
global.fetch = require('node-fetch')
1111
// Teachable Machine needs global scope of HTMLVideoElement class to do a check
1212
global.HTMLVideoElement = class HTMLVideoElement {}
@@ -98,7 +98,7 @@ module.exports = function (RED) {
9898
// Converts the image, makes inference and treats predictions
9999
async function inference (msg) {
100100
setNodeStatus(node, 'infering')
101-
const image = new Canvas.Image()
101+
const image = new canvas.Image()
102102
image.src = msg.image
103103
msg.classes = node.model.getClassLabels()
104104
var predictions = await node.model.predict(image)

0 commit comments

Comments
 (0)