{"id":13444004,"url":"https://github.com/nutonomy/second.pytorch","last_synced_at":"2025-03-20T17:32:51.312Z","repository":{"id":41068859,"uuid":"161410906","full_name":"nutonomy/second.pytorch","owner":"nutonomy","description":"PointPillars for KITTI object detection","archived":true,"fork":true,"pushed_at":"2020-05-15T09:45:34.000Z","size":7337,"stargazers_count":964,"open_issues_count":1,"forks_count":238,"subscribers_count":59,"default_branch":"master","last_synced_at":"2024-08-01T03:45:30.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"traveller59/second.pytorch","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nutonomy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-12T00:29:38.000Z","updated_at":"2024-07-28T14:17:19.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/nutonomy/second.pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutonomy%2Fsecond.pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutonomy%2Fsecond.pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutonomy%2Fsecond.pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nutonomy%2Fsecond.pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nutonomy","download_url":"https://codeload.github.com/nutonomy/second.pytorch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221786132,"owners_count":16879965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:02:16.397Z","updated_at":"2024-10-28T05:31:47.300Z","avatar_url":"https://github.com/nutonomy.png","language":"Python","readme":"# PointPillars\n\nWelcome to PointPillars.\n\nThis repo demonstrates how to reproduce the results from\n[_PointPillars: Fast Encoders for Object Detection from Point Clouds_](https://arxiv.org/abs/1812.05784) (to be published at CVPR 2019) on the\n[KITTI dataset](http://www.cvlibs.net/datasets/kitti/) by making the minimum required changes from the preexisting\nopen source codebase [SECOND](https://github.com/traveller59/second.pytorch). \n\nThis is not an official nuTonomy codebase, but it can be used to match the published PointPillars results.\n\n**WARNING: This code is not being actively maintained. This code can be used to reproduce the results in the first version of the paper, https://arxiv.org/abs/1812.05784v1. For an actively maintained repository that can also reproduce PointPillars results on nuScenes, we recommend using [SECOND](https://github.com/traveller59/second.pytorch). We are not the owners of the repository, but we have worked with the author and endorse his code.**\n\n![Example Results](https://raw.githubusercontent.com/nutonomy/second.pytorch/master/images/pointpillars_kitti_results.png)\n\n\n## Getting Started\n\nThis is a fork of [SECOND for KITTI object detection](https://github.com/traveller59/second.pytorch) and the relevant\nsubset of the original README is reproduced here.\n\n### Code Support\n\nONLY supports python 3.6+, pytorch 0.4.1+. Code has only been tested on Ubuntu 16.04/18.04.\n\n### Install\n\n#### 1. Clone code\n\n```bash\ngit clone https://github.com/nutonomy/second.pytorch.git\n```\n\n#### 2. Install Python packages\n\nIt is recommend to use the Anaconda package manager.\n\nFirst, use Anaconda to configure as many packages as possible.\n```bash\nconda create -n pointpillars python=3.7 anaconda\nsource activate pointpillars\nconda install shapely pybind11 protobuf scikit-image numba pillow\nconda install pytorch torchvision -c pytorch\nconda install google-sparsehash -c bioconda\n```\n\nThen use pip for the packages missing from Anaconda.\n```bash\npip install --upgrade pip\npip install fire tensorboardX\n```\n\nFinally, install SparseConvNet. This is not required for PointPillars, but the general SECOND code base expects this\nto be correctly configured. \n```bash\ngit clone git@github.com:facebookresearch/SparseConvNet.git\ncd SparseConvNet/\nbash build.sh\n# NOTE: if bash build.sh fails, try bash develop.sh instead\n```\n\nAdditionally, you may need to install Boost geometry:\n\n```bash\nsudo apt-get install libboost-all-dev\n```\n\n\n#### 3. Setup cuda for numba\n\nYou need to add following environment variables for numba to ~/.bashrc:\n\n```bash\nexport NUMBAPRO_CUDA_DRIVER=/usr/lib/x86_64-linux-gnu/libcuda.so\nexport NUMBAPRO_NVVM=/usr/local/cuda/nvvm/lib64/libnvvm.so\nexport NUMBAPRO_LIBDEVICE=/usr/local/cuda/nvvm/libdevice\n```\n\n#### 4. PYTHONPATH\n\nAdd second.pytorch/ to your PYTHONPATH.\n\n### Prepare dataset\n\n#### 1. Dataset preparation\n\nDownload KITTI dataset and create some directories first:\n\n```plain\n└── KITTI_DATASET_ROOT\n       ├── training    \u003c-- 7481 train data\n       |   ├── image_2 \u003c-- for visualization\n       |   ├── calib\n       |   ├── label_2\n       |   ├── velodyne\n       |   └── velodyne_reduced \u003c-- empty directory\n       └── testing     \u003c-- 7580 test data\n           ├── image_2 \u003c-- for visualization\n           ├── calib\n           ├── velodyne\n           └── velodyne_reduced \u003c-- empty directory\n```\n\nNote: PointPillar's protos use ```KITTI_DATASET_ROOT=/data/sets/kitti_second/```.\n\n#### 2. Create kitti infos:\n\n```bash\npython create_data.py create_kitti_info_file --data_path=KITTI_DATASET_ROOT\n```\n\n#### 3. Create reduced point cloud:\n\n```bash\npython create_data.py create_reduced_point_cloud --data_path=KITTI_DATASET_ROOT\n```\n\n#### 4. Create groundtruth-database infos:\n\n```bash\npython create_data.py create_groundtruth_database --data_path=KITTI_DATASET_ROOT\n```\n\n#### 5. Modify config file\n\nThe config file needs to be edited to point to the above datasets:\n\n```bash\ntrain_input_reader: {\n  ...\n  database_sampler {\n    database_info_path: \"/path/to/kitti_dbinfos_train.pkl\"\n    ...\n  }\n  kitti_info_path: \"/path/to/kitti_infos_train.pkl\"\n  kitti_root_path: \"KITTI_DATASET_ROOT\"\n}\n...\neval_input_reader: {\n  ...\n  kitti_info_path: \"/path/to/kitti_infos_val.pkl\"\n  kitti_root_path: \"KITTI_DATASET_ROOT\"\n}\n```\n\n\n### Train\n\n```bash\ncd ~/second.pytorch/second\npython ./pytorch/train.py train --config_path=./configs/pointpillars/car/xyres_16.proto --model_dir=/path/to/model_dir\n```\n\n* If you want to train a new model, make sure \"/path/to/model_dir\" doesn't exist.\n* If \"/path/to/model_dir\" does exist, training will be resumed from the last checkpoint.\n* Training only supports a single GPU. \n* Training uses a batchsize=2 which should fit in memory on most standard GPUs.\n* On a single 1080Ti, training xyres_16 requires approximately 20 hours for 160 epochs.\n\n\n### Evaluate\n\n\n```bash\ncd ~/second.pytorch/second/\npython pytorch/train.py evaluate --config_path= configs/pointpillars/car/xyres_16.proto --model_dir=/path/to/model_dir\n```\n\n* Detection result will saved in model_dir/eval_results/step_xxx.\n* By default, results are stored as a result.pkl file. To save as official KITTI label format use --pickle_result=False.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnutonomy%2Fsecond.pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnutonomy%2Fsecond.pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnutonomy%2Fsecond.pytorch/lists"}