Skip to content

Commit

Permalink
fixed issue #14, release 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
bonastreyair committed Jun 5, 2020
1 parent 972300d commit ec9cd21
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
*.DS*
*.DS*
.vscode
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.1.3] - 2020-06-05
### Fixed
- Prediction does not work when save_image's box is checked - [#14](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/14)

### Changed
- Dependancy is now `@tensorflow/tfjs v1.3.1` instead of `@tensorflow/tfjs-node v1.4.0`, to match teachable machine correct dependencies

## [1.1.2] - 2020-05-03
### Added
- PayPal donation badge in `README` file
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "node-red-contrib-teachable-machine",
"version": "1.1.2",
"version": "1.1.3",
"description": "Simplifies integration with Teachable Machine models from Google",
"dependencies": {
"@tensorflow/tfjs-node": "1.4.0",
"@tensorflow/tfjs": "1.3.1",
"@teachablemachine/image": "0.8.4",
"jsdom": "16.2.2",
"canvas": "2.6.1"
Expand Down
5 changes: 3 additions & 2 deletions teachable_machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = function (RED) {
const canvas = require('canvas')
global.fetch = require('node-fetch')
// Teachable Machine needs global scope of HTMLVideoElement class to do a check
global.HTMLVideoElement = class HTMLVideoElement {}
global.HTMLVideoElement = class HTMLVideoElement { }

function setNodeStatus (node, status) {
switch (status) {
Expand Down Expand Up @@ -147,8 +147,9 @@ module.exports = function (RED) {
node.on('input', function (msg) {
try {
if (node.ready && node.modelUrl !== '') {
if (node.passThrough) { msg.image = msg.payload }
msg.image = msg.payload
inference(msg)
if (!node.passThrough) { delete msg.image }
} else {
node.error('model is not ready')
}
Expand Down

0 comments on commit ec9cd21

Please sign in to comment.