1.6k GitHub stars and counting — cvg/nice-slam is a Python project TopGit is tracking across repositories on the platform. [CVPR'22] NICE-SLAM: Neural Implicit Scalable Encoding for SLAM
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Note for users from China: If you encounter slow speed in downloading, check in all the scripts/download_*.sh scripts, where we also provide the 和彩云 links for you to download manually.
Please follow the data downloading procedure on ScanNet website, and extract color/depth frames from the .sens file using this code.
[Directory structure of ScanNet (click to expand)]
DATAROOT is ./Datasets by default. If a sequence (sceneXXXX_XX) is stored in other places, please change the input_folder path in the config file or in the command line.
Download the data as below and the data is saved into the ./Datasets/Replica folder. Note that the Replica data is generated by the authors of iMAP, so please cite iMAP if you use the data.
Please first follow this guide to record a sequence and extract aligned color and depth images. (Remember to use --align_depth_to_color for azure_kinect_recorder.py)
DATAROOT is ./Datasets in default, if a sequence (sceneXX) is stored in other places, please change the "input_folder" path in the config file or in the command line.
Prepare .yaml file based on the configs/Own/sample.yaml. Change the camera intrinsics in the config file based on intrinsic.json. You can also get the intrinsics of the depth camera via other tools such as MATLAB.
Specify the bound of the scene. If no ground truth camera pose is given, we construct world coordinates on the first frame. The X-axis is from left to right, Y-axis is from down to up, Z-axis is from front to back.
Change the input_folder path and/or the output path in the config file or the command line.
Run NICE-SLAM.
python -W ignore run.py configs/Own/sample.yaml
(Optional but highly Recommended) If you don't want to specify the bound of the scene or manually change the config file. You can first run the Redwood tool in Open3D and then run NICE-SLAM. Here we provide steps for the whole pipeline, beginning from recording Azure Kinect videos. (Ubuntu 18.04 and above is recommended.)
Download the Open3D repository.
bash scripts/download_open3d.sh
Record and extract frames.
# specify scene ID
sceneid=0
cd 3rdparty/Open3D-0.13.0/examples/python/reconstruction_system/
# record and save to .mkv file
python sensors/azure_kinect_recorder.py --align_depth_to_color --output scene$sceneid.mkv
# extract frames
python sensors/azure_kinect_mkv_reader.py --input scene$sceneid.mkv --output dataset/scene$sceneid
Run reconstruction.
python run_system.py dataset/scene$sceneid/config.json --make --register --refine --integrate
# back to main folder
cd ../../../../../
We also provide our re-implementation of iMAP (iMAP*) for use. If you use the code, please cite both the original iMAP paper and NICE-SLAM.
Usage
iMAP* shares a majority part of the code with NICE-SLAM. To run iMAP*, simply use *_imap.yaml in the config file and also add the argument --imap in the command line. For example, to run iMAP* on Replica room0:
[Differences between iMAP* and the original iMAP (click to expand)]
Keyframe pose optimization during mapping
We do not optimize the selected keyframes' poses for iMAP*, because optimizing them usually leads to worse performance. One possible reason is that since their keyframes are selected globally, and many of them do not have overlapping regions especially when the scene gets larger. Overlap is a prerequisite for bundle adjustment (BA). For NICE-SLAM, we only select overlapping keyframes within a small window (local BA), which works well in all scenes. You can still turn on the keyframe pose optimization during mapping for iMAP* by enabling BA in the config file.
Active sampling
We disable the active sampling in iMAP*, because in our experiments we observe that it does not help to improve the performance while brings additional computational overhead.
For the image active sampling, in each iteration the original iMAP uniformly samples 200 pixels in the entire image. Next, they divide this image into an 8x8 grid and calculate the probability distribution from the rendering losses. This means that if the resolution of an image is 1200x680 (Replica), only around 3 pixels are sampled to calculate the distribution for a 150x85 grid patch. This is not too much different from simple uniform sampling. Therefore, during mapping we use the same pixel sampling strategy as NICE-SLAM for iMAP*: uniform sampling, but even 4x more pixels than reported in the iMAP paper.
For the keyframe active sampling, the original iMAP requires rendering depth and color images for all keyframes to get the loss distribution, which is expensive and we again did not find it very helpful. Instead, as done in NICE-SLAM, iMAP* randomly samples keyframes from the keyframe list. We also let iMAP* optimize for 4x more iterations than NICE-SLAM, but their performance is still inferior.
Keyframe selection
For fair comparison, we use the same keyframe selection method in iMAP* as in NICE-SLAM: add one keyframe to the keyframe list every 50 frames.
Evaluation
Average Trajectory Error
To evaluate the average trajectory error. Run the command below with the corresponding config file:
To evaluate the reconstruction error, first download the ground truth Replica meshes where unseen region have been culled.
bash scripts/download_cull_replica_mesh.sh
Then run the command below (same for NICE-SLAM and iMAP*). The 2D metric requires rendering of 1000 depth images, which will take some time (~9 minutes). Use -2d to enable 2D metric. Use -3d to enable 3D metric.
# assign any output_folder and gt mesh you like, here is just an example
OUTPUT_FOLDER=output/Replica/room0
GT_MESH=cull_replica_mesh/room0.ply
python src/tools/eval_recon.py --rec_mesh $OUTPUT_FOLDER/mesh/final_mesh_eval_rec.ply --gt_mesh $GT_MESH -2d -3d
We also provide code to cull the mesh given camera poses. Here we take culling of ground truth mesh of Replica room0 as an example.
As discussed in many recent papers, e.g. UNISURF/VolSDF/NeuS, manual thresholding the volume density during marching cubes might be needed. Moreover, we find out there exist scaling differences, possibly because of the reason discussed in NeuS. Therefore, ICP with scale is needed. You can use the ICP tool in CloudCompare with default configuration with scaling enabled.
Acknowledgement
We adapted some codes from some awesome repositories including convolutional_occupancy_networks, nerf-pytorch, lietorch, and DIST-Renderer. Thanks for making codes public available. We also thank Edgar Sucar for allowing us to make the Replica Dataset available.
Citation
If you find our code or paper useful, please cite
@inproceedings{Zhu2022CVPR,
author = {Zhu, Zihan and Peng, Songyou and Larsson, Viktor and Xu, Weiwei and Bao, Hujun and Cui, Zhaopeng and Oswald, Martin R. and Pollefeys, Marc},
title = {NICE-SLAM: Neural Implicit Scalable Encoding for SLAM},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2022}
}
Contact
Contact Zihan Zhu and Songyou Peng for questions, comments and reporting bugs.
How does cvg/nice-slam compare to other AI Tools projects?
cvg/nice-slam is tracked by TopGit in the AI Tools category, with 1.6k GitHub stars and written in Python. Browse the AI Tools topic page on TopGit to compare it against similar projects by stars and activity.
How many stars does cvg/nice-slam have?
cvg/nice-slam has 1.6k GitHub stars — refresh the page for the live number, or check github.com/cvg/nice-slam. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is cvg/nice-slam open source?
Yes — cvg/nice-slam ships under the Apache-2.0 license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/cvg/nice-slam.
What else is in the AI Tools space?
cvg/nice-slam is tracked by TopGit under the AI Tools category, alongside 8 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What is cvg/nice-slam?
cvg/nice-slam (cvg/nice-slam) is a Python project on GitHub. From the project's own README: [CVPR'22] NICE-SLAM: Neural Implicit Scalable Encoding for SLAM
Where can I see cvg/nice-slam in action?
The project maintains a homepage at https://pengsongyou.github.io/nice-slam. The README tab on this page also usually contains screenshots and a quickstart.
Where do I read more about cvg/nice-slam?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/cvg/nice-slam is the definitive source.
Read full README in the tab above.
Is nice-slam worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of nice-slam.