stanfordnmbl / opencap-core

Main OpenCap processing pipeline
Apache License 2.0
144 stars 112 forks source link

Exclude camera post overlap selection if bad data #173

Closed antoinefalisse closed 2 months ago

antoinefalisse commented 2 months ago

If the person tracking didn't really work, we might end up with a camera with only 0s after the overlap period has been selected. This would cause the gait algo to fail because of some division by 0 and therefore sync would fail overall. This PR does two things:

1) It encapsulates the gait detection algo into a try statement such that it would move forward regardless 2) It kicks out a camera post overlap selection if it contains only a bunch of 0s

Tested on three trials from the ACL study that were failing because person tracking had failed for 1/3 camera and it worked fine. Touching synchronizeVideoKeypoints is daunting so take a close look at what I did, I don't think I broke anything.