Giter Site home page Giter Site logo

graspnerf's Introduction

GraspNeRF: Multiview-based 6-DoF Grasp Detection for Transparent and Specular Objects Using Generalizable NeRF (ICRA 2023)

This is the official repository of GraspNeRF: Multiview-based 6-DoF Grasp Detection for Transparent and Specular Objects Using Generalizable NeRF.

For more information, please visit our project page.

Introduction

In this work, we propose a multiview RGB-based 6-DoF grasp detection network, GraspNeRF, that leverages the generalizable neural radiance field (NeRF) to achieve material-agnostic object grasping in clutter. Compared to the existing NeRF-based 3-DoF grasp detection methods that rely on densely captured input images and time-consuming per-scene optimization, our system can perform zero-shot NeRF construction with sparse RGB inputs and reliably detect 6-DoF grasps, both in real-time. The proposed framework jointly learns generalizable NeRF and grasp detection in an end-to-end manner, optimizing the scene representation construction for the grasping. For training data, we generate a large-scale photorealistic domain-randomized synthetic dataset of grasping in cluttered tabletop scenes that enables direct transfer to the real world. Experiments in synthetic and real-world environments demonstrate that our method significantly outperforms all the baselines in all the experiments.

Overview

This repository provides:

  • PyTorch code, and weights of GraspNeRF.
  • Grasp Simulator based on blender and pybullet.
  • Multiview 6-DoF Grasping Dataset Generator and Examples.

Dependency

  1. Please run
pip install -r requirements.txt

to install dependency.

  1. (optional) Please install blender 2.93.3--Ubuntu if you need simulation.

Data & Checkpoints

  1. Please generate or download and uncompress the example data to data/ for training, and rendering assets to data/assets for simulation. Specifically, download imagenet valset to data/assets/imagenet/images/val which is used as random texture in simulation.
  2. We provide pretrained weights for testing. Please download the checkpoint to src/nr/ckpt/test.

Testing

Our grasp simulation pipeline is depend on blender and pybullet. Please verify the installation before running simulation.

After the dependency and assets are ready, please run

bash run_simgrasp.sh

Training

After the training data is ready, please run

bash train.sh GPU_ID

e.g. bash train.sh 0.

Data Generator

  1. Download the scene descriptor files from GIGA and assets.
  2. For example, run
bash run_pile_rand.sh 

in ./data_generator for pile data generation.

Citation

If you find our work useful in your research, please consider citing:

@article{Dai2023GraspNeRF,
  title={GraspNeRF: Multiview-based 6-DoF Grasp Detection for Transparent and Specular Objects Using Generalizable NeRF},
  author={Qiyu Dai and Yan Zhu and Yiran Geng and Ciyu Ruan and Jiazhao Zhang and He Wang},
  booktitle={IEEE International Conference on Robotics and Automation (ICRA)},
  year={2023}

License

This work and the dataset are licensed under CC BY-NC 4.0.

CC BY-NC 4.0

Contact

If you have any questions, please open a github issue or contact us:

Qiyu Dai: [email protected], Yan Zhu: [email protected], He Wang: [email protected]

graspnerf's People

Contributors

daiqy avatar fzy139 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

graspnerf's Issues

Assistance Requested to Locate "Image Feature Volume" and "Aggregated Feature Volume" in GraspNeRF Implementation

Hello,

I am currently studying the GraspNeRF paper along with its associated code. As I delve deeper, I am finding it challenging to identify the sections of the code and parameters that correspond to the "Image Feature Volume" and "Aggregated Feature Volume" depicted in Figure 2 (framework of the proposed method) in the paper.

Could someone kindly assist me in pinpointing these components within the code? Any guidance would be greatly appreciated.

Thank you very much for your time and assistance.

Best regards,

tc-huang

Torch error during training and testing

Hello,
A really impressive contribution.
I am running the code on an RTX A4000
I use Torch 2.1 with cuda 12.1
after launching both

bash run_simgrasp.sh

or

bash train.sh GPU_ID

I get the following error

File "/home/user/miniconda3/envs/GRASP/lib/python3.9/site-packages/torch/init.py", line 235, in
from torch._C import * # noqa: F403
ImportError: /home/user/miniconda3/envs/GRASP/lib/python3.9/site-packages/torch/lib/libtorch_cpu.so: undefined symbol: cblas_gemm_bf16bf16f32

Do you have an idea, what can I do to fix that ?
Thanks in advance

Real Panda Robot Implementation with Realsense Camera fails to get good TSDF Volume

I have been struggling for a while now to get the GraspNerf Model to output a valid TSDF Volume for my real world Images.

This is the network output of both the Quality volume and the TSDF Volume which has mostly missing values.
image

Another Image of just the TSDF Volume with mostly missing values:
image

I also get the error: !! too low ratio tensor([0.0000, 0.0000, 0.0811, 0.3172, 0.0142, 0.0000], device='cuda:0') from the sample_volume function inside "renderer.py".

This is the Pointcloud I get when I plot the depth images from the Realsense camera along with their corresponding extrinsincs and intrinsics. It looks fine and the bottle object I have placed inside the Task Frame is in the right position.
image

These are my extrinsics from the camera positions placed on a hemisphere with radius 0.5m and polar angle pi/6 around the middle of the workspace. Also plotted are the extrinsics from the simulated images which rotate around a fixed point 0.5m above the origin.
Here I don't understand why the z-axis of these extrinsics does not point to the middle of the workspace but instead in a seemingly random direction?
image

This is the TSDF Volume from the model fed with simulated images from the run_simgrasp demo. It looks fine and is centered in the workspace even though their extrinsics don't point this way.
image

I have formatted my real images, extrinsics and intrinsics in exactely the same format as the simulated ones and also tried cropping and resizing to shape (288, 512) but this does not improve my results, they look almost identical.
image

I would be really grateful if somebody could help me out here and explain to me where I am wrong in my thinking. I am happy to supply any additional information if required.

not found glibc2.18

I have a problem when I run the train.sh file, it shows that not found glibc2.18, can I compile the program with a lower version of glibc2.17 and then run it?
我在运行train.sh文件的时候显示我缺失glibc2.18,这是一个底层的编译库文件,但是我不太方便升级,麻烦问一下用低版本的glibc2.17编译后可以运行程序吗?麻烦您了,期待您的答复

Franka Emika Panda

Hi!
Thank you for the work you've done!

I was wondering if you will be adding any instructions about how to use your code with Panda?
I'm doing a project using a Panda arm robot and I'm a newbie on working with a robot.
I suppose you used ROS for the experiment?

Thanks!

realsense holder

Hi!
Thanks for sharing your work!

Do you have a 3d file for a realsense holder by any chance?

scenes tsdf depth normal generation

Hi,

This is a wonderful work, I am recently trying to train the GraspNeRF network. But facing an issue with scenes tsdf depth normal generation for train data.

There is no script to generate this data. can you guide on generating this data whether it uses single view depth images or mutli view images. How to generate or when can I expect the github to update with files to support training.

Thank you so much in advance. Appreciate your help!

code releasing date

Hi!

Was wondering approximately when you're planning to release the code.

Thanks!

Grasping TSDF on custom images

Hi,

Thanks for sharing your wonderful work!
I'm looking to generate TSDF and grasp samples for custom images!

Could you point me to the relevant script!
Thanks

Testing custom images

Hi! Thanks for sharing your work!

I'm trying to use custom images and output grasping information (using your model's pretrained weights). This is my first time reading research paper repo so I'm not sure which script I should look at and how to run it to achieve my goal.
I've seen other papers you mentioned (VGA and GAGA).

I'll use Panda eventually to grasp objects but for now I just want to use your model with my custom images without using Panda and output grasping information.

Am I supposed to use simulation experiment script? or robotics experiment script?
I'm a bit confused because in simulation experiment I think the model is taking pictures of a simulated scene. And in robot experiment, I have to use Panda to take pictures and use them as input.

Could you briefly explain the process to achieve my goal?

Sorry for asking basic questions!

Blender version?

Hi there,
Cool project!

I was wondering what version of blender you guys used?

Thanks :)

Simulating grasp using pybullet and blender

Hi. Thanks for your wonderful work and sharing the code. It benefits me a lot. It would be highly appreciated if you could provide more information about simulating grasp using pybullet and blender. How to use your scripts to generate simulation scenes and grasps? Appreciate your help!

No module named 'vgn.utils'

When I run the scripts bash run_simgrasp.sh,its show like this
Blender 2.93.3 (hash 8b80d19f3641 built 2021-08-17 23:40:09)
Read prefs: /home/lzz/.config/blender/2.93/config/userpref.blend
Read blend: /home/lzz/GraspNeRF/./data/assets/material_lib_graspnet-v2.blend
########## Simulation Start ##########
Round 0
method: graspnerf
material_type: specular_and_transparent
views: [2, 6, 10, 14, 18, 22]
######################################
[I] GraspNeRFPlanner: using ckpt: test
[I] GraspNeRFPlanner: load model at step 215000 of best metric 0.0032956636603921653
pybullet build time: May 25 2024 15:51:40
Traceback (most recent call last):
File "/home/lzz/GraspNeRF/scripts/sim_grasp.py", line 124, in
main(args, round_idx, gpuid, render_frame_list)
File "/home/lzz/GraspNeRF/scripts/sim_grasp.py", line 18, in main
from gd.experiments import clutter_removal
File "src/gd/experiments/clutter_removal.py", line 11, in
from gd.simulation import ClutterRemovalSim
File "src/gd/simulation.py", line 9, in
from gd.utils import btsim, workspace_lines
File "src/gd/utils/btsim.py", line 8, in
from vgn.utils.transform import Rotation, Transform
ModuleNotFoundError: No module named 'vgn.utils'
how to slove it?
my cuda is11.8 and successfully installed the requirements

No texture and color in output images

I am very appreciate your work and run the demo file 'run_simgrasp.sh'. But images in 'rendered_results' only have grey and transparent objects. Do you know how to output images with color objects?

Unable to install pybullet==2.7.9 in Blender's bundled Python

Thank you for sharing such a nice work.

I cannot install pybullet==2.7.9. How do you install it and what version of python do you use?

scripts/sim_grasp.py is executed by Blender's bundled python in run_simgrasp.sh and binary file path for Blender's bundled python is /usr/local/blender-2.93.3-linux-x64/2.93/python/bin/python3.9.

$BLENDER_BIN $BLENDER_PROJ_PATH --background --python scripts/sim_grasp.py \

So I use Blender's bundled python (python3.9) but the following installation command does not work.

/usr/local/blender-2.93.3-linux-x64/2.93/python/bin/python3.9 -m pip install pybullet==2.7.9` 

A part of the error message during installation is as follows.

      In file included from src/btBulletCollisionAll.cpp:77:0:
      src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp: In member function ‘void btOptimizedBvh::updateBvhNodes(btStridingMeshInterface*, int, int, int)’:
      src/BulletCollision/CollisionShapes/btOptimizedBvh.cpp:296:9: warning: ‘graphicsindex’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           int graphicsindex;
               ^~~~~~~~~~~~~
      In file included from src/btBulletCollisionAll.cpp:85:0:
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp: In member function ‘bool btMiniSDF::load(const char*, int)’:
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:72:18: warning: ‘buf[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_cell_size[0] = buf[0];
         ~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:73:18: warning: ‘buf[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_cell_size[1] = buf[1];
         ~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:74:18: warning: ‘buf[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_cell_size[2] = buf[2];
         ~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:86:13: warning: ‘cells’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_n_cells = cells;
         ~~~~~~~~~~^~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:91:14: warning: ‘fields’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_n_fields = fields;
         ~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:143:22: warning: ‘n_cell_maps1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
          for (int j = 0; j < n_cell_maps1; j++)
                          ~~^~~~~~~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:137:21: warning: ‘n_cell_maps0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         for (int i = 0; i < n_cell_maps0; i++)
                         ~~^~~~~~~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:125:21: warning: ‘n_cells1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         for (int j = 0; j < n_cells1; j++)
                         ~~^~~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:119:20: warning: ‘n_cells0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        for (int i = 0; i < n_cells0; i++)
                        ~~^~~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:108:15: warning: ‘n_nodes1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         nodes.resize(n_nodes1);
         ~~~~~~~~~~~~^~~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:94:25: warning: ‘nodes0’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        unsigned long long int nodes0;
                               ^~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:81:22: warning: ‘buf[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_inv_cell_size[2] = buf[2];
         ~~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:80:22: warning: ‘buf[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_inv_cell_size[1] = buf[1];
         ~~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:79:22: warning: ‘buf[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_inv_cell_size[0] = buf[0];
         ~~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:67:19: warning: ‘buf2[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_resolution[2] = buf2[2];
         ~~~~~~~~~~~~~~~~^~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:66:19: warning: ‘buf2[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_resolution[1] = buf2[1];
         ~~~~~~~~~~~~~~~~^~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:65:19: warning: ‘buf2[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_resolution[0] = buf2[0];
         ~~~~~~~~~~~~~~~~^~~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:59:21: warning: ‘buf[5]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_domain.m_max[2] = buf[5];
         ~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:58:21: warning: ‘buf[4]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_domain.m_max[1] = buf[4];
         ~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:57:21: warning: ‘buf[3]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_domain.m_max[0] = buf[3];
         ~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:55:21: warning: ‘buf[2]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_domain.m_min[2] = buf[2];
         ~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:54:21: warning: ‘buf[1]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_domain.m_min[1] = buf[1];
         ~~~~~~~~~~~~~~~~~~^~~~~~~~
      src/BulletCollision/CollisionShapes/btMiniSDF.cpp:53:21: warning: ‘buf[0]’ may be used uninitialized in this function [-Wmaybe-uninitialized]
         m_domain.m_min[0] = buf[0];
         ~~~~~~~~~~~~~~~~~~^~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pybullet
  Running setup.py clean for pybullet
Failed to build pybullet
ERROR: Could not build wheels for pybullet, which is required to install pyproject.toml-based projects

Thanks.

bad TSDF volume result from example data

Hi, thank you for the great work.

I'm trying to output TSDF volume of the transparent object scene using pre-trained weights.
But the result seems not good compared to the ground truth one.

The details of the configuration are as follow:

downSample: 0.8
images: resized (512x288) images in "traindata_example/giga_hemisphere_train_demo/packed_full/packed_0-170/000fc0562d2a4881b24921a424ef9175/rgb" directory
extrinsics: "traindata_example/giga_hemisphere_train_demo/packed_full/packed_0-170/000fc0562d2a4881b24921a424ef9175/camera_pose.npy" file
intrinsics: downsized(K[:2] * 0.8 * 0.5) K (https://github.com/PKU-EPIC/GraspNeRF/blob/30e28971c95d3a9bacb351c5ab8a55dac3ed004d/src/nr/main.py#L107C49-L107C49)
depth range: fixed to [0.2, 0.8]
bbox3d: [[-0.15, -0.15, -0.0503], [0.15, 0.15, 0.2497]]
TSDF value thresholds: [0.0 (low), 1.0 (high)]
Model: NeuralRayRenderer
number of images: 6

Here is the visualization result of TSDF volume (red dots are camera origins)
Figure_1
This is from my code.

Figure_2
This is from "traindata_example/giga_hemisphere_train_demo/scenes_tsdf_dep-nor/000fc0562d2a4881b24921a424ef9175.npz" file.

Can you tell me which part I'm missing?
Appreciate your help!

Request to specify exact versions of dependencies in requirements.txt

(duplicate of #20, not sure why was it closed without resolution)

Since requirements.txt does not contain version information (except for pybullet==2.7.9), all the latest versions get pulled and that seemingly causes problems like ModuleNotFoundError during the installation process:

Error message
Downloading torch-2.2.0-cp310-cp310-manylinux1_x86_64.whl.metadata (25 kB)
Collecting tensorflow (from -r requirements.txt (line 2))
Downloading tensorflow-2.15.0.post1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.2 kB)
Collecting easydict (from -r requirements.txt (line 3))
Downloading easydict-1.11.tar.gz (6.6 kB)
Preparing metadata (setup.py) ... done
Collecting inplace-abn (from -r requirements.txt (line 4))
Downloading inplace-abn-1.1.0.tar.gz (137 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 137.3/137.3 kB 26.9 MB/s eta 0:00:00
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "/tmp/pip-install-tr9ie4sl/inplace-abn_3a830128b02841758f85c9c46caddafc/setup.py", line 4, in <module>
        import torch
    ModuleNotFoundError: No module named 'torch'
    [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Also, specifying which python version to use would be helpful as well. 🙂

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.