Git Product home page Git Product logo

grasping_field's Introduction

Grasping Field: Learning Implicit Representations for Human Grasps - demo

This repository contains a grasp generation demo and the training code of Grasping Field: Learning Implicit Representations for Human Grasps

The following code samples hand grasps conditioned on given object meshes. Teaser Image

Required library:

  • pytorch (with GPU)
  • trimesh
  • plyfile
  • scikit-image
  • sklearn
  • chumpy
  • cv2

You can run the following command in the command line to install all the dependencies.

pip3 install -r requirements.txt

The code is tested on Ubuntu 18.04 with python3

Download MANO pickle data-structures

  • Go to MANO website
  • Create an account by clicking Sign Up and provide your information
  • Download Models and Code (the downloaded file should have the format mano_v*_*.zip). Note that all code and data from this download falls under the MANO license.
  • unzip and copy the models folder into the ./mano folder
  • Your folder structure should look like this:
  mano/
    models/
      MANO_LEFT.pkl
      MANO_RIGHT.pkl
      ...
    webuser/
    ...

Sample hands

python3 reconstruct.py

This may take a few minutes.

The demo takes objects from ./input as input, generates 5 samples of grasping hand under ./output. ./output/meshes/ contains the raw sdf reconstruction and ./output/mano contains the fitted mano. You can use meshlab to visualize them. Please load the object and hand together for visualization.

The model in ./pretrained_model is trained only on the ObMan dataset. We include two sample objects from the YCB dataset in ./input. These sample meshes are for demo purpose only, please downlond the full dataset from the website. Note that these objects are also used in the HO3D dataset.

New objects can be given to the model by providing the path to the meshes (./input) and the list of object (input.json). The object needs to be reachable when a hand wrist is at the origin and should not be in [-x,-z] quadrant (see example meshes).

RGB reconstruction (unknown object)

python3 reconstruct.py -t rgb_recon_obman

The model is trained on the obman dataset.

RGB reconstruction (known objects om FHB dataset)

python3 reconstruct.py -t rgb_recon_fhb

The model is trained on the FHB dataset. The object class is known during inference and is given as input.

Training

Pre-processing the Data

For data preparation, we modified the point sampling code from DeepSDF to compute the distance to both hand and object, and to find the associate hand-part label for each point. This can be done with the scripts/sample_points/preprocess_data.py executable. The preprocessing code is in C++ and has the following requirements:

With these dependencies, the build process follows the standard CMake procedure:

mkdir build
cd build
cmake ..
make -j

Once this is done there should be two executables in the scripts/sample_points/bin directory, one for surface sampling and one for SDF sampling. With the binaries, the dataset can be preprocessed using preprocess_data.py.

More information on the compilation process can be found on DeepSDF

Training a Model

Once data has been preprocessed, models can be trained using:

python train.py -e <experiment_directory>

Parameters of training are stored in a "specification file"(specs.json) in the experiment directory.

Acknowledgement

We sincerely acknowledge: Lars Mescheder and Michael Niemeyer for the detailed discussions on implicit function. Dimitrios Tzionas, Omid Taheri, and Yana Hasson for insightful discussions on MANO and the baseline. Partha Ghosh and Qianli Ma for the help with implementation of the VAE. Benjamin Pellkofer for IT/hardware supports.

grasping_field's People

Contributors

korrawe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.