Skip to content

Commit 0fe6b7a

Browse files
ready 1.3.0 release + various DevOps enhancements (#25)
* adding pre-commit standard js * Add model reload feature (#24) * add reload functionality * Document reload functionality * version bump * better handling of msg.reload & empty payload * updated doc re: reload function * Update teachable_machine.html Co-authored-by: Yair Bonastre <37800834+bonastreyair@users.noreply.github.com> * Update package.json Co-authored-by: Yair Bonastre <37800834+bonastreyair@users.noreply.github.com> Co-authored-by: Yair Bonastre <37800834+bonastreyair@users.noreply.github.com> * add pre-commit checks * add dependabot * add ci * upgrade npm packages * fixing changelog links * update example * proper import * improve badges * final changelog changes before release * fix ci only on push to main and pull requests Co-authored-by: Jacek <acejacek@gmail.com>
1 parent 7d52747 commit 0fe6b7a

File tree

11 files changed

+506
-130
lines changed

11 files changed

+506
-130
lines changed

.github/dependabot.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
version: 2
3+
updates:
4+
- package-ecosystem: github-actions
5+
directory: /
6+
schedule:
7+
interval: weekly
8+
- package-ecosystem: npm
9+
directory: /
10+
schedule:
11+
interval: weekly

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
jobs:
11+
pre-commit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Install pre-commit
17+
run: pip install pre-commit
18+
- name: Run pre-commit
19+
run: pre-commit run --all-files

.github/workflows/npm-publish.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: Publish npm package
23

34
on:
@@ -8,14 +9,14 @@ jobs:
89
publish:
910
runs-on: ubuntu-latest
1011
steps:
11-
- name: Checkout repository
12-
uses: actions/checkout@v2
13-
- name: Setup node
14-
uses: actions/setup-node@v2.2.0
15-
with:
16-
node-version: 12
17-
registry-url: https://registry.npmjs.org/
18-
- name: Publish npm package
19-
run: npm publish
20-
env:
21-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
- name: Setup node
15+
uses: actions/setup-node@v2.2.0
16+
with:
17+
node-version: 12
18+
registry-url: https://registry.npmjs.org/
19+
- name: Publish npm package
20+
run: npm publish
21+
env:
22+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.pre-commit-config.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
1+
---
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v3.4.0
4+
rev: v4.0.1
45
hooks:
56
- id: trailing-whitespace
67
- id: check-added-large-files
78
- id: check-yaml
89
- id: end-of-file-fixer
910
- id: check-json
1011
- id: pretty-format-json
11-
args: ['--autofix', '--no-sort-keys']
12+
args: [--autofix, --no-sort-keys]
1213
- repo: https://github.com/standard/standard
1314
rev: v16.0.3
1415
hooks:
1516
- id: standard
17+
- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
18+
rev: 0.1.0
19+
hooks:
20+
- id: yamlfmt
21+
args: [--mapping, '2', --sequence, '2', --offset, '0']
22+
- repo: https://github.com/executablebooks/mdformat
23+
rev: 0.7.10
24+
hooks:
25+
- id: mdformat

CHANGELOG.md

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,28 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.3.0] - 2021-09-24
6+
7+
### Added
8+
9+
- Model reload option flag during running time - [#22](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/22) - Thanks [@acejacek](https://github.com/acejacek) for the suggestion and the PR
10+
- `pre-commit` common checks with `standard`, `yamlfmt` and `mdformat` style checks
11+
- GitHub Actions **CI** test with badge
12+
- **npm** quality badge to the `README` file
13+
- Automatic dependency checks with **dependabot**
14+
15+
### Changed
16+
17+
- Upgraded `node-fetch` to version `3.0.0`
18+
- Upgraded `pureimage` to version `0.3.5`
19+
- Upgraded `package-lock.json` file format to `v7`
20+
- Updated the `basic` example with the new reload option flag
21+
522
## [1.2.2] - 2020-10-24
623

724
### Changed
825

9-
- Upgraded to `@tensorflow/tfjs-node v1.4.0` to help Raspberry Pi installation - [#18](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/18)
26+
- Upgraded `@tensorflow/tfjs-node` to version `1.4.0` to help Raspberry Pi installation - [#18](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/18)
1027

1128
## [1.2.1] - 2020-10-24
1229

@@ -25,8 +42,8 @@ All notable changes to this project will be documented in this file.
2542

2643
- Compatibility with official Node-RED Dockerized image based on [Alpine](https://hub.docker.com/_/alpine) image
2744
- Compatibility with Raspberry Pi
28-
- [`pureimage`](https://www.npmjs.com/package/pureimage) npm package dependency to manage buffer images using pure javascript - [#17](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/17)
29-
- [`node-fetch`](https://www.npmjs.com/package/node-fetch) npm package dependency to manage http request to obtain the model info
45+
- `pureimage` npm package dependency to manage buffer images using pure javascript - [#17](https://github.com/bonastreyair/node-red-contrib-teachable-machine/issues/17)
46+
- `node-fetch` npm package dependency to manage http request to obtain the model info
3047

3148
### Removed
3249

@@ -63,7 +80,7 @@ All notable changes to this project will be documented in this file.
6380

6481
### Changed
6582

66-
- Dependancy is now `@tensorflow/tfjs v1.3.1` instead of `@tensorflow/tfjs-node v1.4.0`, to match teachable machine correct dependencies
83+
- Dependancy is now `@tensorflow/tfjs 1.3.1` instead of `@tensorflow/tfjs-node 1.4.0`, to match teachable machine correct dependencies
6784

6885
## [1.1.2] - 2020-05-03
6986

@@ -98,7 +115,7 @@ All notable changes to this project will be documented in this file.
98115

99116
- Updated image on how to use Teachable Machine and configuration node on Step 3
100117
- Use standard image treatment for `README` instead of HTML
101-
- 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)
118+
- Upgraded `@tensorflow/tfjs-node` to version `1.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)
102119

103120
## [1.0.1] - 2020-04-15
104121

@@ -121,7 +138,7 @@ All notable changes to this project will be documented in this file.
121138

122139
### Changed
123140

124-
- Icon updated to Tensorflow 2.0 new logo
141+
- Icon updated to **Tensorflow 2.0** new logo
125142
- Updated configuration node
126143
- Using all `README` badges from [Shields.io](https://shields.io/)
127144
- Outputs is always an array of results even if `Best prediction` is selected
@@ -162,24 +179,7 @@ All notable changes to this project will be documented in this file.
162179

163180
### Changed
164181

165-
- Downgraded `@tensorflow/tfjs-node` from version `v1.4.0` to `v1.3.1` for better compatibility
166-
- Output has changed from `checkbox` to a `list`, you can now select `Best predictions` or `All predictions`
167-
- Code cleaning
168-
169-
### Fixed
170-
171-
- WebGL loading error in JSDOM
172-
- When installing the node -> `npm WARN @teachablemachine/image@0.8.4 requires a peer of @tensorflow/tfjs@1.3.1 but none is installed`
173-
174-
## [0.1.1] - 2020-04-11
175-
176-
### Added
177-
178-
- Comments in the code
179-
180-
### Changed
181-
182-
- Downgraded `@tensorflow/tfjs-node` from version `v1.4.0` to `v1.3.1` for better compatibility
182+
- Downgraded `@tensorflow/tfjs-node` from version `1.4.0` to `1.3.1` for better compatibility
183183
- Output has changed from `checkbox` to a `list`, you can now select `Best predictions` or `All predictions`
184184
- Code cleaning
185185

@@ -188,14 +188,29 @@ All notable changes to this project will be documented in this file.
188188
- WebGL loading error in JSDOM
189189
- When installing the node -> `npm WARN @teachablemachine/image@0.8.4 requires a peer of @tensorflow/tfjs@1.3.1 but none is installed`
190190

191-
## [0.1.0] - 2020-04-11
191+
## 0.1.0 - 2020-04-11
192192

193193
### Added
194194

195-
- Functional using Teachable Machine Online Model URL
196-
- Option to select Top-1 or all results
197-
- CHANGELOG.md file
198-
- README.md file
199-
200-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
201-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
195+
- Functional using **Teachable Machine** Online Model URL
196+
- Option to select **Top-1** or all results
197+
- `CHANGELOG.md` file
198+
- `README.md` file
199+
200+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
201+
202+
[0.1.1]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v0.1.0...v0.1.1
203+
[0.1.2]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v0.1.1...v0.1.2
204+
[0.1.3]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v0.1.2...v0.1.3
205+
[1.0.0]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v0.1.3...v1.0.0
206+
[1.0.1]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.0.0...v1.0.1
207+
[1.1.0]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.0.1...v1.1.0
208+
[1.1.1]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.1.0...v1.1.1
209+
[1.1.2]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.1.1...v1.1.2
210+
[1.1.3]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.1.2...v1.1.3
211+
[1.1.4]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.1.3...v1.1.4
212+
[1.1.5]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.1.4...v1.1.5
213+
[1.2.0]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.1.5...v1.2.0
214+
[1.2.1]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.2.0...v1.2.1
215+
[1.2.2]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.2.1...v1.2.2
216+
[1.3.0]: https://github.com/bonastreyair/node-red-contrib-teachable-machine/compare/v1.2.2...v1.3.0

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
# node-red-contrib-teachable-machine
22

3-
[![Platform](https://img.shields.io/badge/platform-Node--RED-red)](https://nodered.org)
4-
[![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)
5-
[![npm total downloads](https://img.shields.io/npm/dt/node-red-contrib-teachable-machine)](https://www.npmjs.com/package/node-red-contrib-teachable-machine)
6-
<br>[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
7-
[![GitHub license](https://img.shields.io/github/license/bonastreyair/node-red-contrib-teachable-machine)](https://github.com/bonastreyair/node-red-contrib-teachable-machine/blob/master/LICENSE)
8-
[![donate PayPal](https://img.shields.io/badge/donate-PayPal-blue)](https://www.paypal.me/bonastreyair)
3+
[![Node-RED node](https://img.shields.io/badge/Node--RED-node-red?logo=node-red&style=flat-square)](https://nodered.org)
4+
[![Test CI](https://img.shields.io/github/workflow/status/bonastreyair/node-red-contrib-teachable-machine/CI?label=test&logo=github&style=flat-square)](https://github.com/duhow/download-github-release-assets/actions?workflow=CI)
5+
[![npm latest release](https://img.shields.io/npm/v/node-red-contrib-teachable-machine?logo=npm&style=flat-square)](https://www.npmjs.com/package/node-red-contrib-teachable-machine)
6+
[![npm total downloads](https://img.shields.io/npm/dt/node-red-contrib-teachable-machine?style=flat-square)](https://www.npmjs.com/package/node-red-contrib-teachable-machine)
7+
[![Package Quality](https://packagequality.com/shield/node-red-contrib-teachable-machine.svg?style=flat-square)](https://packagequality.com/#?package=node-red-contrib-teachable-machine)
8+
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square&color=yellow)](https://standardjs.com)
9+
[![GitHub license](https://img.shields.io/github/license/bonastreyair/node-red-contrib-teachable-machine?style=flat-square&color=blue)](https://github.com/bonastreyair/node-red-contrib-teachable-machine/blob/master/LICENSE)
10+
[![donate PayPal](https://img.shields.io/badge/donate-PayPal-blue?style=flat-square)](https://www.paypal.me/bonastreyair)
911

1012
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.
1113

1214
<p align="center">
13-
<img src="https://user-images.githubusercontent.com/37800834/79343223-736d7d80-7f2e-11ea-9c85-b83fc73b0952.png" height="70">
15+
<img src="https://user-images.githubusercontent.com/37800834/79343223-736d7d80-7f2e-11ea-9c85-b83fc73b0952.png" height="70">
1416
</p>
1517

1618
## Install
@@ -22,7 +24,7 @@ You have two options to install the node.
2224

2325
- Run the following command in your `Node-RED` user directory - typically `~/.node-red`
2426

25-
``` bash
27+
```bash
2628
npm install node-red-contrib-teachable-machine
2729
```
2830

@@ -54,9 +56,10 @@ In `Node-RED` send a buffered image to the node. Check the example in the `Impor
5456

5557
## Requirements
5658

57-
- `Node-RED v1.0.0+`
59+
- `Node-RED v2.0.0+`
60+
- `Node.js v12.20.0+`
5861

59-
*Note:* MacOSX Catalina, Windows 10 and Ubuntu 18.04 are supported as well as using official `docker nodered/node-red` [image](https://hub.docker.com/r/nodered/node-red/) based on [Alpine](https://hub.docker.com/_/alpine) image. Works with Raspberry Pi too since release [`v1.2.0+`](https://github.com/bonastreyair/node-red-contrib-teachable-machine/tags).
62+
*Note:* MacOSX, Windows 10 and Ubuntu 18.04+ are supported as well as using official `docker nodered/node-red` [image](https://hub.docker.com/r/nodered/node-red/) based on [Alpine](https://hub.docker.com/_/alpine) image. Works with Raspberry Pi too since release [`v1.2.0+`](https://github.com/bonastreyair/node-red-contrib-teachable-machine/tags).
6063

6164
## Mentions
6265

0 commit comments

Comments
 (0)