{"id":13442637,"url":"https://github.com/Eaphan/GLENet","last_synced_at":"2025-03-20T14:31:44.615Z","repository":{"id":152544486,"uuid":"591346580","full_name":"Eaphan/GLENet","owner":"Eaphan","description":"GLENet: Boosting 3D Object Detectors with Generative Label Uncertainty Estimation [IJCV2023]","archived":false,"fork":false,"pushed_at":"2024-06-04T06:57:54.000Z","size":3342,"stargazers_count":186,"open_issues_count":0,"forks_count":11,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-28T05:59:30.372Z","etag":null,"topics":["3d-object-detection","generative-model","machine-learning","probabilistic-models","uncertainty-estimation"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2207.02466","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Eaphan.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-20T14:35:23.000Z","updated_at":"2024-10-19T08:23:12.000Z","dependencies_parsed_at":"2024-10-28T04:00:23.559Z","dependency_job_id":"77f133e9-974a-46a2-9a99-d04967ce3fbf","html_url":"https://github.com/Eaphan/GLENet","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/Eaphan%2FGLENet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eaphan%2FGLENet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eaphan%2FGLENet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Eaphan%2FGLENet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Eaphan","download_url":"https://codeload.github.com/Eaphan/GLENet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244630243,"owners_count":20484342,"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":["3d-object-detection","generative-model","machine-learning","probabilistic-models","uncertainty-estimation"],"created_at":"2024-07-31T03:01:48.389Z","updated_at":"2025-03-20T14:31:43.660Z","avatar_url":"https://github.com/Eaphan.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# GLENet \n[![PWC](https://img.shields.io/endpoint.svg?url=https://paperswithcode.com/badge/glenet-boosting-3d-object-detectors-with/3d-object-detection-on-kitti-cars-hard)](https://paperswithcode.com/sota/3d-object-detection-on-kitti-cars-hard?p=glenet-boosting-3d-object-detectors-with) \n[![arXiv](https://img.shields.io/badge/arXiv-Paper-\u003cCOLOR\u003e.svg)](https://arxiv.org/abs/2207.02466)\n![visitors](https://visitor-badge.glitch.me/badge?page_id=Eaphan/GLENet)\n## Overview\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Dataset Preparation](#dataset-preparation)\n- [Generate Label Uncertainty with GLEnet](#generate-label-uncertainty-with-glenet)\n- [Probabilistic Object Detectors](#probabilistic-object-detectors)\n- [License](#license)\n- [Acknowledgement](#acknowledgement)\n\n## Introduction\nImplementation of paper: \"GLENet: Boosting 3D Object Detectors with Generative Label Uncertainty Estimation\". The implementation contains two parts, GLENet for generating label uncertainty and probability detectors part implemented based on [`[OpenPcdet 0.5.2]`](https://github.com/open-mmlab/OpenPCDet).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/pipeline.png\" width=\"857\" height=\"320\"\u003e\n  \n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/sm_plenet_out.png\" width=\"818\" height=\"320\"\u003e\n  \u003cfigcaption align = \"center\"\u003eFig.1 Visual results of GLENet. The ground-truth and predictions are colored in red and green\u003c/figcaption\u003e\n\u003c/p\u003e\n\n## Installation\n### Requrements\n* Linux\n* Python 3.6+\n* PyTorch 1.1 or higher (tested on PyTorch 1.1, 1,3, 1,5~1.10)\n* CUDA 9.0 or higher (PyTorch 1.3+ needs CUDA 9.2+)\n* [`spconv v1.0 (commit 8da6f96)`](https://github.com/traveller59/spconv/tree/8da6f967fb9a054d8870c3515b1b44eca2103634) or [`spconv v1.2`](https://github.com/traveller59/spconv)\n### Install\n* a. install dependent python libraries:\n```\ncd GLENet;pip install -r requirements.txt \n```\n\n* b. Install the SparseConv library, we use the implementation from [`[spconv]`](https://github.com/traveller59/spconv). \n    * If you use PyTorch 1.1, then make sure you install the `spconv v1.0` with ([commit 8da6f96](https://github.com/traveller59/spconv/tree/8da6f967fb9a054d8870c3515b1b44eca2103634)) instead of the latest one.\n    * If you use PyTorch 1.3+, then you need to install the `spconv v1.2`. As mentioned by the author of [`spconv`](https://github.com/traveller59/spconv), you need to use their docker if you use PyTorch 1.4+.\n* c. Install this `pcdet` library and its dependent libraries by running the following command:\n```shell\npython setup.py develop\n```\n## Dataset Preparation\n### KITTI Dataset\n* Please download the official [KITTI 3D object detection](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=3d) dataset and organize the downloaded files as follows (the road planes could be downloaded from [[road plane]](https://drive.google.com/file/d/1d5mq0RXRnvHPVeKx6Q612z0YRO1t2wAp/view?usp=sharing), which are optional for data augmentation in the training):\n\n```\nGLENet\n├── data\n│   ├── kitti\n│   │   │── ImageSets\n│   │   │── training\n│   │   │   ├──calib \u0026 velodyne \u0026 label_2 \u0026 image_2 \u0026 planes\n│   │   │── testing\n│   │   │   ├──calib \u0026 velodyne \u0026 image_2\n├── cvae_uncertainty\n├── pcdet\n├── tools\n```\n\n* Generate the data infos by running the following command: \n```python \npython -m pcdet.datasets.kitti.kitti_dataset create_kitti_infos tools/cfgs/dataset_configs/kitti_dataset.yaml\n```\n### Waymo Open Dataset\n* Please download the official [Waymo Open Dataset](https://waymo.com/open/download/)(v1.2.0), \nincluding the training data `training_0000.tar~training_0031.tar` and the validation \ndata `validation_0000.tar~validation_0007.tar`.\n* Unzip all the above `xxxx.tar` files to the directory of `data/waymo/raw_data` as follows (You could get 798 *train* tfrecord and 202 *val* tfrecord ):  \n```\nGLENet\n├── data\n│   ├── waymo\n│   │   │── ImageSets\n│   │   │── raw_data\n│   │   │   │── segment-xxxxxxxx.tfrecord\n|   |   |   |── ...\n|   |   |── waymo_processed_data_v0_5_0\n│   │   │   │── segment-xxxxxxxx/\n|   |   |   |── ...\n│   │   │── waymo_processed_data_v0_5_0_gt_database_train_sampled_1/\n│   │   │── waymo_processed_data_v0_5_0_waymo_dbinfos_train_sampled_1.pkl\n│   │   │── waymo_processed_data_v0_5_0_gt_database_train_sampled_1_global.npy (optional)\n│   │   │── waymo_processed_data_v0_5_0_infos_train.pkl (optional)\n│   │   │── waymo_processed_data_v0_5_0_infos_val.pkl (optional)\n├── cvae_uncertainty\n├── pcdet\n├── tools\n```\n* Install the official `waymo-open-dataset` by running the following command: \n```shell script\npip3 install --upgrade pip\n# tf 2.0.0\npip3 install waymo-open-dataset-tf-2-5-0 --user\n```\n\n* Extract point cloud data from tfrecord and generate data infos by running the following command (it takes several hours, \nand you could refer to `data/waymo/waymo_processed_data_v0_5_0` to see how many records that have been processed): \n```python \npython -m pcdet.datasets.waymo.waymo_dataset --func create_waymo_infos \\\n    --cfg_file tools/cfgs/dataset_configs/waymo_dataset.yaml\n```\n\nNote that you do not need to install `waymo-open-dataset` if you have already processed the data before and do not need to evaluate with official Waymo Metrics.\n\n\n## Generate Label Uncertainty with GLEnet\n### step 1.0: prepare data for GLENet \u003cbr\u003e\nln -s  data/kitti cvae_uncertainty \u003cbr\u003e\nln -s  data/waymo cvae_uncertainty \u003cbr\u003e\n### step1.1: Train GLENet:\n```\ncd cvae_uncertainty;mkdir -p logs;\nexp_id=exp20 # you can set other exp_id\nfor iter in `seq 0 9`;do\n    sed \"s@# FOLD_IDX: 0@FOLD_IDX: ${iter}@\" cfgs/${exp_id}_gen_ori.yaml \u003e cfgs/${exp_id}_gen.yaml\n    grep FOLD cfgs/${exp_id}_gen.yaml\n    CUDA_VISIBLE_DEVICES=0,1 bash scripts/dist_train.sh 2 --cfg_file cfgs/${exp_id}_gen.yaml --tcp_port 18889  --max_ckpt_save_num 10  --workers 1 --extra_tag fold_${iter} \u0026\u003e\u003e logs/${exp_id}_gen_fold_${iter}.log\ndone\n```\n### step 1.2: GLENet Prediction:\n```\ncd cvae_uncertainty;\nexp_id=exp20\nfor iter in `seq 0 9`;do\n    sed \"s@# FOLD_IDX: 0@FOLD_IDX: ${iter}@\" cfgs/${exp_id}_gen_ori.yaml \u003e cfgs/${exp_id}_gen.yaml\n    grep FOLD cfgs/${exp_id}_gen.yaml\n    sh predict.sh ${exp_id}_gen fold_${iter} 400 0\ndone\n```\n### step 1.3: Generate and Save Label Uncertainty\n* mkdir -p output/uncertainty_dump\n* python mapping_uncertainty.py\n* python change_gt_infos.py\n\nThen you can use the new *.pkl that contains label uncertainty to **replace** the origin file.\n\nWe provide the [kitti_infos_train.pkl](https://drive.google.com/file/d/1iQl3krptYDBfmLsQFR8xip4Wtl8jj-Uy/view?usp=sharing) and [kitti_dbinfos_train.pkl](https://drive.google.com/file/d/1bSmFeO3M4YgXsUG8qSfs_aPoXWXSPX3C/view?usp=sharing) that contain label uncertainty.\n\n\n## Probabilistic Object Detectors\n### Training\n```\ncd tools;\npython train.py --cfg_file ./cfgs/kitti_models/GLENet_VR.yaml\n```\nMulti gpu training, assuming you have 4 gpus:\n\n```\nCUDA_VISIBLE_DEVICES=0,1,2,3 bash scripts/dist_train.sh 4 --cfg_file ./cfgs/kitti_models/GLENet_VR.yaml\n\n```\n\n### Testing\n```\ncd tools/\n```\nSingle gpu testing for all saved checkpoints, assuming you have 4 gpus:\n```\npython test.py --eval_all --cfg_file ./cfgs/kitti_models/GLENet_VR.yaml\n```\n\nMulti gpu testing for all saved checkpoints, assuming you have 4 gpus:\n```\nCUDA_VISIBLE_DEVICES=0,1,2,3 bash scripts/dist_test.sh 4 --eval_all --cfg_file ./cfgs/kitti_models/GLENet_VR.yaml\n```\n\nMulti gpu testing a specific checkpoint, assuming you have 4 gpus and checkpoint_39 is your best checkpoint :\n```\nCUDA_VISIBLE_DEVICES=0,1,2,3 bash scripts/dist_test.sh 4  --cfg_file ./cfgs/kitti_models/GLENet_VR.yaml --ckpt ../output/GLENet_VR/default/ckpt/checkpoint_epoch_80.pth\n```\n\n## Pretrained Models\nWe provide the pre-trained models for car class on the KITTI dataset.\n\n| Method | Simple@R11 | Moderate@R11 | Hard@R11 | Moderate@R40 | Download |\n|--------|----------:|:-------:|:-------:|:-------:|:---------:|\n| SECOND(Baseline) | 88.61 | 78.62 | 77.22 | 79.94 | - |\n| [GLENet-S(Ours)](tools/cfgs/kitti_models/GLENet_S.yaml) | 88.60 | 84.41 | 78.42 | 84.81 | [Download](https://drive.google.com/file/d/1gC-cGRer0X56F1i2AGr4WQar-0NTO6sN/view?usp=sharing) |\n| CIA-SSD(Baseline) | 90.04 | 79.81 | 78.80 | 84.16 | - |\n| [GLENet-C(Ours)](tools/cfgs/kitti_models/GLENet_C.yaml) | 89.81 | 84.54 | 78.82 | 85.19 | [Download](https://drive.google.com/file/d/1wJfE7lDCsLuVhua-OyXpPLYO7rhK15eZ/view?usp=sharing) |\n| Voxel R-CNN(Baseline) | 89.41 | 84.52 | 78.93 | 85.29 | - |\n| [GLENet-VR(Ours)](tools/cfgs/kitti_models/GLENet_VR.yaml) | 89.95 | 86.49 | 79.18 | 86.23 | [Download](https://drive.google.com/file/d/1FKZmaD7HCMFJg5TloBzAt_2S7QmQY9fX/view?usp=sharing) |\n\n\n\n## Citation\nIf you find this work useful in your research, please consider citing:\n```\n@article{zhang2023glenet,\n    title={GLENet: Boosting 3D object detectors with generative label uncertainty estimation},\n    author={Zhang, Yifan and Zhang, Qijian and Zhu, Zhiyu and Hou, Junhui and Yuan, Yixuan},\n    journal={International Journal of Computer Vision},\n    volume={131},\n    number={12},\n    pages={3332--3352},\n    year={2023}\n}\n```\n\n## License\n`GLENet` is released under the [Apache 2.0 license](LICENSE).\n\n## Acknowledgement\nThanks for the OpenPCDet, the implementation of probabilistic object detectors part is mainly based on the pcdet v0.5.2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEaphan%2FGLENet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FEaphan%2FGLENet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FEaphan%2FGLENet/lists"}