denisecailab / ezTrack

Free, platform independent, behavior tracking software.
GNU General Public License v3.0
118 stars 41 forks source link

Extract and verify Reference images in batch #35

Closed florianduclot closed 2 years ago

florianduclot commented 3 years ago

I've found myself in the unfortunate need to use "custom" settings to extract the Reference image for a few videos out for which it wasn't possible to use the default settings, a static image, or the same np.arange() for all videos to be processed in a batch. I've come across #16 and I agree the arguments laid there--mostly that this isn't really a batch process if one has to customize to some extent--but I remain attracted by the prospect of being able to get all the interactive and customization work done before proceeding with the location tracking step. Indeed, I'm working with some rather lengthy videos at times, and being able to do this "prep" work before-hand would allow me to get everything ready before starting the Batch_Process() (this is for location tracking) and let it run, letting me work on something else in the meantime. If I were to process these individually, I would have some akward few minutes of wait times between each video (long enough to be wasting your time, but too short to be doing something else).

I thus tried to adapt the functions in LocationTracking_Functions.py to batch extract and test the reference image and allow me to feed a custom dict of np.arange for each video that would require it during the Batch_Process() step. The resulting workflow is thus:

  1. Extract reference image for all videos in batch using Reference()'s default settings:
  2. Set custom np.arange() for those videos that would require it in a dedicated frames_dict.
  3. Repeat steps 1-2 until a satisfactory Reference image is extracted consistently.
  4. Run Batch_Process() with this custom frames_dict.

I acknowledge that this fits my own needs and does not necessarily fit into your "vision" for a canonical ezTrack pipeline, but I thought I would share and see if there's any interest in getting this included. If interested, the overall "idea" can be found at the branch below: https://github.com/florianduclot/ezTrack/tree/WIP_Batch_Reference

ZachPenn commented 2 years ago

At some point in the future we may implement something like this. I am going to move this to Discussion for now, in part so others can see the link to your changes.