SAR-Net: Shape Alignment and Recovery Network for Category-level 6D Object Pose and Size Estimation

February 6, 2024 ยท View on GitHub

Image 1 Image 2 Image 3

architecture

๐Ÿ“ Overview

This repository contains the PyTorch implementation of the paper "SAR-Net: Shape Alignment and Recovery Network for Category-level 6D Object Pose and Size Estimation" [PDF] [Supp] [arXiv]. Our approach could recover the 6-DoF pose and 3D size of category-level objects from the cropped depth image.

For more results and robotic demos, please refer to our Webpage.

๐Ÿ’ซ Follow-up works

  • Our follow-up ICCV2023 work:
    • PourIt!๐Ÿซ—: Weakly-supervised Liquid Perception from a Single Image for Visual Closed-Loop Robotic Pouring [Project Page] [PDF] [arXiv] [Supp]

๐Ÿ“š Dependencies

  • Python >= 3.6
  • PyTorch >= 1.4.0
  • CUDA >= 10.1

โš™๏ธ Installation

conda create -n sarnet python=3.6
conda activate sarnet

pip install -r requirements.txt

๐Ÿ“Š Prepare Dataset

Unzip and organize these files in ./data/NOCS and ./results/NOCS as follows:

data
โ””โ”€โ”€ NOCS
    โ”œโ”€โ”€ camera_train_processed
    โ”œโ”€โ”€ template_FPS
    โ”œโ”€โ”€ CAMERA
    โ”‚   โ”œโ”€โ”€ val 
    โ”‚   โ””โ”€โ”€ val_list.txt
    โ”œโ”€โ”€ Real
    โ”‚   โ”œโ”€โ”€ test 
    โ”‚   โ””โ”€โ”€ test_list.txt
    โ”œโ”€โ”€ gts
    โ”‚   โ”œโ”€โ”€ cam_val
    โ”‚   โ””โ”€โ”€ real_test
    โ””โ”€โ”€ obj_models
        โ”œโ”€โ”€ val
        โ””โ”€โ”€ real_test
   

results
โ””โ”€โ”€ NOCS
    โ”œโ”€โ”€ mrcnn_mask_results
    โ”‚   โ”œโ”€โ”€ cam_val
    โ”‚   โ””โ”€โ”€ real_test
    โ””โ”€โ”€ nocs_results
        โ”œโ”€โ”€ val
        โ””โ”€โ”€ real_test
        
python preprocess/shape_data.py
python preprocess/pose_data.py
python generate_json.py

๐ŸŒŸ NOTE

NOTE that there is a small bug in the original evaluation code of NOCS w.r.t. IOU. We fixed this bug in our evaluation code and re-evaluated our method. Also thanks Peng et al. for further confirming this bug.

๐Ÿช„ Demo

python demo.py --config ./config_evaluate/nocs_real_mrcnn_mask.txt

The predict results will be saved in the folder of ./examples

Image 1 Image 2 Image 3

โณ Training

modified the ${gpu_id} in config_sarnet.py

# using a single GPU
e.g. gpu_id = '0' 

# using multiple GPUs
e.g. gpu_id = '0,1,2,3'

python train_sarnet.py

๐Ÿช„ Evaluation

We provide the pretrain models of 3D-GCN(./checkpoints/NOCS/pretrained/seg3d) and SAR-Net(./checkpoints/NOCS/pretrained/sarnet) for fast evaluation.

python evaluate.py --config ./config_evaluate/nocs_real_mrcnn_mask.txt

We also provide the results reported in our paper for comparison.

๐Ÿ”– Citation

If you find our work helpful, please consider citing:

@InProceedings{Lin_2022_CVPR,
    author    = {Lin, Haitao and Liu, Zichang and Cheang, Chilam and Fu, Yanwei and Guo, Guodong and Xue, Xiangyang},
    title     = {SAR-Net: Shape Alignment and Recovery Network for Category-Level 6D Object Pose and Size Estimation},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2022},
    pages     = {6707-6717}
}

๐ŸŒน Acknowledgment

Our implementation leverages the code from NOCS, SPD and 3DGCN. Thanks for the authors' work.