[Introduction] ParticleSfM is an offline structure-from-motion system for videos (image sequences). Inspired by Particle video, our method connects pairwise optical flows and optimizes dense point trajectories as long-range video correpondences, which are used in a customized global structure-from-motion framework with similarity averaging and global bundle adjustment. In particular, for dynamic scenes, the acquired dense point trajectories can be fed into a specially designed trajectory-based motion segmentation module to select static point tracks, enabling the system to produce reliable camera trajectories on in-the-wild sequences with complex foreground motion.
If you are interested in potential collaboration or internship at ByteDance, please feel free to contact Hengkai Guo (guohengkai@bytedance.com).
Update by 2025.02.05
We support GLOMAP in our pipeline, which achieves more accurate results on 13 sequences of the Sintel dataset:
Method
ATE (m)
RPE trans (m)
RPE rot (deg)
SfM runtime (min)
#Frames
Global SfM - Ours w/ gcolmap(Theia)
0.104
0.054
0.414
3.35
45.6
Global SfM - Ours w/ GLOMAP
0.057
0.031
0.201
6.97
45.6
Test it by simply changing the sfm_type to global_glomap:
python run_particlesfm.py --image_dir /path/to/the/image/folder/ \
--output_dir /path/to/output/workspace/ \
--sfm_type global_glomap # "global_theia" for the paper version
Installation
Install dependencies:
Ceres >= 2.0.0
For using gcolmap (Theia) as in the original ParticleSfM paper:
You can also alternatively use the command for the workspace with the images folder inside below. This option will write all the output in the same workspace.
The results below are expected (left: snowboard; right: train):
Usage
Given an image sequence, put all the images in the same folder. The sorted ordering of the names should be consistent with its ordering in the sequence.
Use the following command to run our whole pipeline:
This will sequentially run optical flow -> point trajectory -> motion seg -> sfm. The final results will be saved inside the image data folder with COLMAP output format.
If you have the prior information that the scene to be reconstructed is fully static, you can skip the motion segmentation module with --assume_static. Conversely, if you only want to run the motion segmentation, attach --skip_sfm to the command.
To speed up
Use “–skip_path_consistency” to skip the path consistency optimization of point trajectories
Try higher down-sampling ratio for optimizing point trajectories: e.g. “–sample_ratio 4”
Visualize the outputs using COLMAP GUI (Download the COLMAP Binary and import the data sequence directory) or just your customized visualizer.
This will output a txt file with detailed error metrics. Also, the camera trajectories are plotted and saved inside each data sequence folder.
Training
Download the Flyingthings3D dataset from the official website. We need the RGB images (finalpass) and optical flow data.
Download the generated binary motion labels from here or GoogleDrive, and unpack this archive into the root directory of the FlyingThings3D dataset. We thank the authors of MPNet for kindly sharing it.
@inproceedings{zhao2022particlesfm,
author = {Zhao, Wang and Liu, Shaohui and Guo, Hengkai and Wang, Wenping and Liu, Yong-Jin},
title = {ParticleSfM: Exploiting Dense Point Trajectories for Localizing Moving Cameras in the Wild},
booktitle = {European conference on computer vision (ECCV)},
year = {2022}
}
More related projects
DynaSLAM. Bescos et al. DynaSLAM: Tracking, Mapping and Inpainting in Dynamic Scenes. IROS 2018.
TrianFlow. Zhao et al. Towards Better Generalization: Joint Depth-Pose Learning without PoseNet. CVPR 2020.
VOLDOR. Min et al. VOLDOR-SLAM: For the times when feature-based or direct methods are not good enough. ICRA 2021.
DROID-SLAM. Teed et al. DROID-SLAM: Deep Visual SLAM for Monocular, Stereo, and RGB-D Cameras. NeurIPS 2021.
Acknowledgements
This project could not be possible without the great open-source works from COLMAP, Theia, hloc, RAFT, MiDaS and OANet. We sincerely thank them all.
ParticleSfM
Paper | Video | Project Page
Code release for our ECCV 2022 paper “ParticleSfM: Exploiting Dense Point Trajectories for Localizing Moving Cameras in the Wild.” by Wang Zhao, Shaohui Liu, Hengkai Guo, Wenping Wang and Yong-Jin Liu.
[Introduction] ParticleSfM is an offline structure-from-motion system for videos (image sequences). Inspired by Particle video, our method connects pairwise optical flows and optimizes dense point trajectories as long-range video correpondences, which are used in a customized global structure-from-motion framework with similarity averaging and global bundle adjustment. In particular, for dynamic scenes, the acquired dense point trajectories can be fed into a specially designed trajectory-based motion segmentation module to select static point tracks, enabling the system to produce reliable camera trajectories on in-the-wild sequences with complex foreground motion.
Contact Wang Zhao (thuzhaowang@163.com), Shaohui Liu (b1ueber2y@gmail.com) and Hengkai Guo (guohengkai@bytedance.com) for questions, comments and reporting bugs.
If you are interested in potential collaboration or internship at ByteDance, please feel free to contact Hengkai Guo (guohengkai@bytedance.com).
Update by 2025.02.05
We support GLOMAP in our pipeline, which achieves more accurate results on 13 sequences of the Sintel dataset:
Test it by simply changing the
sfm_typetoglobal_glomap:Installation
For using gcolmap (Theia) as in the original ParticleSfM paper:
Alternatively, if you want to use our latest GLOMAP support:
Set up Python environment with Conda:
Build our point trajectory optimizer and global structure-from-motion module.
Quickstart Demo
imagesfolder inside below. This option will write all the output in the same workspace.Usage
Given an image sequence, put all the images in the same folder. The sorted ordering of the names should be consistent with its ordering in the sequence.
Use the following command to run our whole pipeline:
This will sequentially run
optical flow -> point trajectory -> motion seg -> sfm. The final results will be saved inside the image data folder with COLMAP output format.If you have the prior information that the scene to be reconstructed is fully static, you can skip the motion segmentation module with
--assume_static. Conversely, if you only want to run the motion segmentation, attach--skip_sfmto the command.Visualize the outputs using COLMAP GUI (Download the COLMAP Binary and import the data sequence directory) or just your customized visualizer.
Evaluation
MPI Sintel dataset
Download the Sintel dataset. You also need to download the groundtruth camera motion data and the generated motion mask to evaluate the pose and motion segmentation.
Prepare the sequences:
Run ParticleSfM reconstructions:
To evaluate the camera poses:
This will output a txt file with detailed error metrics. Also, the camera trajectories are plotted and saved inside each data sequence folder.
To evaluate the motion segmentation:
ScanNet dataset
Download the test split of ScanNet dataset, extract the data from .sens data using the official script.
Prepare the sequences:
We use the first 20 sequences of test split and perform downsampling with stride 3, resize the image to 640x480.
Run ParticleSfM reconstructions:
To evaluate the camera poses:
This will output a txt file with detailed error metrics. Also, the camera trajectories are plotted and saved inside each data sequence folder.
Training
Download the Flyingthings3D dataset from the official website. We need the RGB images (finalpass) and optical flow data.
Download the generated binary motion labels from here or GoogleDrive, and unpack this archive into the root directory of the FlyingThings3D dataset. We thank the authors of MPNet for kindly sharing it.
Prepare the training data:
To launch the training, configure your config file inside
./motion_seg/configs/and then run:Applications
Citation
More related projects
Acknowledgements
This project could not be possible without the great open-source works from COLMAP, Theia, hloc, RAFT, MiDaS and OANet. We sincerely thank them all.