Skip to content

Commit

Permalink
optimize readme and adding changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
nischiemineo committed Oct 1, 2023
1 parent a41a1d6 commit cfe63ed
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 186 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 2.0.0 (2023-10-01)

## Breaking Changes

- Following Settings have changed and are breaking changes
- `cascade` - chnage default path according to the new folder structure
- `encodings` - chnage default path according to the new folder structure
- `usePiCamera` and `source` - not avialable anymore because of auto-detection with `picamera2` library
- `brightness` - new possible values are 0-100
- `contrast` - new possible values are 0-127
- `rotateCamera` - new possible values are -1 = no rotation, 0 = 90°, 1 = 180°, 2 = 270°
- `pythonPath` - still works if you like to use it, but it is not necessary anmore with pipenv
- `resolution` - default resolution was changed from `[1280, 960]` to `[1920,1080]`
- Some old OS images are not supported anymore according to `picamera2`

### Folder structure

- Move haarcascade from `tools` to `model`
- `encodings.pickle` is now by default in folder `model`
- `Dockerfile` was removed because of new simple setup
- `Makefile` was removed because of new simple setup
- `facerecognition.py` was renamed to `recognition.py`
- Split `recognition.py` functions into mulitple utils files

### pipenv

- To be sure everything is installed what is needed for this module we
implemented pipenv and add all dependencies automaticly with pip and pipenv.
It will be installed after `npm install`.

### Camera support

- We use the new `picamera2` library to read the camera image. It should support
all the picameras and some third party cameras.

### OS support

- Because we use the `picamera2` libary, we support Raspberry Pi OS Bullseye (or later) 32bit and 64bit.

- Picamera2 is not supported on:
- Images based on Buster or earlier releases.
- Raspberry Pi OS Legacy images.
- Bullseye (or later) images where the legacy camera stack has been re-enabled.

### NPM scripts

- We have new npm scripts which helps to setup the module
- `npm run encode`
- `npm run recognition`
20 changes: 10 additions & 10 deletions MMM-Face-Reco-DNN.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ Module.register('MMM-Face-Reco-DNN', {
cascade: 'modules/MMM-Face-Reco-DNN/model/haarcascade_frontalface_default.xml',
// pre encoded pickle with the faces
encodings: 'modules/MMM-Face-Reco-DNN/model/encodings.pickle',
// Brightness, negative is darker, positive is brighter
// Brightness (0-100)
brightness: 0,
// Contrast, positive value for more contrast
// Contrast (0-127)
contrast: 0,
// rotate camera?
// Rotate camera image (-1 = no rotation, 0 = 90°, 1 = 180°, 2 = 270°)
rotateCamera: -1,
// method of face recognition (dnn = deep neural network, haar = haarcascade)
method: 'dnn',
Expand All @@ -64,7 +64,7 @@ Module.register('MMM-Face-Reco-DNN', {
// allow multiple concurrent user logins, 0=no, any other number is the maximum number of concurrent logins
multiUser: 0,
// resoltuion of the image
resolution: [1280, 960],
resolution: [1920, 1080],
// width of the image for processing
processWidth: 500,
// output image on mm
Expand Down Expand Up @@ -468,15 +468,15 @@ Module.register('MMM-Face-Reco-DNN', {
}
},

getDom: function() {
const wrapperEl = document.createElement("div");
wrapperEl.classList.add('face-recognition');
getDom: function () {
const wrapperEl = document.createElement('div');
wrapperEl.classList.add('face-recognition');

const imageEl = document.createElement("img");
const imageEl = document.createElement('img');
imageEl.classList.add('face-recognition-image');
imageEl.src = 'data:image/jpg;base64,' + this.image;
wrapperEl.appendChild(imageEl);

return wrapperEl;
},
return wrapperEl;
},
});
Loading

0 comments on commit cfe63ed

Please sign in to comment.