gestures

[unmaintained] PoC for motion gesture detection from webcam input
Log | Files | Refs | README | LICENSE

commit 2e83234987c9ff509019993a557831dc87781154
parent a954048024e8cdf84d0b143c24a8f89b777decfc
Author: Stefan Koch <taikano@lavabit.com>
Date:   Sat,  8 Jun 2013 19:03:30 +0200

set 0.01 as lowest prob to allow training

Diffstat:
Mmodels.py | 20+++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/models.py b/models.py @@ -35,7 +35,7 @@ def transition_matrix(gesture): def emission_matrix(gesture): gestes = set(gesture) - B = [[0 for i in range(OBSERVATIONS_COUNT)] for j in range(GESTES_COUNT)] + B = [[0.01 for i in range(OBSERVATIONS_COUNT)] for j in range(GESTES_COUNT)] for geste in gestes: if geste == UP: @@ -68,14 +68,16 @@ for gesture in gestures: print(m) models.append((m, gesture[1])) -#close = models[0][0] -#close.baumWelch(ghmm.SequenceSet(sigma, [ -# [0, 0, 0, 0, 3, 3, 3, 3, 3], -# [0, 0, 0, 0, 3, 3, 3, 3, 3, 1], -# [0, 0, 0, 0, 0, 3, 3, 3, 1], -# [0, 0, 0, 3, 3, 3], -# [0, 0, 0, 3, 3, 3, 1] -#])) +close = models[0][0] +close.baumWelch(ghmm.SequenceSet(sigma, [ + [0, 0, 0, 0, 3, 3, 3, 3, 3], + [0, 0, 0, 0, 3, 3, 3, 3, 3, 1], + [0, 0, 0, 0, 0, 3, 3, 3, 1], + [0, 0, 0, 3, 3, 3], + [0, 0, 0, 3, 3, 3, 1] +])) + +print(close) #A = [[0.7, 0.3], [0, 1]] #B = [[0.6, 0.1, 0.2, 0.2], [.2, .2, .1, .6]]