Code for anticipating human activities (
C C++ Python Other
Switch branches/tags
Nothing to show
Clone or download
Latest commit 57fa2ca May 23, 2014


Code for anticipating human activities (

If using this code please cite:

Anticipating Human Activities using Object Affordances for Reactive Robotic Response, Hema S Koppula, Ashutosh Saxena. Robotics: Science and Systems (RSS), 2013.

Learning Spatio-Temporal Structure from RGB-D Videos for Human Activity Detection and Anticipation, Hema S Koppula, Ashutosh Saxena. International Conference on Machine Learning (ICML), 2013.



  • OpenCV version 2.4 or greater (dev version or install from source)
  • PCL 1.6
  • Boost version 1.50 or greater

Commands to install the required dependencies and run anticipation code on Subject 1 data:

# install pcl
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl 
sudo apt-get update
sudo apt-get install libpcl-all

# install opencv
sudo apt-get install libopencv-dev
#install boost 1.50
tar --bzip2 -xf boost_1_50_0.tar.bz2
#If you prefer to install boost to a specific directory use the following instead
# ./ --prefix=path/to/installation/prefix
sudo ./b2 install

# download code 
git clone

# compile
cd human_activity_anticipation/build
cmake ..
cd ../src/pyobjs

#install learning code dependencies
cd ../../

# download data
cd data/
tar -xvzf Subject1_annotations.tar.gz
tar -xvzf Subject1_rgbd_rawtext.tar.gz
mv  Subject1_rgbd_rawtext/*/*rgbd.txt  .
mkdir objects
mkdir objects_tracked
cp Subject1_annotations/*/objects/* objects/
cp Subject1_annotations/*/objects_tracked/* objects_tracked/
cp Subject1_annotations/*/*.bag .
cp Subject1_annotations/*/*.txt .
cat Subject1_annotations/*/activityLabel.txt  | grep -v END > activityLabel.txt
cat Subject1_annotations/*/labeling.txt > labeling.txt

# run anticipation code 
cd ../build/
./predict_seg ../data/ activityLabel.txt 1