nadizik's picture
Update README.md
3848c4c verified
|
Raw
History Blame Contribute Delete
1.88 kB
---
license: apache-2.0
tags:
- MOUSE
- RECOGNIZER
- TRACKING
---
# MOUSE Gesture Recognizer (Interactive GUI Test)
A lightweight, real-time Multi-Layer Perceptron (MLP) neural network with an interactive Tkinter GUI for recognizing 2D mouse and touchpad gestures (Classes 0 to 7).
Class 0: Noise / Idle movements
Class 1–7: Target gestures
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python](https://img.shields.io/badge/Python-3.8%2B-green.svg)](https://www.python.org/)
[![PyTorch](https://img.shields.io/badge/PyTorch-1.9%2B-EE4C2C.svg)](https://pytorch.org/)
## Features
- **Interactive Canvas Testing:** Includes a native desktop GUI (`Tkinter`) for drawing gestures using a mouse, touchpad, or touchscreen with real-time classification.
- **Scale & Velocity Invariance:** Uses 1D spatial interpolation (`scipy.interpolate.interp1d`) to normalize any raw drawn trajectory into exactly 64 points ($64 \times 2 = 128$ floats).
- **Ultra-Compact Architecture:** Lightweight MLP topology (`128 -> 64 -> 32 -> 8`) with `LeakyReLU` activations for instant inference and zero CPU overhead.
- **EXE-Ready:** Fully compatible with PyInstaller and multiprocessing freezes via dynamic path detection (`_MEIPASS`).
---
## Model Architecture
| Layer Index | Layer Type | Input Shape | Output Shape | Activation / Details |
| :--- | :--- | :--- | :--- | :--- |
| `net.0` | `nn.Linear` | 128 | 64 | `nn.LeakyReLU(0.1)` |
| `net.2` | `nn.Linear` | 64 | 32 | `nn.LeakyReLU(0.1)` |
| `net.4` | `nn.Linear` | 32 | 8 | Softmax (`temp=0.45`) |
---
## Quickstart & Usage
### 1. Download & Install Dependencies
```bash
git clone [https://huggingface.co/nadizik/mouse-gesture-recognizer](https://huggingface.co/nadizik/mouse-gesture-recognizer)
cd mouse-gesture-recognizer
pip install torch numpy scipy