Pose tracking for a collection of videos using AlphaPose
-
CUDA 10.1
-
A directory containing videos for tracking
cd
intoAlphaPose
- Create conda environment using the
ap-env.yml
file and activate export PATH=/usr/local/cuda/bin/:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH
sudo apt-get install libyaml-dev
python setup.py build develop
(Hack: If AlphaPose doesn't build properly after executing this command, doing it again works)- Run the
get_weights.py
script to download pre-trained model weights - Run
process_videos.py
usage: process_videos.py [-h] --indir INDIR --outdir OUTDIR [--threshold THRESHOLD]
[--visualize VISUALIZE] [--min_time_fraction MIN_TIME_FRACTION]
[--n_people N_PEOPLE] [--n_cat_videos N_CAT_VIDEOS]
[--detbatch DETBATCH] [--posebatch POSEBATCH] [--gpus GPUS]
[--qsize QSIZE]
Script to generate tracklets from all videos in a directory
optional arguments:
-h, --help show this help message and exit
--indir INDIR Should point to directory containing all the trimmed
videos
--outdir OUTDIR Location where all the output files should be saved
--threshold THRESHOLD
Threshold score for filtering videos
--visualize VISUALIZE
Whether to the visualize the tracklets for videos
which pass the filters
--min_time_fraction MIN_TIME_FRACTION
Min fraction of time the person must be present in the
video to be considered
--n_people N_PEOPLE Top k people to be stored for the videos on which
performance is suitable
--detbatch DETBATCH detection batch size PER GPU
--posebatch POSEBATCH
pose estimation maximum batch size PER GPU
--gpus GPUS choose which cuda device to use by index and input
comma to use multi gpus, e.g. 0,1,2,3. (input -1 for
cpu only)
Example arguments for the process_videos.py
script -
python process_videos.py --indir /home/user/trimmed_videos --outdir /home/user/results --threshold 3.0 --visualize True --min_time_fraction 0.25 --n_people 5 --gpus 0,1,2,3 --posebatch 10 --detbatch 10
Note: OpenCV is used for visualization purposes. If you wish to make use of the visualization functionality, installing OpenCV from source on your system is recommended. You may refer to the following blogs for instructions on how to install OpenCV from source on Ubuntu -