Package: gtsfm
Georgia Tech Structure from Motion (GTSfM) LibraryPlatformBuild StatusUbuntu 20.04.3What is GTSfM?GTSfM is an end-to-end SfM pipeline based onGTSAM. GTSfM was designed from the ground-up to natively support parallel computation usingDask.LicenseThe majority of our code is governed by a MIT license and is suitable for commercial use. However, certain implementations featured in our repo (SuperPoint, SuperGlue) are governed by a non-commercial license and may not be used commercially.InstallationGTSfM requires no compilation, as Python wheels are provided for GTSAM.To install GTSfM, first, we need to create a conda environment.LinuxOn Linux, with CUDA support:condaenvcreate-fenvironment_linux.yml
condaactivategtsfm-v1# you may need "source activate gtsfm-v1" depending upon your bash and conda set-upMacOn Mac OSX, there is no CUDA support, so run:condaenvcreate-fenvironment_mac.yml
condaactivategtsfm-v1Completing InstallationNow, installgtsfmas a module:pipinstall-e.Make sure that you can runpython -c "import gtsfm; import gtsam; print('hello world')"in python, and you are good to go!Usage Guide (Running 3d Reconstruction)Before running reconstruction, if you intend to use modules with pre-trained weights, such as SuperPoint, SuperGlue, or PatchmatchNet, please first run:./download_model_weights.shTo run SfM with a dataset with only an image directory and EXIF, with image file names ending with "jpg", please create the following file structure like└── {DATASET_NAME}
       ├── images
               ├── image1.jpg
               ├── image2.jpg
               ├── image3.jpgand runpythongtsfm/runner/run_scene_optimizer_olssonloader.py--config_name{CONFIG_NAME}--dataset_root{DATASET_ROOT}--image_extensionjpg--num_workers{NUM_WORKERS}For example, if you had 4 cores available and wanted to use the Deep Front-End (recommended) on the "door" dataset, you should run:pythongtsfm/runner/run_scene_optimizer_olssonloader.py--dataset_roottests/data/set1_lund_door--image_extensionJPG--config_namedeep_front_end.yaml--num_workers4(or however many workers you desire).You can view/monitor the distributed computation using theDask dashboard.Currently we require EXIF data embedded into your images (or you can provide ground truth intrinsics in the expected format for an Olsson dataset, or COLMAP-exported text data, etc)If you would like to compare GTSfM output with COLMAP output, please run:pythongtsfm/runner/run_scene_optimizer_colmaploader.py--config_name{CONFIG_NAME}--images_dir{IMAGES_DIR}--colmap_files_dirpath{COLMAP_FILES_DIRPATH}--image_extensionjpg--num_workers{NUM_WORKERS}--max_frame_lookahead{MAX_FRAME_LOOKAHEAD}whereCOLMAP_FILES_DIRPATHis a directory where .txt files such ascameras.txt,images.txt, etc have been saved.To visualize the result using Open3D, run:pythongtsfm/visualization/view_scene.py--rendering_libraryopen3d--rendering_stylepointFor users that are working with the same dataset repeatedly, we provide functionality to cache front-end results for
GTSfM for very fast inference afterwards. For more information, please refer togtsfm/frontend/cacher/README.md.Repository StructureGTSfM is designed in an extremely modular way. Each module can be swapped out with a new one, as long as it implements the API of the module's abstract base class. The code is organized as follows:gtsfm: source code, organized as:averagingrotation: rotation averaging implementations (Shonan, Chordal, etc)translation: translation averaging implementations (1d-SFM, etc)bundle: bundle adjustment implementationscommon: basic classes used through GTSFM, such asKeypoints,Image,SfmTrack2d, etcdata_association: 3d point triangulation (DLT) w/ or w/o RANSAC, from 2d point-tracksdensifyfrontend: SfM front-end code, including:detector: keypoint detector implementations (DoG, etc)descriptor: feature descriptor implementations (SIFT,SuperPointetc)matcher: descriptor matching implementations (Superglue, etc)verifier: 2d-correspondence verifier implementations (Degensac, OA-Net, etc)cacher: Cache implementations for different stages of the front-end.loader: image data loadersutils: utility functions such as serialization routines and pose comparisons, etctests: unit tests on every function and moduleContributingContributions are always welcome! Please be aware of ourcontribution guidelines for this project.Citing this workOpen-source Python implementation:@misc{GTSFM,
    author = {Ayush Baid and Travis Driver and Fan Jiang and Akshay Krishnan and John Lambert
       and Ren Liu and Aditya Singh and Neha Upadhyay and Aishwarya Venkataramanan
       and Sushmita Warrier and Jon Womack and Jing Wu and Xiaolong Wu and Frank Dellaert},
    title = { {GTSFM}: Georgia Tech Structure from Motion},
    howpublished={\url{https://github.com/borglab/gtsfm}},
    year = {2021}
}Note: authors are listed in alphabetical order (by last name).Compiling Additional VerifiersOn Linux, we have madepycolmap's LORANSAC available inpypi. However, on Mac,pycolmapmust be built from scratch. See the instructionshere.