stepcount icon indicating copy to clipboard operation
stepcount copied to clipboard

ENH Allow multiple files passing

Open muschellij2 opened this issue 2 years ago • 0 comments

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:

  1. 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.
  2. 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, and wd.sample_rate to 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, then predict_from_frame and summarize.

muschellij2 avatar Feb 01 '24 16:02 muschellij2