imports.py
: Basic file importing some barebones libraries required. Not used in final implementation.gesterm.py
: Final iteration of the project. Contains all the logic and code necessary for gesture detection, command execution, and operating system alerts (macOS).requirements.txt
: Apip3 freeze
of my working Python 3 environment at the time of submission. Please runpython3 -m pip install -r requirements.txt
orpip3 install -r requirements.txt
before running the system.{user-training, studio-demo, implementation-demo, discrete-timewarp}.py
: These are all deprecated files that serve no purpose for the system as it is now. Refer to these as needed for my thought process during initial project stages.{deploy, cleanup}.sh
: Deprecated shell scripts that aided in initializing and refreshing GesTerm every 15 seconds and cleanup once the user decides to exit. No longer necessary or functional, asgesterm.py
now takes in arguments.
The folder LeapSDKPy3
is crucial to running the system, as GesTerm depends on the Leap Motion SDK ported over to Python 3.7.
Documented in the writeup PDF as well. Run
{pip3 install -r requirements.txt} OR {python3 -m pip install -r requirements.txt}
python3 gesterm.py swipe ‘cmd1’ circle ‘cmd2’
to get started with GesTerm. Provide your own commands for cmd1
and cmd2
.
Note that this is for a Python 3.7 wrapper around LeapSDK, which natively supports Python 2. Note that this assumes an already installed Python 3.7, preferably one that has been installed through brew
. You should also have System Integrity Protection (SIP) disabled!
To do so:
- Find
swig-rel-2.0.9.zip
inside thedependencies
folder and extract it. - Compile and build the extracted contents from source and run
sudo make install
. Verify the version withswig -version
. - Copy
Leap.h
,LeapMath.h
,Leap.i
, andlibLeap.dylib
into one folder. - Run
link.sh
in the same folder from Step 4.link.sh
can be found in theLeapSDKPy3
folder. This shell script creates aliases for Python based on your macOS installation.
The Gesture Recognition Toolkit (GRT) is written and is based in C++. To get an integrative environment that will run with the Leap Motion SDK, we need to wrap it around Python 3.7. I based my own installation around this tutorial. You'll note that the author still has an outstanding pull request on his Github repo for his python3
-wrapped GRT.
To do so:
- Download the GRT repo and checkout the pull request from the article above. Google/StackOverflow will show you how to download PRs onto a repo.
- Run
sudo rm -rf /usr/local/share/swig
to completely purgeswig 2.0.9
(we needswig 3.0
to build the GRT wrapper). brew install swig
to getswig v3
.- Make and install the GRT wrapper from source, similar to what was done with LeapSDK:
cd dependencies/grt/build/
mkdir tmp && cd tmp
make -j
cd python
python3 hello_world_example.py ../../../data/IrisData.grt
To see that the packages did indeed work, launch an instance of python3
and try import Leap; import GRtT
. Congrats!