pascalxia / driver_attention_prediction

35 stars 18 forks source link

Support for other sample rates #1

Closed kevintli closed 6 years ago

kevintli commented 6 years ago

Our model was trained at 3 Hz, so by default it didn't support predicting at other rates.

The solution was to split the frames into groups and then run each group through the model separately. For example, if the desired sample rate is 6 Hz, we split it into 2 groups for prediction at 3 Hz each. If the sample rate is not a multiple of 3, we first sample more frames than necessary -- for example, for 4 Hz, we would sample 4x3=12 frames per second, then split it into 4 groups.

Also includes demo/tests of this method in data_point_collector_tests.py