Grasp the Graph 2.0 (GtG2) is a pipeline for learning grasp quality from point clouds by turning local gripper-region points into graphs and training a graph neural network regressor. Preprint: arXiv:2505.02664
- Generate grasp candidates from GraspNet scenes using GPG and GraspNet evaluation.
- Convert each grasp to local gripper-frame point sets (inside and boundary points).
- Build k-NN graphs from inside points and use them as model inputs.
- Train a GNN regressor to predict grasp quality scores.
Data_Gathering/main.py: Parallel data generation entry point (config is inside the script).Data_Gathering/generate_data.py: Core pipeline for grasp sampling, evaluation, and dataset creation.Data_Gathering/create_graph.py: Graph construction utilities (k-NN, labels).Data_Gathering/graphize.py: Optional batch conversion of raw.npyto.pthgraphs.Data_Gathering/train_val_splti.py: K-fold scene splits and train/test export.Training/train.py: Model training loop and checkpoints.Training/models.py: GNN model definition.Training/data_utils.py: Dataset loading and PyG DataLoader helpers.Testing/gripper_params.cfg: Gripper geometry parameters (INI format).Testing/gripper_params_gpg.cfg: GPG gripper parameters.
- Python 3.8+
- PyTorch + PyTorch Geometric
- numpy, scipy, tqdm
- open3d
- graspnetAPI
- pygpg
- fpsample
- Generate data (edit the config block in
Data_Gathering/main.pyfor paths and scene ranges):
python Data_Gathering/main.py- Create train/test folds:
python Data_Gathering/train_val_splti.py \
--data-dir path/to/scene_npy_dir \
--output-dir path/to/folds \
--camera kinect \
--k 10 \
--num-scenes 100- Train the GNN regressor:
python Training/train.py --fold-dir path/to/folds/fold0_kinect --output-dir runs/fold0Optional: convert raw .npy to merged .pth graphs for inspection:
python Data_Gathering/graphize.py path/to/scene.npy path/to/output/graphs --proc 4This project builds on the GraspNet dataset. The data generation step saves per-scene .npy files containing entries of the form [inside_pts, outside_pts, score, width]. Training expects fold directories containing train.npy and test.npy produced by train_val_splti.py. Update paths and filenames in the scripts as needed for your dataset layout.
If you use this code or data, please cite the preprint:
@misc{moghadam2025gtg2,
title={Grasp the Graph (GtG) 2.0: Ensemble of Graph Neural Networks for High-Precision Grasp Pose Detection in Clutter},
author={Ali Rashidi Moghadam and Sayedmohammadreza Rastegari and Mehdi Tale Masouleh and Ahmad Kalhor},
year={2025},
eprint={2505.02664},
archivePrefix={arXiv}
}