Skip to content

Commit ec9cd21

Browse files
committed
fixed issue #14, release 1.1.3
1 parent 972300d commit ec9cd21

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
*.DS*
2+
*.DS*
3+
.vscode

CHANGELOG.md

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

4+
## [1.1.3] - 2020-06-05
5+
### Fixed
6+
- Prediction does not work when save_image's box is checked - [#14](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/14)
7+
8+
### Changed
9+
- Dependancy is now `@tensorflow/tfjs v1.3.1` instead of `@tensorflow/tfjs-node v1.4.0`, to match teachable machine correct dependencies
10+
411
## [1.1.2] - 2020-05-03
512
### Added
613
- PayPal donation badge in `README` file

package.json

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

teachable_machine.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = function (RED) {
99
const canvas = require('canvas')
1010
global.fetch = require('node-fetch')
1111
// Teachable Machine needs global scope of HTMLVideoElement class to do a check
12-
global.HTMLVideoElement = class HTMLVideoElement {}
12+
global.HTMLVideoElement = class HTMLVideoElement { }
1313

1414
function setNodeStatus (node, status) {
1515
switch (status) {
@@ -147,8 +147,9 @@ module.exports = function (RED) {
147147
node.on('input', function (msg) {
148148
try {
149149
if (node.ready && node.modelUrl !== '') {
150-
if (node.passThrough) { msg.image = msg.payload }
150+
msg.image = msg.payload
151151
inference(msg)
152+
if (!node.passThrough) { delete msg.image }
152153
} else {
153154
node.error('model is not ready')
154155
}

0 commit comments

Comments
 (0)