stepcount
stepcount copied to clipboard
ENH Allow multiple files passing
I see the information for running multiple files at https://github.com/OxWearables/stepcount?tab=readme-ov-file#processing-multiple-files, but it would be great if you can pass in multiple files directly.
The benefits:
- Downloading the model only once. Ideally people are using an explicit model path or the torch cache path (only available for SSL, not RF), but that may slow things down.
- Loading the model only once - this is the big speedup. Even with a cached model, the model must load every time in stepcount, which is a slowdown. If the lines https://github.com/OxWearables/stepcount/blob/58797b1e8d653f1fff6f23ed57e8cfb5638120ba/src/stepcount/stepcount.py#L67 are moved then a loop can only add
sample_rate,window_len,wd.device, andwd.sample_rateto the model as needed for the specific file. The process would go: load model, add specific attributes, loop over data to reading/getting info, add to model, thenpredict_from_frameand summarize.