Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/borglab/gtsfm into log-co…
Browse files Browse the repository at this point in the history
…nnected-component-sizes
  • Loading branch information
senselessdev1 committed Aug 26, 2023
2 parents fe59cda + 812fb4b commit c737cab
Show file tree
Hide file tree
Showing 70 changed files with 1,139 additions and 309 deletions.
15 changes: 15 additions & 0 deletions .github/scripts/download_single_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ function download_and_unzip_dataset_files {
WGET_URL1=https://www.dropbox.com/s/q02mgq1unbw068t/2011205_rc3.zip
WGET_URL2=https://github.com/johnwlambert/gtsfm-cache/releases/download/2011205_rc3_deep_front_end_cache/cache_rc3_deep.tar.gz
ZIP_FNAME=2011205_rc3.zip

elif [ "$DATASET_NAME" == "gerrard-hall-100" ]; then
WGET_URL1=https://github.com/johnwlambert/gtsfm-datasets-mirror/releases/download/gerrard-hall-100/gerrard-hall-100.zip
ZIP_FNAME=gerrard-hall-100.zip

elif [ "$DATASET_NAME" == "south-building-128" ]; then
WGET_URL1=https://github.com/johnwlambert/gtsfm-datasets-mirror/releases/download/south-building-128/south-building-128.zip
ZIP_FNAME=south-building-128.zip
fi

# Download the data.
Expand Down Expand Up @@ -125,6 +133,13 @@ function download_and_unzip_dataset_files {
elif [ "$DATASET_NAME" == "2011205_rc3" ]; then
unzip -qq 2011205_rc3.zip
tar -xvf cache_rc3_deep.tar.gz

elif [ "$DATASET_NAME" == "gerrard-hall-100" ]; then
unzip gerrard-hall-100.zip

elif [ "$DATASET_NAME" == "south-building-128" ]; then
unzip south-building-128.zip

fi
}

Expand Down
26 changes: 19 additions & 7 deletions .github/scripts/execute_single_benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ elif [ "$DATASET_NAME" == "skydio-501" ]; then
elif [ "$DATASET_NAME" == "notre-dame-20" ]; then
IMAGES_DIR=notre-dame-20/images
COLMAP_FILES_DIRPATH=notre-dame-20/notre-dame-20-colmap
elif [ "$DATASET_NAME" == "gerrard-hall-100" ]; then
IMAGES_DIR=gerrard-hall-100/images
COLMAP_FILES_DIRPATH=gerrard-hall-100/colmap-3.7-sparse-txt-2023-07-27
elif [ "$DATASET_NAME" == "south-building-128" ]; then
IMAGES_DIR=south-building-128/images
#COLMAP_FILES_DIRPATH=south-building-128/colmap-official-2016-10-05
COLMAP_FILES_DIRPATH=south-building-128/colmap-2023-07-28-txt
fi

echo "Config: ${CONFIG_NAME}, Loader: ${LOADER_NAME}"
Expand All @@ -44,26 +51,31 @@ fi
if [ "$LOADER_NAME" == "olsson-loader" ]; then
python gtsfm/runner/run_scene_optimizer_olssonloader.py \
--dataset_root $DATASET_ROOT \
--image_extension $IMAGE_EXTENSION \
--config_name ${CONFIG_NAME}.yaml \
--config_name unified \
--correspondence_generator_config_name ${CONFIG_NAME} \
--max_frame_lookahead $MAX_FRAME_LOOKAHEAD \
--max_resolution ${MAX_RESOLUTION} \
${SHARE_INTRINSICS_ARG}
${SHARE_INTRINSICS_ARG} \
--mvs_off

elif [ "$LOADER_NAME" == "colmap-loader" ]; then
python gtsfm/runner/run_scene_optimizer_colmaploader.py \
--images_dir ${IMAGES_DIR} \
--colmap_files_dirpath $COLMAP_FILES_DIRPATH \
--config_name ${CONFIG_NAME}.yaml \
--config_name unified \
--correspondence_generator_config_name ${CONFIG_NAME} \
--max_frame_lookahead $MAX_FRAME_LOOKAHEAD \
--max_resolution ${MAX_RESOLUTION} \
${SHARE_INTRINSICS_ARG}
${SHARE_INTRINSICS_ARG} \
--mvs_off

elif [ "$LOADER_NAME" == "astrovision" ]; then
python gtsfm/runner/run_scene_optimizer_astrovision.py \
--data_dir $DATASET_ROOT \
--config_name ${CONFIG_NAME}.yaml \
--config_name unified \
--correspondence_generator_config_name ${CONFIG_NAME} \
--max_frame_lookahead $MAX_FRAME_LOOKAHEAD \
--max_resolution ${MAX_RESOLUTION} \
${SHARE_INTRINSICS_ARG}
${SHARE_INTRINSICS_ARG} \
--mvs_off
fi
1 change: 0 additions & 1 deletion .github/scripts/execute_single_benchmark_self_hosted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ fi
if [ "$LOADER_NAME" == "olsson-loader" ]; then
python gtsfm/runner/run_scene_optimizer_olssonloader.py \
--dataset_root $DATASET_PREFIX/$DATASET_ROOT \
--image_extension $IMAGE_EXTENSION \
--config_name ${CONFIG_NAME}.yaml \
--max_frame_lookahead $MAX_FRAME_LOOKAHEAD \
--max_resolution ${MAX_RESOLUTION} \
Expand Down
2 changes: 2 additions & 0 deletions .github/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ conda info --envs

cd $GITHUB_WORKSPACE
pip install -e .
git submodule init
git submodule update

##########################################################
# Download pre-trained model weights
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
PYTHON_VERSION: 3.8

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v3.6.0
- name: Cache frontend
uses: actions/cache@v3
env:
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,21 @@ jobs:
matrix:
config_dataset_info:
[
# config dataset lookahead img-extension source loader max-res share-intrinsics
[sift_front_end, door-12, 12, JPG, test_data, olsson-loader, 1296, true],
[deep_front_end, door-12, 12, JPG, test_data, olsson-loader, 1296, true],
[sift_front_end, skydio-8, 8, jpg, gdrive , colmap-loader, 760, true],
[deep_front_end, skydio-8, 8, jpg, gdrive, colmap-loader, 760, true],
[sift_front_end, skydio-32, 32, jpg, gdrive, colmap-loader, 760, true],
[deep_front_end, skydio-32, 32, jpg, gdrive, colmap-loader, 760, true],
[sift_front_end, palace-fine-arts-281, 25, jpg, wget, olsson-loader, 320, true],
[deep_front_end, notre-dame-20, 20, jpg, gdrive, colmap-loader, 760, false],
[sift_front_end_astrovision, 2011205_rc3, 65, png, wget, astrovision, 1024, true],
[deep_front_end_astrovision, 2011205_rc3, 65, png, wget, astrovision, 1024, true],
[synthetic_front_end, tanks-and-temples-barn-410, 4, jpg, wget, tanks-and-temples, 1080, true],
# config dataset lookahead img-extension source loader max-res share-intrinsics
[sift, door-12, 15, JPG, test_data, olsson-loader, 1296, true],
[lightglue, door-12, 15, JPG, test_data, olsson-loader, 1296, true],
[sift, skydio-8, 15, jpg, gdrive , colmap-loader, 760, true],
[lightglue, skydio-8, 15, jpg, gdrive, colmap-loader, 760, true],
[sift, skydio-32, 15, jpg, gdrive, colmap-loader, 760, true],
[lightglue, skydio-32, 15, jpg, gdrive, colmap-loader, 760, true],
[sift, palace-fine-arts-281, 15, jpg, wget, olsson-loader, 320, true],
[lightglue, notre-dame-20, 15, jpg, gdrive, colmap-loader, 760, false],
[sift, 2011205_rc3, 15, png, wget, astrovision, 1024, true],
[lightglue, 2011205_rc3, 15, png, wget, astrovision, 1024, true],
[sift, gerrard-hall-100, 15, jpg, wget, colmap-loader, 760, true],
[lightglue, gerrard-hall-100, 15, jpg, wget, colmap-loader, 760, true],
[sift, south-building-128, 15, jpg, wget, colmap-loader, 760, true],
[lightglue, south-building-128, 15, jpg, wget, colmap-loader, 760, true],
]
defaults:
run:
Expand All @@ -33,7 +36,7 @@ jobs:
PYTHON_VERSION: 3.8

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v3.6.0
- name: Cache frontend
uses: actions/cache@v3
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v3.6.0
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
PYTHON_VERSION: 3.8

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v3.6.0
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-reproducibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
PYTHON_VERSION: 3.8

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v3.6.0
- uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "thirdparty/LightGlue"]
path = thirdparty/LightGlue
url = https://github.com/cvg/LightGlue.git
30 changes: 9 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
![Alt text](gtsfm-logo.png?raw=true)

# Georgia Tech Structure from Motion (GTSfM) Library

| Platform | Build Status |
|:------------:| :-------------:|
| Ubuntu 20.04.3 | ![Linux CI](https://github.com/borglab/gtsfm/actions/workflows/test-python.yml/badge.svg?branch=master) |

### What is GTSfM?

GTSfM is an end-to-end SfM pipeline based on [GTSAM](https://github.com/borglab/gtsam). GTSfM was designed from the ground-up to natively support parallel computation using [Dask](https://dask.org/).

<p align="left">
<img src="https://mma.prnewswire.com/media/1832641/Dask_Logo_lockup_primary_Logo.jpg?p=facebook" height="50">
</p>
Georgia Tech Structure-from-Motion (GTSfM) is an end-to-end SfM pipeline based on [GTSAM](https://github.com/borglab/gtsam). GTSfM was designed from the ground-up to natively support parallel computation using [Dask](https://dask.org/).

<p align="left">
<img src="https://user-images.githubusercontent.com/16724970/121294002-a4d7a400-c8ba-11eb-895e-a50305c049b6.gif" height="315" title="Olsson Lund Dataset: Door, 12 images">
Expand All @@ -26,32 +18,28 @@ GTSfM is an end-to-end SfM pipeline based on [GTSAM](https://github.com/borglab/

## License

The 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.
The majority of our code is governed by an MIT license and is suitable for commercial use. However, certain implementations featured in our repo (e.g., SuperPoint, SuperGlue) are governed by a non-commercial license and may not be used commercially.

## Installation

GTSfM requires no compilation, as Python wheels are provided for GTSAM.
GTSfM requires no compilation, as Python wheels are provided for GTSAM. This repository includes external repositories as Git submodules –- don't forget to pull submodules with `git submodule update --init --recursive` or clone with `git clone --recursive https://github.com/borglab/gtsfm.git`.

To install GTSfM, first, we need to create a conda environment.
To run GTSfM, first, we need to create a conda environment with the required dependencies.

**Linux**
On Linux, with CUDA support:
On **Linux**, with CUDA support, run:

```bash
conda env create -f environment_linux.yml
conda activate gtsfm-v1 # you may need "source activate gtsfm-v1" depending upon your bash and conda set-up
```

**Mac**
On Mac OSX, there is no CUDA support, so run:
On **macOS**, there is no CUDA support, so run:

```bash
conda env create -f environment_mac.yml
conda activate gtsfm-v1
```

## Completing Installation

Now, install `gtsfm` as a module:

```bash
Expand All @@ -60,7 +48,7 @@ pip install -e .

Make sure that you can run `python -c "import gtsfm; import gtsam; print('hello world')"` in python, and you are good to go!

## Usage Guide (Running 3d Reconstruction)
## 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:

Expand Down Expand Up @@ -94,7 +82,7 @@ python gtsfm/runner/run_scene_optimizer_olssonloader.py --dataset_root tests/dat

You can view/monitor the distributed computation using the [Dask dashboard](http://localhost:8787/status).

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)
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:

Expand All @@ -107,7 +95,7 @@ where `COLMAP_FILES_DIRPATH` is a directory where .txt files such as `cameras.tx
To visualize the result using Open3D, run:

```bash
python gtsfm/visualization/view_scene.py --rendering_library open3d --rendering_style point
python gtsfm/visualization/view_scene.py
```

For users that are working with the same dataset repeatedly, we provide functionality to cache front-end results for
Expand Down
Loading

0 comments on commit c737cab

Please sign in to comment.