This repository contains the implementation of the paper Contrastive Instance Association for 4D Panoptic Segmentation using Sequences of 3D LiDAR Scans

Overview

Contrastive Instance Association for 4D Panoptic Segmentation using Sequences of 3D LiDAR Scans

This repository contains the implementation of the paper Contrastive Instance Association for 4D Panoptic Segmentation using Sequences of 3D LiDAR Scans.

The approach builds on top of an arbitrary single-scan Panoptic Segmentation network and extends it to the temporal domain by associating instances across time using our Contrastive Aggregation network that leverages the point-wise features from the panoptic network.

Requirements

  • Install this package: go to the root directory of this repo and run:
pip3 install -U -e .

Data preparation

Download the SemanticKITTI dataset inside the directory data/kitti/. The directory structure should look like this:

./
└── data/
    └── kitti
        └── sequences
            ├── 00/           
            │   ├── velodyne/	
            |   |	├── 000000.bin
            |   |	├── 000001.bin
            |   |	└── ...
            │   └── labels/ 
            |       ├── 000000.label
            |       ├── 000001.label
            |       └── ...
            ├── 08/ # for validation
            ├── 11/ # 11-21 for testing
            └── 21/
                └── ...

Pretrained models

Reproducing the results

Run the evaluation script, which will compute the metrics for the validation set:

python evaluate_4dpanoptic.py --ckpt_ps path/to/panoptic_weights --ckpt_ag path/to/aggregation_weights 

Training

Create instances dataset

Since we use a frozen Panoptic Segmentation Network, to avoid running the forward pass during training, we save the instance predictions and the point features in advance running:

python save_panoptic_features.py --ckpt path/to/panoptic_weights

This will create a directory in cont_assoc/data/instance_features with the same structure as Kitti but containing, for each sequence of the train set, npy files containing the instance points, labels and features for each scan.

Save validation predictions

To get the 4D Panoptic Segmentation performance for the validation step during training, we save the full predictions for the validation set (sequence 08) running:

python save_panoptic_features.py --ckpt path/to/panoptic_weights --save_val_pred

This will create a directory in cont_assoc/data/validation_predictions with npy files for each scan of the validation sequence containing the semantic and instance predictions for each point.

Train Contrastive Aggregation Network

Once the instance dataset and the validation predictions are generated, we're ready to train the Contrastive Aggregation Network running:

python train_aggregation.py 

All the configurations are in the config/contrastive_instances.yaml file.

Citation

If you use this repo, please cite as :

@article{marcuzzi2022ral,
  author = {Rodrigo Marcuzzi and Lucas Nunes and Louis Wiesmann and Ignacio Vizzo and Jens Behley and Cyrill Stachniss},
  title = {{Contrastive Instance Association for 4D Panoptic Segmentation \\ using Sequences of 3D LiDAR Scans}},
  journal = {IEEE Robotics and Automation Letters (RA-L)},
  year = 2022,
  volume={7},
  number={2},
  pages={1550-1557},
}

Acknowledgments

The Panoptic Segmentation Network used in this repo is DS-Net.

The loss function it's a modified version of SupContrast.

License

Copyright 2022, Rodrigo Marcuzzi, Cyrill Stachniss, Photogrammetry and Robotics Lab, University of Bonn.

This project is free software made available under the MIT License. For details see the LICENSE file.

You might also like...
[CVPR 2021] Forecasting the panoptic segmentation of future video frames
[CVPR 2021] Forecasting the panoptic segmentation of future video frames

Panoptic Segmentation Forecasting Colin Graber, Grace Tsai, Michael Firman, Gabriel Brostow, Alexander Schwing - CVPR 2021 [Link to paper] We propose

Implementation of association rules mining algorithms (Apriori|FPGrowth) using python.
Implementation of association rules mining algorithms (Apriori|FPGrowth) using python.

Association Rules Mining Using Python Implementation of association rules mining algorithms (Apriori|FPGrowth) using python. As a part of hw1 code in

3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans.
3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans.

3DMV 3DMV jointly combines RGB color and geometric information to perform 3D semantic segmentation of RGB-D scans. This work is based on our ECCV'18 p

Code for our CVPR 2022 Paper
Code for our CVPR 2022 Paper "GEN-VLKT: Simplify Association and Enhance Interaction Understanding for HOI Detection"

GEN-VLKT Code for our CVPR 2022 paper "GEN-VLKT: Simplify Association and Enhance Interaction Understanding for HOI Detection". Contributed by Yue Lia

Implementation for Panoptic-PolarNet (CVPR 2021)
Implementation for Panoptic-PolarNet (CVPR 2021)

Panoptic-PolarNet This is the official implementation of Panoptic-PolarNet. [ArXiv paper] Introduction Panoptic-PolarNet is a fast and robust LiDAR po

A PyTorch implementation of the baseline method in Panoptic Narrative Grounding (ICCV 2021 Oral)
A PyTorch implementation of the baseline method in Panoptic Narrative Grounding (ICCV 2021 Oral)

A PyTorch implementation of the baseline method in Panoptic Narrative Grounding (ICCV 2021 Oral)

pytorch implementation of
pytorch implementation of "Contrastive Multiview Coding", "Momentum Contrast for Unsupervised Visual Representation Learning", and "Unsupervised Feature Learning via Non-Parametric Instance-level Discrimination"

Unofficial implementation: MoCo: Momentum Contrast for Unsupervised Visual Representation Learning (Paper) InsDis: Unsupervised Feature Learning via N

SUPERVISED-CONTRASTIVE-LEARNING-FOR-PRE-TRAINED-LANGUAGE-MODEL-FINE-TUNING - The Facebook paper about fine tuning RoBERTa with contrastive loss
TorchDistiller - a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

This project is a collection of the open source pytorch code for knowledge distillation, especially for the perception tasks, including semantic segmentation, depth estimation, object detection and instance segmentation.

Comments
  • size mismatch for encoder.contextBlock.conv_A1.weight

    size mismatch for encoder.contextBlock.conv_A1.weight

    when i run the code: python evaluate_4dpanoptic.py --ckpt_ps pre_trained/panoptic_pq_564.pth --ckpt_ag pre_trained/aggregation_aq_724.ckpt I face this problem: File "save_panoptic_features.py", line 46, in main() File "/home/wxiao/anaconda3/envs/strack/lib/python3.7/site-packages/click/core.py", line 1128, in call return self.main(*args, **kwargs) File "/home/wxiao/anaconda3/envs/strack/lib/python3.7/site-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/home/wxiao/anaconda3/envs/strack/lib/python3.7/site-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/wxiao/anaconda3/envs/strack/lib/python3.7/site-packages/click/core.py", line 754, in invoke return __callback(*args, **kwargs) File "save_panoptic_features.py", line 33, in main model.load_state_dict(checkpoint['state_dict']) File "/home/wxiao/anaconda3/envs/strack/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1224, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for PanopticCylinder: size mismatch for encoder.contextBlock.conv_A1.weight: copying a param with shape torch.Size([3, 1, 3, 16, 32]) from checkpoint, the shape in current model is torch.Size([32, 3, 1, 3, 16]). size mismatch for encoder.contextBlock.conv_A2.weight: copying a param with shape torch.Size([1, 3, 3, 32, 32]) from checkpoint, the shape in current model is torch.Size([32, 1, 3, 3, 32]). size mismatch for encoder.contextBlock.conv_B1.weight: copying a param with shape torch.Size([1, 3, 3, 16, 32]) from checkpoint, the shape in current model is torch.Size([32, 1, 3, 3, 16]). size mismatch for encoder.contextBlock.conv_B2.weight: copying a param with shape torch.Size([3, 1, 3, 32, 32]) from checkpoint, the shape in current model is torch.Size([32, 3, 1, 3, 32]). size mismatch for encoder.downBlock0.conv_A1.weight: copying a param with shape torch.Size([3, 1, 3, 32, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 1, 3, 32]). size mismatch for encoder.downBlock0.conv_A2.weight: copying a param with shape torch.Size([1, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3, 64]). size mismatch for encoder.downBlock0.conv_B1.weight: copying a param with shape torch.Size([1, 3, 3, 32, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3, 32]). size mismatch for encoder.downBlock0.conv_B2.weight: copying a param with shape torch.Size([3, 1, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 1, 3, 64]). size mismatch for encoder.downBlock0.pool.weight: copying a param with shape torch.Size([3, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 3, 64]).

    Hope someone can help me !!!

    opened by carrolltm 1
Owner
Photogrammetry & Robotics Bonn
Photogrammetry & Robotics Lab at the University of Bonn
Photogrammetry & Robotics Bonn
null 190 Jan 3, 2023
Pytorch Implementation for NeurIPS (oral) paper: Pixel Level Cycle Association: A New Perspective for Domain Adaptive Semantic Segmentation

Pixel-Level Cycle Association This is the Pytorch implementation of our NeurIPS 2020 Oral paper Pixel-Level Cycle Association: A New Perspective for D

null 87 Oct 19, 2022
PanopticBEV - Bird's-Eye-View Panoptic Segmentation Using Monocular Frontal View Images

Bird's-Eye-View Panoptic Segmentation Using Monocular Frontal View Images This r

null 63 Dec 16, 2022
An unofficial personal implementation of UM-Adapt, specifically to tackle joint estimation of panoptic segmentation and depth prediction for autonomous driving datasets.

Semisupervised Multitask Learning This repository is an unofficial and slightly modified implementation of UM-Adapt[1] using PyTorch. This code primar

Abhinav Atrishi 11 Nov 25, 2022
This repository is an open-source implementation of the ICRA 2021 paper: Locus: LiDAR-based Place Recognition using Spatiotemporal Higher-Order Pooling.

Locus This repository is an open-source implementation of the ICRA 2021 paper: Locus: LiDAR-based Place Recognition using Spatiotemporal Higher-Order

Robotics and Autonomous Systems Group 96 Dec 15, 2022
Official PyTorch implementation of "Contrastive Learning from Extremely Augmented Skeleton Sequences for Self-supervised Action Recognition" in AAAI2022.

AimCLR This is an official PyTorch implementation of "Contrastive Learning from Extremely Augmented Skeleton Sequences for Self-supervised Action Reco

Gty 44 Dec 17, 2022
Segmentation and Identification of Vertebrae in CT Scans using CNN, k-means Clustering and k-NN

Segmentation and Identification of Vertebrae in CT Scans using CNN, k-means Clustering and k-NN If you use this code for your research, please cite ou

null 41 Dec 8, 2022
Leveraging Instance-, Image- and Dataset-Level Information for Weakly Supervised Instance Segmentation

Leveraging Instance-, Image- and Dataset-Level Information for Weakly Supervised Instance Segmentation This paper has been accepted and early accessed

Yun Liu 39 Sep 20, 2022
Pixel Consensus Voting for Panoptic Segmentation (CVPR 2020)

Implementation for Pixel Consensus Voting (CVPR 2020). This codebase contains the essential ingredients of PCV, including various spatial discretizati

Haochen 23 Oct 25, 2022
[CVPR 2021] Exemplar-Based Open-Set Panoptic Segmentation Network (EOPSN)

EOPSN: Exemplar-Based Open-Set Panoptic Segmentation Network (CVPR 2021) PyTorch implementation for EOPSN. We propose open-set panoptic segmentation t

Jaedong Hwang 49 Dec 30, 2022