OpenLeap
Table of contents
General Info
OpenLeap is an open source project that allows you to add hand gesture control to your Python projects.
Technologies
Project was created with technologies:
- Python
- OpenCV
- MediaPipe
- SciKit Learn
Setup
OpenLeap can be installed using pip, as shown below.
$ pip install openleap
Simple Example
Test openleap controller with an example program. Code below will create an instance of opencv window with feed from the camera.
import openleap
controller = openleap.OpenLeap(screen_show=True,
screeen_type='BLACK',
show_data_on_image=True,
show_data_in_console=True,
gesture_model='sign_language')
controller.loop()
OpenLeap returns relative position of each hand, distance between thumb tip and index finger tip, rotation angle by wrist point and recognized gesture. There are two models for gesture recognition.
The first one can recognized wheter hand is opened or closed into fist, second model can recognized sign language alphabet as shown below.
OpenLeap object can be created with couple of options.
- screen_show - if set to True, window with camera feed will be created.
- screen_type - "CAM" or "BLACK" background.
- show_data_on_image - descriptive
- show_data_in_console - descriptive
- gesture_model - chose gesture recognition model, "basic" or "sign_language"
Access Hand Information
Recognized gestures, hand position, tilt and so on are stored in a dictionary called 'data' that consists of two dataclass objects for right and left hand. Dataclass object is of given structure:
@dataclass
class Data:
x : float = 0
y : float = 0
z : float = 0
distance: float = 0.0
angle: float = 0.0
gesture: str = None
Dataclass containing all of the data above is continuously being updated in main() or loop() function depending on which one is being used.
Example
if controller.data['right'].gesture == 'open':
print('Right hand is opened!')
elif controller.data['right'].gesture == 'fist':
print('Right hand is closed!')
Another Example
if controller.data['right'].distance < 20:
print('Click has been detected!')
Metadata
Release files for openleap 0.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openleap-0.5.6.tar.gz | 1.6 MB | Without provenance | Details for openleap-0.5.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openleap-0.5.6-py3-none-any.whl | Python 3 | none | any | Details for openleap-0.5.6-py3-none-any.whl |
Total release size: 3.3 MB
Release files / openleap-0.5.6.tar.gz
| Download URL | openleap-0.5.6.tar.gz |
|---|---|
| Size | 1.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5074ff08415e8c239f4421c57b6678a9b8718da06077c2074f43c49202485d54
|
|
BLAKE2b-256 checksum How to use checksums |
bd6b9a55dc6d2c2724205055282464ca90c195e52642521871fc8e216a0268a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Release files / openleap-0.5.6-py3-none-any.whl
| Download URL | openleap-0.5.6-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2c6e2aabdb766bf56908c0cd64a221c5b15145604bc262568e73b514ff45ba98
|
|
BLAKE2b-256 checksum How to use checksums |
88084b9832649a44dd9f81752b5f01a5bba5fe0a9a8cffc905f9645f6b9b2d98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for openleap 0.5.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.