Static Gestures Recognition Framework
Project description
SGRF library development setup
Prerequisites
- Python 3.11
- PIP
Development
Installation
- Create/activate virtual environment
- Install required packages with
pip install -r requirements.txt
Create new algorithm
To create a new algorithm, use algorithm creation script: ./scripts/generate_algorithm.py
Validate algorithms
To validate algorithms use scripts located in ./validation directory. Json files with validation results are located
in ./validation/results directory
Usage
Import library
To use library in external project, use pip install sgrf.
Sample use cases
To predict gesture on selected image, run the code below. You can select desired algorithm by using values
on ALGORITHM enum. Some algorithms require their own payload (e.g. hand coordinates or background image
without hand). You can import specific payload from sgrf.algorithms.<alg>.<alg>_payload.
import cv2
from sgrf import classify
from sgrf.data.algorithm import ALGORITHM
from sgrf.models.image_payload import ImagePayload
image = cv2.imread("resources/image.jpg")
result = classify(algorithm=ALGORITHM.EID_SCHWENKER, payload=ImagePayload(image=image))
print(result)
To show image processed by the selected algorithm, run:
import cv2
from sgrf import process_image
from sgrf.data.algorithm import ALGORITHM
from sgrf.models.image_payload import ImagePayload
image = cv2.imread("resources/image.jpg")
processed_image = process_image(algorithm=ALGORITHM.EID_SCHWENKER, payload=ImagePayload(image=image))
cv2.imshow("Image", processed_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
To learn your own algorithm's model (e.g. on other image base than ours), run:
import cv2
from sgrf import learn
from sgrf.data.algorithm import ALGORITHM
from sgrf.data.gesture import GESTURE
from sgrf.models.learning_data import LearningData
image = cv2.imread("resources/image.jpg")
acc, loss = learn(algorithm=ALGORITHM.EID_SCHWENKER, target_model_path="models",
learning_data=[LearningData(image_path="resources/image.jpg", label=GESTURE.FIVE)] * 10)
print(acc, loss)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sgrf-3.0.0.tar.gz.
File metadata
- Download URL: sgrf-3.0.0.tar.gz
- Upload date:
- Size: 46.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33734717dd5fc09367fa6dbc37cefbc3651c5c893e919740a17ee653c09d794f
|
|
| MD5 |
e660135944ebe730a34fafb87a3a353e
|
|
| BLAKE2b-256 |
3216d9788fb263c7e24f6624e97a42f3382094c532088e5499b6c3955a84fe6e
|
File details
Details for the file sgrf-3.0.0-py3-none-any.whl.
File metadata
- Download URL: sgrf-3.0.0-py3-none-any.whl
- Upload date:
- Size: 46.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c28f6cd8f6f422f78e9bd816d1c822674b64aab74440490e6dd02172aaad001d
|
|
| MD5 |
e21ec8d4e03fd13c10a8613468615812
|
|
| BLAKE2b-256 |
5431d73e7a70c0ab1e12421eac43a479bf30788874f0401c8aa15efd3fe58906
|