A tool for drawing regions of interest (ROIs) on videos and analysing DeepLabCut videos.
We currently do not support multi-animal but will in the future!
Install the requirements from the YAML file with:
$ conda env create -f ROI_ENV.yml
The main one is that it requires pandas to not be on version 1.x. We use pandas=0.25.3
:).
#Clone this repository
$ git clone https://github.com/PolarBean/DLC_ROI_tool.git
#Change you current directory to the repo's
$ cd DLC_ROI_tool
#Run the GUI!
$ python ROI_tool.py
When you initially launch the application, you will be asked to choose a video on which to draw your ROI.
Click and drag to draw your ROIs and save them sequentially with Set and Name.
Choose a scored DeepLabCut file (this should work with either the CSV or .h5 file, but I usually use the .h5). This doesn't necessarily need to be the same video that you drew the ROI on, drawing the ROI set the XY coordinates of each ROI, and it will apply these coordinates to any DLC file you choose. If your ROIs don't move from video to video, this can be efficient.
This is a necessary step and generates a CSV with the ROI an animal was in for each frame of the scored DLC video. It uses a majority method to determine where the majority of the animal was in any given frame. This can take a long time, especially with long or high fps videos, so if the application is not responding, just let it think for a minute or 3 :).
This will quickly generate you a CSV file with basic stats on your videos, such as time spent and the number of entries into each ROI and between ROIs.
The Save ROIs to file
allows you to save your defined ROIs to a CSV file, which can be loaded later to allow for consistency and replication of your analysis.