Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
9326c83
sparsedrive baseline
sandropapais Feb 12, 2026
0db2dd9
added detection anchor propogation based on motion prediction
sandropapais Feb 18, 2026
149e940
update git ignore
sandropapais Feb 18, 2026
d4a2489
Merge sd_anchorprop into sd
sandropapais Feb 18, 2026
ff18c99
reverted anchor_prop changes for baseline model
sandropapais Feb 18, 2026
2273e28
added partial occ mask
sandropapais Feb 19, 2026
a9d6870
Added sparse4d configs
sandropapais Feb 19, 2026
764cfb7
added test logging
sandropapais Feb 19, 2026
ce994af
added multiple prediciton refinements experiment
sandropapais Feb 19, 2026
9acbaac
removed unused configs
sandropapais Feb 20, 2026
8965682
fixed bug with loading results in eval
sandropapais Feb 20, 2026
e890261
remove breakpoint
sandropapais Feb 20, 2026
e063251
fix typo
sandropapais Feb 20, 2026
8117b80
partial occluded evaluator using existing labels
sandropapais Feb 20, 2026
12f7812
added occlusion counter printouts
sandropapais Feb 21, 2026
a8f9822
added config
sandropapais Feb 22, 2026
6901121
flash attention patch for sparse4d
sandropapais Feb 22, 2026
5075710
updated sparse4d configs
sandropapais Feb 22, 2026
589ee0c
fixed occluded mask use_valid_flag interaction
sandropapais Feb 22, 2026
fd9a8fa
fixed denominator for occluded/obj_box_col metric
sandropapais Feb 22, 2026
9f8b0a4
added val/all metrics
sandropapais Feb 22, 2026
59d90b2
added rotaug
sandropapais Feb 23, 2026
97fec71
updated occp configs
sandropapais Feb 23, 2026
2d5de23
removed old config
sandropapais Feb 23, 2026
1e6eb73
added dn config
sandropapais Feb 23, 2026
cda8426
config typo
sandropapais Feb 23, 2026
9c5a489
initial pred only setup
sandropapais Feb 23, 2026
ce0755b
freeze det head
sandropapais Feb 23, 2026
f53d824
Added CTRA motion model and fixed eval
sandropapais Feb 24, 2026
7fc5dea
fix ca and ctr
sandropapais Feb 24, 2026
4e2d4ea
bug fix ca
sandropapais Feb 24, 2026
15f9514
fixed ca and ctr bug
sandropapais Feb 24, 2026
34e3d5f
added deformable model
sandropapais Feb 24, 2026
b923ae8
added traj refinement
sandropapais Feb 24, 2026
cf8ee7c
added rand init stage2 pred
sandropapais Feb 24, 2026
e3c99b3
added brier_FDE and top1`_FDE metrics
sandropapais Feb 24, 2026
79df1d2
Merge branch 'sd_predonly' into sd
sandropapais Feb 24, 2026
9e9f277
initial sephead design
sandropapais Feb 24, 2026
083f4df
find unused
sandropapais Feb 24, 2026
dfbcd89
separated params fix
sandropapais Feb 24, 2026
280d4fe
always enable first frame
sandropapais Feb 24, 2026
377203e
remove ffn
sandropapais Feb 24, 2026
445f40f
removed refine layer
sandropapais Feb 24, 2026
8c2be37
added refiner
sandropapais Feb 24, 2026
e6e5f40
aux loss for sep head
sandropapais Feb 25, 2026
1c1a530
updated cc_run
sandropapais Feb 25, 2026
1ec07ea
fix for first sample
sandropapais Feb 25, 2026
c77aaaf
update
sandropapais Feb 25, 2026
e40310a
Merge pull request #3 from TRAILab/sd_evaloccp
sandropapais Feb 25, 2026
ed583e2
Merge pull request #4 from TRAILab/sd
sandropapais Feb 25, 2026
1b59339
added full occ data gen and viz
sandropapais Feb 25, 2026
831e496
Merge branch 'sd' into sd_sephead
sandropapais Feb 25, 2026
8c88b36
Merge branch 'sd_sephead' of github.com:TRAILab/ForeSight into sd_sep…
sandropapais Feb 25, 2026
607cd66
new configs
sandropapais Feb 25, 2026
50799a1
typo fix
sandropapais Feb 25, 2026
9727f28
new config
sandropapais Feb 25, 2026
77b5fa6
fixed occluded eval to filter visible preds
sandropapais Feb 26, 2026
66520b7
added visibility head
sandropapais Feb 26, 2026
81657c0
fixed vis head issue
sandropapais Feb 26, 2026
d4691d1
cache fix
sandropapais Feb 26, 2026
7caae13
fix map compatibility with vis head
sandropapais Feb 26, 2026
19c4c7b
remove cache failed fix
sandropapais Feb 26, 2026
f5056b3
fix vis head
sandropapais Feb 26, 2026
9aae31a
typo fix
sandropapais Feb 26, 2026
236416c
added val/vis/ metrics
sandropapais Feb 26, 2026
761b643
fixed eval bug with filter too aggressive
sandropapais Feb 27, 2026
110c56e
updated cc runfile
sandropapais Feb 27, 2026
5994e26
debug setup
sandropapais Feb 27, 2026
85de643
data gen notes
sandropapais Mar 4, 2026
9c88ad5
new config
sandropapais Mar 4, 2026
0e6e7fc
fixed typo
sandropapais Mar 4, 2026
0bae2ca
Merge branch 'sd_sephead' into sd
sandropapais Mar 5, 2026
c83870c
updated occf configs
sandropapais Mar 5, 2026
7d5e76a
typo fix
sandropapais Mar 5, 2026
9b1f8ff
Merge branch 'sd' of github.com:TRAILab/ForeSight into sd
sandropapais Mar 5, 2026
c675e42
new sephead config
sandropapais Mar 5, 2026
25183e3
new config
sandropapais Mar 5, 2026
00b17ef
add ffn to sephead
sandropapais Mar 5, 2026
c44cfb7
added quality_estimation to sephead
sandropapais Mar 5, 2026
48d9a69
added sephead ffn
sandropapais Mar 5, 2026
e9c0095
new dataset converter
sandropapais Mar 5, 2026
dc2c89d
fixed gt_visibility range filtering
sandropapais Mar 5, 2026
9314bc6
removed debug configs
sandropapais Mar 5, 2026
880af8e
new sephead implementation with single frame decoder isolation and vi…
sandropapais Mar 5, 2026
9915329
new pretrained checkpoint config
sandropapais Mar 5, 2026
35e1dfc
config update
sandropapais Mar 5, 2026
3c4eede
added occeval config
sandropapais Mar 5, 2026
b2c3d3c
added adaptive mAPocc
sandropapais Mar 5, 2026
4a885f0
fixed vishead configs loss
sandropapais Mar 5, 2026
9de9d3c
fix vis loss
sandropapais Mar 5, 2026
d843c81
visloss error
sandropapais Mar 5, 2026
c6fb0a2
update configs
sandropapais Mar 8, 2026
230f2ee
updated configs
sandropapais Mar 10, 2026
9b35b67
update configs
sandropapais Mar 10, 2026
7d35824
removed unused configs
sandropapais Mar 11, 2026
7ac0de2
added r101 s2 config
sandropapais Mar 11, 2026
4627a91
added new predonly configs
sandropapais Mar 11, 2026
c12d15f
updated r101 configs
sandropapais Mar 12, 2026
2a9412d
Remove identifying scripts and notes for anonymous submission
sandropapais Mar 12, 2026
378972f
Remove README for anonymous submission
sandropapais Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*.pyc
*.npy
*.pth
*.whl
*.swp
*.sif

wandb/
data/
ckpt/
work_dirs*/
dist_test/
vis/
val/
lib/
logs/

*.egg-info
build/
__pycache__/
*.so

job_scripts/
temp_ops/
222 changes: 21 additions & 201 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,201 +1,21 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
MIT License

Copyright (c) 2024 swc-17

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 0 additions & 8 deletions README.md

This file was deleted.

22 changes: 22 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM pytorch/pytorch:1.13.0-cuda11.6-cudnn8-devel
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6+PTX" \
TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \
FORCE_CUDA="1"

# Install the MMDetection3D required packages
RUN apt-get update \
&& apt-get install -y ffmpeg libsm6 libxext6 git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install StreamPETR required packages
WORKDIR /workspace/ForeSight/
COPY requirement.txt .
COPY projects/ projects/
RUN pip install mmcv-full==1.7.1 -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.13.0/index.html
RUN pip install --no-cache-dir -r requirement.txt
RUN cd projects/mmdet3d_plugin/ops && python setup.py develop
RUN git config --global --add safe.directory '*'

WORKDIR /workspace/ForeSight/
64 changes: 64 additions & 0 deletions docs/quick_start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Quick Start

### Set up a new virtual environment
```bash
conda create -n sparsedrive python=3.8 -y
conda activate sparsedrive
```

### Install dependency packpages
```bash
sparsedrive_path="path/to/sparsedrive"
cd ${sparsedrive_path}
pip3 install --upgrade pip
pip3 install torch==1.13.0+cu116 torchvision==0.14.0+cu116 torchaudio==0.13.0 --extra-index-url https://download.pytorch.org/whl/cu116
pip3 install -r requirement.txt
```

### Compile the deformable_aggregation CUDA op
```bash
cd projects/mmdet3d_plugin/ops
python3 setup.py develop
cd ../../../
```

### Prepare the data
Download the [NuScenes dataset](https://www.nuscenes.org/nuscenes#download) and CAN bus expansion, put CAN bus expansion in /path/to/nuscenes, create symbolic links.
```bash
cd ${sparsedrive_path}
mkdir data
ln -s path/to/nuscenes ./data/nuscenes
```

Pack the meta-information and labels of the dataset, and generate the required pkl files to data/infos. Note that we also generate map_annos in data_converter, with a roi_size of (30, 60) as default, if you want a different range, you can modify roi_size in tools/data_converter/nuscenes_converter.py.
```bash
sh scripts/create_data.sh
```

### Generate anchors by K-means
Gnerated anchors are saved to data/kmeans and can be visualized in vis/kmeans.
```bash
sh scripts/kmeans.sh
```


### Download pre-trained weights
Download the required backbone [pre-trained weights](https://download.pytorch.org/models/resnet50-19c8e357.pth).
```bash
mkdir ckpt
wget https://download.pytorch.org/models/resnet50-19c8e357.pth -O ckpt/resnet50-19c8e357.pth
```

### Commence training and testing
```bash
# train
sh scripts/train.sh

# test
sh scripts/test.sh
```

### Visualization
```
sh scripts/visualize.sh
```
Loading