コード例 #1
0
 def get_results(series, gesture_id):
     # todo setup a config for current_end ( from the trained model)
     current_end = 0
     window_len = CONFIG.get_size_dim(gesture_id)
     window = np.full((1, window_len), np.nan)
     results = list()
     while current_end <= len(series) - 1:
         window, current_end, current_start = Launcher.update_window(
             series, window, current_end)
         results.append(window)
     return results
コード例 #2
0
 def detect(array, gesture_id):
     peaks = list()
     count = 0
     start = 0
     for i, v in enumerate(array):
         if v < CONFIG.get_threshold(gesture_id):
             print("peak found")
             start = start + count
             count += 1
         if count == CONFIG.get_size_dim(gesture_id) - 1:
             peaks.append(Gesture(start, count, array[start:count]))
             count = 0
             start = 0
     return peaks
コード例 #3
0
 def detect_old(array, gesture_id):
     starting_point = CONFIG.get_size_dim(gesture_id) - 1
     for i, v in enumerate(array[starting_point:]):
         if all(j < CONFIG.get_threshold(gesture_id) for j in v):
             print("i maybe found a gesture from index " + i.__str__() +
                   "to index " + (i + 150).__str__())