{"id":13443626,"url":"https://github.com/cxy1997/3D_adapt_auto_driving","last_synced_at":"2025-03-20T16:32:18.551Z","repository":{"id":39738769,"uuid":"251484263","full_name":"cxy1997/3D_adapt_auto_driving","owner":"cxy1997","description":"Train in Germany, Test in The USA: Making 3D Object Detectors Generalize","archived":false,"fork":false,"pushed_at":"2023-03-24T22:17:22.000Z","size":464,"stargazers_count":130,"open_issues_count":11,"forks_count":13,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-10-28T06:58:36.514Z","etag":null,"topics":["3d-object-detection","domain-adaptation","pytorch"],"latest_commit_sha":null,"homepage":"https://arxiv.org/abs/2005.08139","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cxy1997.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-03-31T02:50:27.000Z","updated_at":"2024-10-15T03:18:02.000Z","dependencies_parsed_at":"2024-01-18T14:46:26.506Z","dependency_job_id":"bf336b68-9328-447c-8686-3828103a7d19","html_url":"https://github.com/cxy1997/3D_adapt_auto_driving","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/cxy1997%2F3D_adapt_auto_driving","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxy1997%2F3D_adapt_auto_driving/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxy1997%2F3D_adapt_auto_driving/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cxy1997%2F3D_adapt_auto_driving/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cxy1997","download_url":"https://codeload.github.com/cxy1997/3D_adapt_auto_driving/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244650014,"owners_count":20487539,"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","domain-adaptation","pytorch"],"created_at":"2024-07-31T03:02:05.557Z","updated_at":"2025-03-20T16:32:18.048Z","avatar_url":"https://github.com/cxy1997.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Train in Germany, Test in The USA: Making 3D Object Detectors Generalize\n\nThis paper has been accpeted by Conference on Computer Vision and Pattern Recognition ([CVPR](http://cvpr2020.thecvf.com/)) 2020.\n\n[Train in Germany, Test in The USA: Making 3D Object Detectors Generalize](https://arxiv.org/abs/2005.08139)\n\nby [Yan Wang*](https://www.cs.cornell.edu/~yanwang/), [Xiangyu Chen*](https://www.cs.cornell.edu/~xchen/), [Yurong You](http://yurongyou.com/), [Li Erran](http://www.cs.columbia.edu/~lierranli/), [Bharath Hariharan](http://home.bharathh.info/), [Mark Campbell](https://campbell.mae.cornell.edu/), [Kilian Q. Weinberger](http://kilian.cs.cornell.edu/), [Wei-Lun Chao*](http://www-scf.usc.edu/~weilunc/)\n\n![Figure](statnorm.png)\n\n## Dependencies\n- [Python 3.6.10](https://www.python.org/downloads/)\n- [PyTorch(1.0.0)](http://pytorch.org)\n\n## Usage\n\n### Prepare Datasets ([Jupyter notebook](notebooks/prepare_datasets.ipynb))\n\nWe develop our method on these datasets:\n- [KITTI object detection 3D dataset](http://www.cvlibs.net/datasets/kitti/eval_object.php?obj_benchmark=3d)\n- [Argoverse dataset v1.1](https://www.argoverse.org/data.html)\n- [nuScenes dataset v1.0](https://www.nuscenes.org/nuscenes)\n- [Lyft Level 5 dataset v1.02](https://self-driving.lyft.com/level5/data/)\n- [Waymo dataset v1.0](https://waymo.com/open/data/)\n\n1. Configure `dataset_path` in [config_path.py](config_path.py).\n\n    Raw datasets will be organized as the following structure:\n    \n    \u003cpre\u003e\n    dataset_path/\n        | kitti/               # KITTI object detection 3D dataset\n            | training/\n            | testing/\n        | argo/                # Argoverse dataset v1.1\n            | train1/\n            | train2/\n            | train3/\n            | train4/\n            | val/\n            | test/\n        | nusc/                # nuScenes dataset v1.0\n            | maps/\n            | samples/\n            | sweeps/\n            | v1.0-trainval/\n        | lyft/                # Lyft Level 5 dataset v1.02\n            | v1.02-train/\n        | waymo/               # Waymo dataset v1.0\n            | training/\n            | validation/\n    \u003c/pre\u003e\n\n2. Download all datasets.\n\n    For `KITTI`, `Argoverse` and `Waymo`, we provide scripts for automatic download.\n    ```bash\n    cd scripts/\n    python download.py [--datasets kitti+argo+waymo]\n    ```\n    [nuScenes](https://www.nuscenes.org/download) and [Lyft](https://level5.lyft.com/dataset/download-dataset/) need to downloaded manually.\n\n3. Convert all datasets to `KITTI format`.\n\n    ```bash\n    cd scripts/\n    python -m pip install -r convert_requirements.txt\n    python convert.py [--datasets argo+nusc+lyft+waymo]\n    ```\n\n4. Split validation set\n\n    We provide the `train`/`val` split used in our experiments under [split](split/) folder.\n    \n    ```bash\n    cd split/\n    python replace_split.py\n    ```\n   \n4. Generate `car` subset\n\n    We filter scenes and only keep those with cars.\n    \n    ```bash\n    cd scripts/\n    python gen_car_split.py\n    ```\n\n### Statistical Normalization ([Jupyter notebook](notebooks/stat_norm.ipynb))\n\n1. Compute car size statistics of each dataset. \nThe computed statistics are stored as `label_stats_{train/val/test}.json` under KITTI format dataset root.\n\n    ```bash\n    cd stat_norm/\n    python stat.py\n    ```\n\n2. Generate rescaled datasets according to car size statistics. \nThe rescaled datasets are stored under `$dataset_path/rescaled_datasets` by default.\n\n    ```bash\n    cd stat_norm/\n    python norm.py [--path $PATH]\n    ```\n   \n### Training (To be updated)\n\nWe use [PointRCNN](https://arxiv.org/abs/1812.04244) to validate our method. \n\n1. Setup PointRCNN\n\n    ```bash\n    cd pointrcnn/\n    ./build_and_install.sh\n    ```\n\n2. Build datasets in PointRCNN format.\n\n    ```bash\n    cd pointrcnn/tools/\n    python generate_multi_data.py\n    python generate_gt_database.py --root ...\n    ```\n   The `NuScence` dataset has much less points in each bounding box, so we have to turn of the `GT_AUG_HARD_RATIO` augmentation.\n\n3. Download the models pretrained on source domains from [google drive](https://drive.google.com/drive/folders/14MXjNImFoS2P7YprLNpSmFBsvxf5J2Kw?usp=sharing) using [gdrive](https://github.com/gdrive-org/gdrive/releases/download/2.1.0/gdrive-linux-x64).\n\n    ```bash\n    cd pointrcnn/tools/\n    gdrive download -r 14MXjNImFoS2P7YprLNpSmFBsvxf5J2Kw\n    ```\n    \n4. Adapt to a new domain by re-training with rescaled data.\n\n    ```bash\n    cd pointrcnn/tools/\n    \n    python train_rcnn.py --cfg_file ...\n    ```\n   \n### Inference\n```bash\ncd pointrcnn/tools/\npython eval_rcnn.py --ckpt /path/to/checkpoint.pth --dataset $dataset --output_dir $output_dir \n```\n\n### Evaluation\n\nWe provide [evaluation code](evaluate/evaluate.py#L279) with\n- old (based on bbox height) and new (based on distance) difficulty metrics\n- \u003cem\u003eoutput transformation\u003c/em\u003e functions to locate domain gap\n\n```bash\npython evaluate/\npython evaluate.py --result_path $predictions --dataset_path $dataset_root --metric [old/new]\n```\n\n## Citation\n```\n@inproceedings{wang2020train,\n  title={Train in germany, test in the usa: Making 3d object detectors generalize},\n  author={Yan Wang and Xiangyu Chen and Yurong You and Li Erran and Bharath Hariharan and Mark Campbell and Kilian Q. Weinberger and Wei-Lun Chao},\n  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},\n  pages={11713-11723},\n  year={2020}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxy1997%2F3D_adapt_auto_driving","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcxy1997%2F3D_adapt_auto_driving","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcxy1997%2F3D_adapt_auto_driving/lists"}