예제 #1
0
    def setUpClass(self):
        times = [(2, 5), (5, 9), (2, 6)]
        heartrates = {
            'test': {
                'heartrates': np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
            }
        }

        path_to_heartav = "test"
        (self.data,
         self.times) = analyse_video('test',
                                     times,
                                     heartrates,
                                     path_to_opencv_cascades=path_to_cascades,
                                     path_to_heartav=path_to_heartav,
                                     gui=False)
예제 #2
0
    def setUpClass(self):
        times = [(2,5), (5, 9), (2,6)]
        heartrates = {
            'test': {
                'heartrates': np.array([0,1,2,3,4,5,6,7,8,9])
            }
        }

        path_to_heartav = "test"
        (self.data, self.times) = analyse_video(
            'test',
            times,
            heartrates,
            path_to_opencv_cascades=path_to_cascades,
            path_to_heartav=path_to_heartav,
            gui=False
        )
예제 #3
0
    times = []
    data_for_subject = intersting_heartrates[subject_state]

    start_of_section = int(data_for_subject[0][1])
    last_time = start_of_section
    for datum in data_for_subject:
        start = int(datum[1])
        end = start + WINDOW_SIZE
        if start == last_time and start - start_of_section <= 20:
            last_time = end
        else:
            times.append((start_of_section, last_time))
            start_of_section = start
            last_time = end

    print "times for: " + subject_state
    print times

    a = analyse_video(subject_state, times, heartrates, path_to_heartav=PATH_TO_HEARTAV)
    if a != None:
        (data, times) = a
        print "successful windows: " + str(times)
        specifications[subject_state] = times
        face_data[subject_state] = (data, times)
        print '\n'
    else:
        print subject_state + ' canont be found\n\n'

write_cache('spec.pickle', specifications)
write_cache('results.pickle', face_data)
예제 #4
0
    start_of_section = int(data_for_subject[0][1])
    last_time = start_of_section
    for datum in data_for_subject:
        start = int(datum[1])
        end = start + WINDOW_SIZE
        if start == last_time and start - start_of_section <= 20:
            last_time = end
        else:
            times.append((start_of_section, last_time))
            start_of_section = start
            last_time = end

    print "times for: " + subject_state
    print times

    a = analyse_video(subject_state,
                      times,
                      heartrates,
                      path_to_heartav=PATH_TO_HEARTAV)
    if a != None:
        (data, times) = a
        print "successful windows: " + str(times)
        specifications[subject_state] = times
        face_data[subject_state] = (data, times)
        print '\n'
    else:
        print subject_state + ' canont be found\n\n'

write_cache('spec.pickle', specifications)
write_cache('results.pickle', face_data)