Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo Ketelaar authored Jan 8, 2021
1 parent 35cf42a commit f9c5971
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
# GestureController
## Requirements
- Python 3.7.9 (make sure its added to path)
- Dependences:
```
pip install opencv-python
pip install keyboard
pip install psutil
pip install keyboard
pip install numpy
pip install mediapipe
pip install tensorflow
pip install pywin32
```
## Pretrained model
The model we've generated is targeted to be used to control Spotify on Windows. Please see the diagram below;
![Spotify Gestures Diagram](https://github.com/Ivolutio/WebcamGestureController/blob/main/gestures.png?raw=true)

## Notes
## Training your own model
Create a dataset folder with subfolders named with the gesture. E.g. `datasets/thumbsup`, `datasets/thumbsdown`.
Use the `take_pics.py` program to capture pictures of you performing the gesture by pressing `Q` on your keyboard.
The captures are saved in captures, simply put them in the correct dataset folder.
Now go to `train_model.py` and adjust the datasets property.

```
datasets = [
Dataset("neutral", 0),
Dataset("thumbsup", 1),
Dataset("thumbsdown", 2)
]
```
Headsup: Also train the model with enough `neutral` pictures of your hand doing someone unrelated to the gestures you want to use.
Then simply run the program and it will output a `model.h5` file.
Now also update the datasets in the `posedetector.py`.

## Dev Notes
### HandLandmarks from MediaPipe
```python
# This is an enumerator for the idx of hand landmarks
Expand All @@ -22,4 +55,4 @@ for hand_landmarks in results.multi_hand_landmarks:
# Test which point
if idx == HandLandmark.WRIST:
# ...
```
```

0 comments on commit f9c5971

Please sign in to comment.