PyTorch Implementation of PIXOR: Real-time 3D Object Detection from Point Clouds

Overview

PIXOR: Real-time 3D Object Detection from Point Clouds

This is a custom implementation of the paper from Uber ATG using PyTorch 1.0. It represents the driving scene using lidar data in the Birds' Eye View (BEV) and uses a single stage object detector to predict the poses of road objects with respect to the car

PIXOR: Real-time 3D Object Detection from Point Clouds

alt text

Highlights

  • PyTorch 1.0 Reproduced and trained from scratch using the KITTI dataset
  • Fast Custom LiDAR preprocessing using C++
  • Multi-GPU Training and Pytorch MultiProcessing package to speed up non-maximum suppression during evaluation
  • Tensorboard Visualize trainig progress using Tensorboard
  • KITTI and ROSBAG Demo Scripts that supports running inferences directly on raw KITTI data or custom rosbags.

Install

Dependencies:

  • Python 3.5(3.6)
  • Pytorch (Follow Official Installation Guideline)
  • Tensorflow (see their website)
  • Numpy, MatplotLib, OpenCV3
  • PyKitti (for running on KITTI raw dataset)
  • gcc
pip install shapely numpy matplotlib
git clone https://github.com/philip-huang/PIXOR
cd PIXOR/srcs/preprocess
make

(Optional) If you want to run this project on a custom rosbag containing Velodyne HDL64 scans the system must be Linux with ROS kinetic installed. You also need to install the velodyne driver into the velodyne_ws folder.

Set up the velodyne workspace by running ./velodyne_setup.bash and press Ctrl-C as necessary.

Demo

A helper class is provided in run_kitti.py to simplify writing inference pipelines using pre-trained models. Here is how we would do it. Run this from the src folder (suppose I have already downloaded my KITTI raw data and extracted to somewhere)

from run_kitti import *

def make_kitti_video():
     
    basedir = '/mnt/ssd2/od/KITTI/raw'
    date = '2011_09_26'
    drive = '0035'
    dataset = pykitti.raw(basedir, date, drive)
   
    videoname = "detection_{}_{}.avi".format(date, drive)
    save_path = os.path.join(basedir, date, "{}_drive_{}_sync".format(date, drive), videoname)    
    run(dataset, save_path)

make_kitti_video()

Training and Evaluation

Our Training Result (as of Dec 2018) alt text

All configuration (hyperparameters, GPUs, etc) should be put in a config.json file and save to the directory srcs/experiments/$exp_name$ To train

python srcs/main.py train (--name=$exp_name$)

To evaluate an experiment

python srcs/main.py val (--name=$exp_name$)

To display a sample result

python srcs/main.py test --name=$exp_name$

To view tensorboard

tensorboard --logdir=srcs/logs/$exp_name$

TODO

  • Improve training accuracy on KITTI dataset
  • Data augmentation
  • Generalization gap on custom driving sequences
  • Data Collection
  • Improve model (possible idea: use map as a prior)

Credits

Project Contributors

  • Philip Huang
  • Allan Liu

Paper Citation below



@inproceedings{yang2018pixor,
  title={PIXOR: Real-Time 3D Object Detection From Point Clouds},
  author={Yang, Bin and Luo, Wenjie and Urtasun, Raquel}
}

We would like to thank aUToronto for genersouly sponsoring GPUs for this project

Comments
  • Hi, do you meet the problem

    Hi, do you meet the problem "num_pred=0" ?

    Hi, man, I try your method and I often meet the problem "num_pred=0" in function "compute_ap", and this problem always leads to training process interrupt. Do you meet the same problem?

    opened by deepmeng 3
  • CPU and GPU usage

    CPU and GPU usage

    I am using one GPU to train the model, but it is still using around 10-16G CPU memory. Would you please tell what operations are using so much memory on the CPU.

    opened by sanketgujar 2
  • A question about coordinate transformation

    A question about coordinate transformation

    The 3d locations of ground truth boxes are in camera coordinate. In this implementation, coordinate transformation of 3d locations just contains rotation transformation. Is the translation ignored? And in rotation transformation, I think "z=-z" is necessary, which is similar to "y=-y" in datagen.py

    opened by qiqihaer 2
  • Open-source license

    Open-source license

    Hi Philip,

    This repository looks great :)

    Would you mind adding an open-source license? Otherwise it could be problematic for other people to use it.

    Best, Martin

    opened by martinengelcke 1
  • How to train on kitti dataset?

    How to train on kitti dataset?

    Hi. I downloaded synced+rectified 2011_09_26_drive_0005 dataset along with calibration file from http://www.cvlibs.net/datasets/kitti/raw_data.php

    Call me noob but I am unable to train on kitti dataset. Instruction says run $: python srcs/main.py train (--name=$exp_name$)

    But what should exp_name be for the above Kitti dataset be?

    opened by vvanurag 1
  • AttributeError: module 'tensorboard.summary._tf.summary' has no attribute 'FileWriter'

    AttributeError: module 'tensorboard.summary._tf.summary' has no attribute 'FileWriter'

    Hi, I tried to run this program on my computer, and when I executed the following command:

    python main.py train --name=default
    
    

    I got this error:

    AttributeError: module 'tensorboard.summary._tf.summary' has no attribute 'FileWriter'
    

    this is the detail:

    Using device cpu
    There are 3712 images in txt file
    Found 3712 Velodyne scans...
    done.
    There are 3769 images in txt file
    Found 3769 Velodyne scans...
    done.
    ------------------------------------------------------------------
    Traceback (most recent call last):
      File "main.py", line 395, in <module>
        train(args.name, device)
      File "main.py", line 191, in train
        train_logger = get_logger(config, 'train')
      File "/home/andre/masterarbeit/PIXOR/srcs/utils.py", line 57, in get_logger
        return logger.Logger(folder)
      File "/home/andre/masterarbeit/PIXOR/srcs/logger.py", line 15, in __init__
        self.writer = tf.summary.FileWriter(log_dir)
    AttributeError: module 'tensorboard.summary._tf.summary' has no attribute 'FileWriter'
    

    the version of tensorflow is 2.1. Can you tell me how to solve this problem? thx

    opened by AndreLYL 0
  • how did you train a new model for another class?such as Pedestrian or Cyclist?

    how did you train a new model for another class?such as Pedestrian or Cyclist?

    1.The score of the prediction is too low.if I need to modify the alpha and beta? 2.And how should I set the object_list and filter the train dataset to make the balance of positive and negetive data? 3.I meet the problem like others in compute_iou():float divided by zero.How to avoid it? If you have any ideas,welcome pls,thank you

    opened by caimumuxin 0
  • Prepare for the dataset

    Prepare for the dataset

    Hi, do you know what dataset is used exactly? There are many parts of the KITTI Bird's Eye View dataset. I don't know which should I download. Thank you.

    Bird's Eye View Evaluation 2017: Download left color images of object data set (12 GB) Download right color images, if you want to use stereo information (12 GB) Download the 3 temporally preceding frames (left color) (36 GB) Download the 3 temporally preceding frames (right color) (36 GB) Download Velodyne point clouds, if you want to use laser information (29 GB) Download camera calibration matrices of object data set (16 MB) Download training labels of object data set (5 MB)

    opened by seanxu889 2
  • Bounding box parameters order

    Bounding box parameters order

    Hello,

    Thank you for sharing the code.

    Here should be h, w, l :) https://github.com/philip-huang/PIXOR/blob/2f64e84f72d915f8b5b80d4615bc9a0c881b5dab/srcs/datagen.py#L91

    opened by avdmitry 0
Owner
Philip Huang
University of Toronto | Engineering Science | Machine Intelligence
Philip Huang
(CVPR 2021) Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds

BRNet Introduction This is a release of the code of our paper Back-tracing Representative Points for Voting-based 3D Object Detection in Point Clouds,

null 86 Oct 5, 2022
Code for the paper SphereRPN: Learning Spheres for High-Quality Region Proposals on 3D Point Clouds Object Detection, ICIP 2021.

SphereRPN Code for the paper SphereRPN: Learning Spheres for High-Quality Region Proposals on 3D Point Clouds Object Detection, ICIP 2021. Authors: Th

Thang Vu 15 Dec 2, 2022
BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition 2022)

BADet: Boundary-Aware 3D Object Detection from Point Clouds (Pattern Recognition

Rui Qian 17 Dec 12, 2022
Voxel Set Transformer: A Set-to-Set Approach to 3D Object Detection from Point Clouds (CVPR 2022)

Voxel Set Transformer: A Set-to-Set Approach to 3D Object Detection from Point Clouds (CVPR2022)[paper] Authors: Chenhang He, Ruihuang Li, Shuai Li, L

Billy HE 141 Dec 30, 2022
Code for "PV-RAFT: Point-Voxel Correlation Fields for Scene Flow Estimation of Point Clouds", CVPR 2021

PV-RAFT This repository contains the PyTorch implementation for paper "PV-RAFT: Point-Voxel Correlation Fields for Scene Flow Estimation of Point Clou

Yi Wei 43 Dec 5, 2022
Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral)

Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral) This is the official implementat

Yifan Zhang 259 Dec 25, 2022
A general python framework for single object tracking in LiDAR point clouds, based on PyTorch Lightning.

Open3DSOT A general python framework for single object tracking in LiDAR point clouds, based on PyTorch Lightning. The official code release of BAT an

Kangel Zenn 172 Dec 23, 2022
The official implementation of ICCV paper "Box-Aware Feature Enhancement for Single Object Tracking on Point Clouds".

Box-Aware Tracker (BAT) Pytorch-Lightning implementation of the Box-Aware Tracker. Box-Aware Feature Enhancement for Single Object Tracking on Point C

Kangel Zenn 5 Mar 26, 2022
Code for "CloudAAE: Learning 6D Object Pose Regression with On-line Data Synthesis on Point Clouds" @ICRA2021

CloudAAE This is an tensorflow implementation of "CloudAAE: Learning 6D Object Pose Regression with On-line Data Synthesis on Point Clouds" Files log:

Gee 35 Nov 14, 2022
Object tracking and object detection is applied to track golf puts in real time and display stats/games.

Putting_Game Object tracking and object detection is applied to track golf puts in real time and display stats/games. Works best with the Perfect Prac

Max 1 Dec 29, 2021
Official PyTorch implementation of CAPTRA: CAtegory-level Pose Tracking for Rigid and Articulated Objects from Point Clouds

CAPTRA: CAtegory-level Pose Tracking for Rigid and Articulated Objects from Point Clouds Introduction This is the official PyTorch implementation of o

Yijia Weng 96 Dec 7, 2022
This repo is a PyTorch implementation for Paper "Unsupervised Learning for Cuboid Shape Abstraction via Joint Segmentation from Point Clouds"

Unsupervised Learning for Cuboid Shape Abstraction via Joint Segmentation from Point Clouds This repository is a PyTorch implementation for paper: Uns

Kaizhi Yang 42 Dec 9, 2022
Unofficial PyTorch implementation of "RTM3D: Real-time Monocular 3D Detection from Object Keypoints for Autonomous Driving" (ECCV 2020)

RTM3D-PyTorch The PyTorch Implementation of the paper: RTM3D: Real-time Monocular 3D Detection from Object Keypoints for Autonomous Driving (ECCV 2020

Nguyen Mau Dzung 271 Nov 29, 2022
This project is the official implementation of our accepted ICLR 2021 paper BiPointNet: Binary Neural Network for Point Clouds.

BiPointNet: Binary Neural Network for Point Clouds Created by Haotong Qin, Zhongang Cai, Mingyuan Zhang, Yifu Ding, Haiyu Zhao, Shuai Yi, Xianglong Li

Haotong Qin 59 Dec 17, 2022
(CVPR 2022 Oral) Official implementation for "Surface Representation for Point Clouds"

RepSurf - Surface Representation for Point Clouds [CVPR 2022 Oral] By Haoxi Ran* , Jun Liu, Chengjie Wang ( * : corresponding contact) The pytorch off

Haoxi Ran 264 Dec 23, 2022
Implementation of CVPR'2022:Reconstructing Surfaces for Sparse Point Clouds with On-Surface Priors

Reconstructing Surfaces for Sparse Point Clouds with On-Surface Priors (CVPR 2022) Personal Web Pages | Paper | Project Page This repository contains

null 151 Dec 26, 2022
Implementation of CVPR'2022:Surface Reconstruction from Point Clouds by Learning Predictive Context Priors

Surface Reconstruction from Point Clouds by Learning Predictive Context Priors (CVPR 2022) Personal Web Pages | Paper | Project Page This repository c

null 136 Dec 12, 2022
Real-Time-Student-Attendence-System - Real Time Student Attendence System

Real-Time-Student-Attendence-System The Student Attendance Management System Pro

Rounak Das 1 Feb 15, 2022
Implementation for the paper 'YOLO-ReT: Towards High Accuracy Real-time Object Detection on Edge GPUs'

YOLO-ReT This is the original implementation of the paper: YOLO-ReT: Towards High Accuracy Real-time Object Detection on Edge GPUs. Prakhar Ganesh, Ya

null 69 Oct 19, 2022