Code to detect planar grasps
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Grasp Detector

Code to detect planar grasps using the model learnt in

alt tag

Getting Started

This should help you run a learnt grasp detector model on a sample image. Running this code requires the following dependencies:

  • Python 2.7
  • TensorFlow (version 1.0)
# Instructions to install TensorFlow 1.0
# Option 1
Install TensorFlow with GPU support from

# Option 2
# Check available tensorflow wheel files
curl -s |xmllint --format - |grep whl | grep gpu
# Install the version that works for your computer
pip install<Replace with wheel name>
  • argparse ('pip install argparse')
  • cv2 ('conda install -c menpo opencv=2.4.11' or install opencv from source)
  • numpy ('pip install numpy' or 'conda install numpy')

Getting Grasp Models

Download the learnt grasp models from and move it to the folder models.

# From the repository
mv Grasp_model ./models/.


Run grasp detector that should run the model on the image by sampling patches and displaying the best grasp on the image. Press any key to exit.

# For CPU 
python --im ./approach.jpg --model ./models/Grasp_model --nbest 5 --nsamples 250 --gscale 0.234 --gpu -1

# For GPU
python --im ./approach.jpg --model ./models/Grasp_model --nbest 5 --nsamples 1000 --gscale 0.234 --gpu 0


Lerrel Pinto -- lerrelpATcsDOTcmuDOTedu.