Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
21e9988
Refactored reconstruction.py with less calls to np.radians
mxw-meta Jun 22, 2022
c91ed55
Refactor motion_from_plane_homography in openSFM Multiviewpy
FarooqZuberi Jun 22, 2022
8e7b11c
Remove unused acceleration_ and add const wherever possible
fabianschenk Jun 27, 2022
ce5ad27
Fix descriptor dtype issue (#805)
sebhaner Jun 28, 2022
cc22257
Update pyi files
fabianschenk Jun 28, 2022
2355028
Fix qhull crash during matching on small image set (#878)
pierotofy Jun 28, 2022
2aabdcb
Export image masks to OpenMVS (#921)
pierotofy Jun 28, 2022
3b3e236
Add required opencv requirement for linux (#910)
lwneal Jun 30, 2022
0e7bf61
feat: non-shrinking motion prior error
YanNoun Jul 4, 2022
7152fc7
Update using.rst (#922)
vertexodessa Jul 4, 2022
3d576f0
Remove unused altitude
fabianschenk Jul 4, 2022
a1a253f
Default use_altitude_tag to True
fabianschenk Jul 4, 2022
f3a059b
feat: synthetic log for bundle
YanNoun Jul 11, 2022
1653772
fix: fix camera instanciation in global bundle
YanNoun Jul 11, 2022
d1ec1d0
fix: use rig instances per rig camera
YanNoun Jul 11, 2022
d1165f9
fix: typo in stats
YanNoun Jul 11, 2022
cb1fdee
fixed ply generation to support official ply headers (#932)
digvijayad Jul 18, 2022
f6c616b
Update documentation
fabianschenk Jul 18, 2022
c81a19d
increase feature timeout
tobias-o Jul 19, 2022
c011295
set default orientation if not set
tobias-o Jul 27, 2022
e4ee190
make robust_match work with already filtered matches
tobias-o Jul 27, 2022
b69eb5f
upgrade pyre version in `fbcode/mapillary` - batch 1
Aug 5, 2022
36ab87b
Update features_processing.py (#940)
GaryStebbins Aug 15, 2022
9838a39
Don't crash if compass accuracy is given as none
tobias-o Aug 15, 2022
7bb45cf
Update using.rst (#938)
AfaqSaeed Aug 25, 2022
ce3054b
Update sensor_data_detailed.json (#943)
summitbri Aug 25, 2022
8245969
Update sensor_data.json for Zenmuse P1 (#944)
summitbri Aug 25, 2022
28d2add
Update camera_calibration.yaml (#945)
summitbri Sep 12, 2022
bfa0249
Added fisheye62 projection_type to undistort (#957)
kielnino Nov 29, 2022
5375df1
Update numpy and scipy requirements (#976)
Jan 23, 2023
1a69f7c
fix setting config parameter on the wrong dataset (#975)
kielnino Jan 25, 2023
8b97fa7
upgrade pyre version in `fbcode/mapillary` - batch 1
Feb 2, 2023
44f4774
Adds Mavic 3 Pro camera CCD width (#966)
pierotofy Feb 20, 2023
0e67e22
Fix match_candidates_by_graph when initial simplex is flat (#969)
pierotofy Feb 20, 2023
b760b21
Add GroundControlPoint Role (#983)
Feb 21, 2023
8887d33
FLANN LSH Indexing for binary descriptors (#996)
pierotofy Apr 21, 2023
5213d0f
Fix runtime with less iterations and more threads
May 5, 2023
69f16bf
upgrade pyre version in `fbcode/mapillary` - batch 1
May 24, 2023
5cdc3ce
build(deps): Bump flask from 2.1.2 to 2.3.2 (#999)
dependabot[bot] May 24, 2023
a1f1959
Plot_inliers / File adapted to changes in the whole project (#1001)
kielnino May 24, 2023
f2df6fe
Update jquery version
Jul 18, 2023
cdd3854
suppress errors in `mapillary/opensfm`
Jul 24, 2023
5fe4115
suppress errors in `mapillary/opensfm`
Jul 25, 2023
193818d
suppress errors in `mapillary/opensfm`
Aug 1, 2023
899575a
Del `(object)` from 50 inc manifold/cogwheel/lib/manifold_semaphore.py
r-barnes Aug 28, 2023
c798da1
Use ASSERT_FLOAT_EQ in TestPixelNormalizedCoordinatesConversion
Aug 30, 2023
c6b5ace
Image channels dimension and dtype check for feature extraction. (#1018)
Sep 15, 2023
fb3dc96
Add logs for number of GPS constraints in OpenSFM
Nov 6, 2023
25c04c3
add gopro max fisheye to hardcoded_camera_calibration
RuibinMa Nov 10, 2023
98939bf
mapillary
Nov 14, 2023
925d7ff
upgrade pyre version in `fbcode/mapillary` - batch 1
Dec 7, 2023
6a1f95e
add progress plotting to correspondence copier and opensfm.reconstructor
Dec 8, 2023
d787a18
Remove extra semi colon from mapillary/opensfm/opensfm/src/geo/geo.h
r-barnes Dec 8, 2023
7f170d0
Remove extra semi colon from luna/common/sampling/samplers/StatsWrapp…
r-barnes Dec 9, 2023
569f6d3
Rename variable to avoid shadowing
Jan 8, 2024
a848b1f
suppress errors in `mapillary/opensfm`
Jan 26, 2024
bec57f3
suppress errors in `mapillary/opensfm`
Jan 27, 2024
013956c
Remove semicolon(s) from 3 files inc loki/lacis/storage/rtree/liveind…
r-barnes Feb 14, 2024
2281fd4
Remove semicolon(s) from 3 files inc mapillary/opensfm/opensfm/src/ge…
r-barnes Feb 14, 2024
072abf0
Remove unused variables in mapillary/opensfm/opensfm/src/geometry/pose.h
r-barnes Feb 15, 2024
68b18f3
Remove unused variables in mapillary/opensfm/opensfm/src/foundation/n…
r-barnes Feb 15, 2024
21ed668
Remove semicolon(s) from 3 files inc mapillary/opensfm/opensfm/src/ge…
r-barnes Feb 15, 2024
4a74bc3
mapillary (463897787004193082)
Feb 28, 2024
8f618a2
fix some indentation messed up by a codemod
Feb 28, 2024
7ad7339
Pyre Configurationless migration for] [batch:26/112] [shard:6/N] (#1041)
Mar 2, 2024
938a3a1
Fix `-Wimplicit-const-int-float-conversion` violation in mapillary/op…
r-barnes Mar 6, 2024
424ecc2
Fix `-Wimplicit-const-int-float-conversion` violation in mapillary/op…
r-barnes Mar 6, 2024
afb0c15
Fix `-Wimplicit-const-int-float-conversion` violation in mapillary/op…
r-barnes Mar 7, 2024
78b795c
Remove unused variables in mapillary/opensfm/opensfm/src/third_party/…
r-barnes Mar 7, 2024
4b562c6
returning norm_coords instead of px_coords in pixelToNormalizedCoordi…
oaa3wf Mar 18, 2024
c724192
upgrade pyre version in `fbcode/mapillary` - batch 1
Mar 22, 2024
5e854bb
upgrade pyre version in `fbcode/mapillary` - batch 1
Apr 3, 2024
5b32e38
Remove unused pybind11 functions
Apr 18, 2024
40b73c0
describe how to build and use docker images (#1049)
sepastian Jun 3, 2024
b18e638
Remove dublicated SIFT-Dectector instance in feature matching (#1053)
kielnino Jun 3, 2024
c9d7d98
add check to opensfm BA that GPS accuracies are positive
Jun 11, 2024
7b531ae
Fix shadowed variable in mapillary/opensfm/opensfm/src/geometry/src/c…
r-barnes Jun 26, 2024
da78973
Remove unused-variable in mapillary/opensfm/opensfm/src/geometry/abso…
r-barnes Jul 10, 2024
1106198
Remove unused function from mapillary/opensfm/opensfm/src/third_party…
r-barnes Jul 12, 2024
670d53e
Del using namespace mapillary/opensfm/opensfm/src/dense/depthmap_bind.h
r-barnes Jul 25, 2024
f953531
Migrate "mapillary/opensfm/PACKAGE" from LLVM-15 to LLVM-17
Aug 6, 2024
ef872b2
upgrade pyre version in `fbcode/mapillary` - batch 1
Aug 9, 2024
d1727b0
removing base_module] fbcode/mapillary/opensfm/opensfm/test/TARGETS
Aug 15, 2024
7514c21
Convert .pyre_configuration.local to fast by default architecture] [b…
Sep 30, 2024
03432a8
Remove unused-variable in mapillary/opensfm/opensfm/src/bundle/error/…
r-barnes Oct 14, 2024
61c0f12
Fix shadowed variable in mapillary/opensfm/opensfm/src/map/src/tracks…
r-barnes Oct 15, 2024
4b19f0d
Fix shadowed variable in mapillary/opensfm/opensfm/src/third_party/ak…
r-barnes Oct 15, 2024
afcf90b
fbcode/mapillary/opensfm/opensfm/src/third_party/gtest/gmock
Oct 16, 2024
129ab66
fbcode/mapillary/opensfm/opensfm/src/third_party/gtest/gtest
Oct 16, 2024
b863db5
fbcode/mapillary/opensfm/opensfm/src/third_party/gtest
Oct 16, 2024
177d146
fbcode/mapillary/opensfm/opensfm/src
Oct 16, 2024
444e362
fbcode/mapillary/opensfm/opensfm/src/third_party/vlfeat/vl
Oct 16, 2024
c8eb66b
removing base_module] fbcode/mapillary/opensfm/annotation_gui_gcp/TAR…
Oct 21, 2024
537275b
Clean up errors and remove unused ignores] [batch:134/562] [shard:2/N]
Oct 23, 2024
0733669
Fix for T205280497 ("An automatically generated diff you reviewed, D6…
Oct 28, 2024
c83b97d
Pre-silence Pyre Errors for upcoming upgrade] [batch:94/596] [shard:2/N]
Oct 31, 2024
480556d
Remove unused-variable in language_technology/jedi/moses/TranslationO…
r-barnes Nov 19, 2024
fb6cdbe
Turn typing on for mapillary
migeed-z Nov 19, 2024
4bdfa33
Add depth prior to point observation
RuibinMa Nov 20, 2024
9fb0596
hook up opensfm.reconstructor and depth_anything_v2
RuibinMa Nov 20, 2024
b72eb60
Follow-up of D66050326
Nov 21, 2024
8851196
Add logging to opensfm.reconstructor
RuibinMa Feb 19, 2025
9bb07a4
Migrate (str Enum) classes to StrEnum310.
Apr 2, 2025
64b57d3
Do not triangulate when the origin overlap
RuibinMa Apr 4, 2025
4386bf3
Add test case for triangulation with coincident camera origins
Apr 8, 2025
243874b
Add tests to cpp triangulation
Apr 8, 2025
ae36d3a
Reorder triangulation functions
Apr 8, 2025
113d3cf
Use short names for matrices and always double
Apr 8, 2025
1548c87
Add min_depth to triangulation
Apr 8, 2025
b6f2322
Remove max_angle parameter
Apr 8, 2025
110da9c
Remove same origin checks from reconstruction
Apr 8, 2025
24ea37d
run linter on all repo
Apr 10, 2025
d0f893b
Back out "fbcode/mapillary/opensfm/opensfm/src/third_party/gtest/gmock"
Apr 11, 2025
aa521cb
Back out "fbcode/mapillary/opensfm/opensfm/src/third_party/gtest/gtest"
Apr 11, 2025
1f4db88
Back out "fbcode/mapillary/opensfm/opensfm/src/third_party/gtest"
Apr 11, 2025
44e031c
Back out "fbcode/mapillary/opensfm/opensfm/src"
Apr 11, 2025
a37c683
Back out "fbcode/mapillary/opensfm/opensfm/src/third_party/vlfeat/vl"
Apr 11, 2025
672db1d
Fixes for docker tests to build and pass (#1092)
paulinus Apr 22, 2025
51dad31
replace open method with specialized methods for text and binary modes
Apr 22, 2025
47e3607
pyre strict in dataset and io
Apr 22, 2025
187867f
remove noisy log
Apr 25, 2025
41e5b89
remove debug logs
May 5, 2025
00300ad
Introduce the use of anaconda for dependencies (#1093)
YanNoun May 15, 2025
713ea6e
Fix CQS signal performance-unnecessary-value-param in fbcode/mapillar…
May 20, 2025
ffcedf3
Add mem_ceiling and mem_ratio parameters to data.config
May 20, 2025
a8bea86
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/open…
May 22, 2025
27ab752
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/open…
May 27, 2025
b761d31
Stop checking for numpy version in conftest
May 28, 2025
90f8917
make reconstruction comparisons handle different geo references
Jun 2, 2025
8c59bb5
annotate matching
Jun 15, 2025
87f84ad
annotate features
Jun 15, 2025
9dac7bc
annotate exif
Jun 15, 2025
d1d50c1
annotate tracking
Jun 15, 2025
2c85dc0
annotate reconstruction
Jun 15, 2025
89d46eb
annotate align
Jun 15, 2025
0a94043
annotate transformations
Jun 15, 2025
05c77ec
onnotate pair_selection
Jun 15, 2025
dd0ff7d
more annotations
Jun 15, 2025
094d149
annotate geo
Jun 15, 2025
ac534bd
more pyre-strict
Jun 15, 2025
0fd5127
annotate multiview and remove unused ransac
Jun 15, 2025
efcd1e2
annotate commands
Jun 15, 2025
4235f8a
annotate actions
Jun 15, 2025
07485b7
annotate export_colmap
Jun 15, 2025
5b1c5e1
annotate tests
Jun 15, 2025
9b5be94
more type annotations
Jun 15, 2025
c581cc1
annotate synthetic data
Jun 15, 2025
7bfd35d
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/open…
Jun 17, 2025
b7150fe
fix: correct logger warnings (#1095)
emmanuel-ferdman Jun 25, 2025
752e008
Remove build warnings (#1094)
YanNoun Jun 25, 2025
75b8f9c
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/open…
Jun 27, 2025
1dd9a16
annotate large
Jul 2, 2025
82764b3
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/open…
Jul 2, 2025
9f9404a
Fix tests it github CI (#1099)
paulinus Jul 7, 2025
2d3169f
Use python 3.10 in conda and github action to test it (#1100)
paulinus Jul 8, 2025
a29d557
Run conda test action on multiple OS (#1101)
paulinus Jul 8, 2025
8b50138
fix flacky test
Jul 8, 2025
a5f7ec2
Del redundant-static-def in mapillary/opensfm/opensfm/src/geometry/sr…
r-barnes Jul 15, 2025
cc71548
reduce 70% memory usage during reconstructability computation
RuibinMa Jul 28, 2025
d30aaa0
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/opensfm
Jul 29, 2025
d28bc9b
Update import_colmap.py (#1103)
blueraymusic Jul 31, 2025
db70523
Warn user if ceres loss function is not available (#1096)
kielnino Jul 31, 2025
7e5cb4a
fbcode/mapillary/opensfm/opensfm/pairs_selection.py
Aug 4, 2025
7f17b89
Fix CQS signal modernize-use-using in fbcode/mapillary/opensfm
Aug 6, 2025
a2b6fc5
expose aspect_ratio_sd parameter
RuibinMa Aug 19, 2025
8074f9f
Use old style typing to keep supporting python 3.8. (#1104)
paulinus Aug 25, 2025
c7847d9
fbcode/mapillary/opensfm/opensfm/stats.py
Aug 29, 2025
e7aa0b0
fbcode/mapillary/opensfm/opensfm/align.py
Aug 29, 2025
de97cd2
fbcode/mapillary/opensfm/opensfm/video.py
Sep 2, 2025
7eb66cf
fbcode/mapillary/opensfm/opensfm/test/data_generation.py
Sep 2, 2025
6efcb2e
fbcode/mapillary/opensfm/opensfm/synthetic_data/synthetic_generator.py
Sep 2, 2025
9acae6f
fbcode/mapillary/opensfm/opensfm/test/test_commands.py
Sep 2, 2025
3e7b1db
fbcode/mapillary/opensfm/opensfm/test/test_pairs_selection.py
Sep 4, 2025
05eaa1e
fbcode/mapillary/opensfm/opensfm/test/test_dataset.py
Sep 4, 2025
8cc5985
Improve final point cloud with filtering (#1108)
Sep 10, 2025
6dde847
Move map helper functions from tracks_helpers to dedicated map_helpers
Sep 11, 2025
32d6d73
Support configurable memory usage for opensfm feature extraction
Sep 19, 2025
59c86f7
import annotations to keep running on python <3.10
Sep 29, 2025
2c25da5
Add CI for Docker with Ubuntu 24.04 (#1109)
paulinus Oct 3, 2025
bc27a2c
fbcode/mapillary/opensfm/opensfm
Oct 8, 2025
b573141
Fix status badge to show new actions (#1110)
paulinus Oct 14, 2025
391f8d1
Fix CQS signal facebook-unused-include-check in fbcode/mapillary/opensfm
Oct 15, 2025
a885073
clang-format | Format fbsource with clang-format 21.
nlutsenko Oct 27, 2025
2ef1e03
fbcode/mapillary/opensfm/opensfm
Oct 27, 2025
574c6f7
fbcode/mapillary/opensfm/opensfm/test/large
Oct 29, 2025
faf1d46
Fix CQS signal clang-diagnostic-shadow in fbcode/mapillary/opensfm
Oct 31, 2025
655d75c
Use pyproject.toml for building (#1112)
paulinus Nov 3, 2025
971085a
fix cmake string format
Nov 4, 2025
6f90a17
fix: default to numpy.core if available (#1113)
paulinus Nov 6, 2025
a7e674b
fbcode/mapillary/opensfm/opensfm/src/map/src
Nov 6, 2025
cff716c
fbcode/mapillary/opensfm/opensfm/src/geometry/src
Nov 10, 2025
2e0acd4
Proper focal 35mm conversion
Aug 18, 2025
bb73a7c
Update to ceres 2.2 + use SuiteSparse+Metis
Aug 15, 2025
f6d3de4
Speed track manager creation while decreasing memory usage
Aug 15, 2025
fbd98f8
Add C++ // triangulation function
Aug 3, 2025
bf8f25a
Parallelize track counting
Aug 3, 2025
2cf29a7
Speed up VLAD by passing small copies instead of a big chunk
Aug 3, 2025
a6bab00
On-the-fly resection candidates
Aug 15, 2025
56de1a7
Add grid-based decimation followed by triangulation in BA
Aug 15, 2025
1b30a0e
Preempt redundant images and resect them at the end
Aug 15, 2025
cd2452c
Better and unified GCP thresholds handling :
Aug 16, 2025
446a4b0
Ensure consistent use of pyproj.Transform for Lat/Lon<->Proj CS conve…
Dec 15, 2025
d1824b5
fix: support WGS84 as EPSG4326. And some formatting.
Jan 12, 2026
d88f3eb
Fix test broken by GCP branch
Jan 7, 2026
66cbb0f
Fix test broken by bundle branch
Jan 7, 2026
dd18fe7
FIx YPR to OPK conversion by staying in the tiopocenter frame
Jan 7, 2026
fe09667
Added OPK IO
Jan 7, 2026
2045631
Added OPK errors in the report
Jan 7, 2026
f90433c
First stage of rerun export_rerun
Dec 13, 2025
0b3dc7c
Unified colors, added matchgraph and coverage map
Dec 14, 2025
03f602e
Refactored with interface and added TextViews
Dec 14, 2025
dfa6218
Allow exporting pure GCP coordinates in their CS to highlight convers…
Dec 15, 2025
352f813
Big refactor of the view layout
Jan 6, 2026
553d588
clean: remove unused functions
Jan 12, 2026
12d69dc
feat: add total used memory during reconstruction
Jan 12, 2026
6c72370
fix: ensure altitude computation always work : exhaustive minima sear…
Jan 12, 2026
a151a94
feat: log memory used during reconstruction stage
Jan 12, 2026
dd1578c
fix: one last fix for GCP weighting : that one actually improves !
Jan 12, 2026
d151064
fix: fix test
Jan 12, 2026
06a938e
feat: save memory on the tracks amanger : depth as float (we don't us…
Jan 12, 2026
82cf8c5
feat: LAPACK + NESDIS FTW !
Jan 12, 2026
b23c594
fix: actually adjust resected shots !
Jan 12, 2026
7d6bb48
feat: use tcmalloc. We take this opportunity to fully switch to Docker +
Jan 12, 2026
c8192fe
feat: only select tracks on the interior shots. Increase the locaL gr…
Jan 12, 2026
da8a5cb
feat: optimize bundle problems setup and add timers
Jan 12, 2026
9f4f09f
feat: added multithreaded + consumer/producer triangulation.
Jan 12, 2026
2061cd3
feat: welcome AI friends !
Jan 12, 2026
0e3152f
feat: add debug parameters to limit the number of shots when debuggin…
Jan 12, 2026
778498d
fix: oupsy : correctly disable METIS
Jan 13, 2026
d9b11cb
Merge remote-tracking branch 'yannoun/master' into 400
Jan 13, 2026
7bc0903
fix: fix ceres
Jan 13, 2026
2a34a63
fix: fix imports
Jan 13, 2026
7a18393
fix: rebase fixes
Jan 13, 2026
dc7c77a
feat: add OPK in the report
Jan 13, 2026
8954b63
fix: another docker + conda try
Jan 13, 2026
4aecbae
fix: fuck single quotes
Jan 14, 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
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
!doc
!LICENSE
!opensfm
!pyproject.toml
!conda.yml
!README.md
!requirements.txt
!setup.cfg
!setup.py
!viewer
Expand Down
52 changes: 52 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# OpenSfM AI Coding Instructions

## 1. Architecture & "Big Picture"
OpenSfM is a Structure-from-Motion library with a hybrid architecture:
- **Core Logic (C++)**: Heavy computational tasks (geometry, bundle adjustment, features) are implemented in C++ under `opensfm/src/`. These are exposed to Python as compiled modules (e.g., `pygeometry`, `pymap`, `pfm`) using **PyBind11**.
- **Pipeline Layout (Python)**: The application logic, pipeline orchestration, and user interface are in Python (`opensfm/` package).
- **Data Abstraction**: The `DataSet` class (`opensfm/dataset.py`) is the central definition for filesystem interactions. All pipeline stages read/write to a hardcoded directory structure (`images/`, `config.yaml`, `reconstruction.json`) managed by this class.
- **State Management**: The `Reconstruction` class (`opensfm/types.py`) wraps the C++ `pymap.Map` object. This pattern (Python class holding a C++ handle) is pervasive.

## 2. Key Developer Workflows

### Building
The project uses `scikit-build-core` to compile C++ extensions.
- **Full Build**: `pip install -e .[test]` (Builds C++ extensions and tests, and installs the package in editable mode).
- **Rebuild C++**: Re-running `pip install -e .` is usually required after changing `.cc` files.
- **Dependencies**: Managed via `pyproject.toml` for managing Python dependencies. Outer envinvironment (C++ toolchain, libraries) is set up through `conda` and the `conda.yml` file. Any change to `conda.yml` requires recreating the conda environment with `conda env create --file conda.yml --yes`, then activating it with `conda activate opensfm`. Note that before running the build commands, the conda environment must be activated once.

### Testing
- **Framework**: `pytest` is used for all tests.
- **Location**: `opensfm/test/` for Python tests. C++ tests are in `./cmake_build`.
- **Synthetic Data**: Python tests heavily rely on synthetic scenes generated in `opensfm/test/conftest.py`. Look for fixtures like `scene_synthetic` or `scene_synthetic_cube`.
- **Run Tests**: `pytest opensfm/test/` for Python tests. C++ tests can be run via `ctest` with `cd cmake_build && ctest --output-on-failure && cd ..`.

### Running the Pipeline
- **Entry Point**: `bin/opensfm` (shell script) -> `bin/opensfm_main.py`.
- **Commands**: Each CLI command (e.g., `detect_features`, `reconstruct`) is implemented as a module in `opensfm/commands/`.
- **Example**: `bin/opensfm reconstruct path/to/dataset` invokes the `run()` method in `opensfm/commands/reconstruct.py`.

## 3. Coding Conventions & Patterns

### Python/C++ Interop
- **Wrappers**: Do not use C++ objects directly if a Python wrapper exists (e.g., use `opensfm.types.Reconstruction` instead of `opensfm.pymap.Map` where possible).
- **Extensions**: C++ extensions are imported from the root package (e.g., `from opensfm import pygeometry`).

### Type Hinting
- **Strictness**: The codebase uses `pyre-strict`. Ensure all new code has complete type annotations. A comment `# pyre-strict` is often present at the top of files.

### Configuration
- **Definition**: Default parameters are in `opensfm/config.py` (dataclass `OpenSfMConfig`).
- **Overrides**: Parameters are overridden by `config.yaml` in the dataset directory.
- **Access**: Access config values via `data.config['param_name']` (where `data` is a `DataSet` instance).

## 4. Essential Files
- `opensfm/dataset.py`: **READ THIS FIRST** when dealing with file I/O. Defines where every file lives.
- `opensfm/types.py`: Defines key data structures (`Reconstruction`, `Shot`, `Camera`).
- `opensfm/config.py`: Documentation for all tunable parameters.
- `opensfm/src/map/map.cc`: The backing C++ implementation for `Reconstruction`.
- `opensfm/commands/`: Implementation of individual pipeline steps.

## 5. Common Pitfalls
- **Direct File Access**: Avoid manual `open()` calls. Use `dataset.load_*` and `dataset.save_*` methods to ensure consistency with the expected directory structure.
- **Geometry Types**: Be careful with rotation representations (angle-axis vs matrices). `pygeometry` exposes helper functions; check `opensfm/src/geometry/` for implementation details if behavior is unclear.
37 changes: 37 additions & 0 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Conda

on: [push, pull_request]

jobs:

build-test:
name: Build conda environment and run tests

strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, macos-latest]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: conda.yml
activate-environment: opensfm

- name: Build OpenSfM
shell: bash -l {0}
run: pip install -e .[test]

- name: Run C++ tests
shell: bash -l {0}
run: cd cmake_build && ctest

- name: Run Python tests
shell: bash -l {0}
run: export LD_PRELOAD=$CONDA_PREFIX/lib/libtcmalloc.so && python -m pytest
23 changes: 0 additions & 23 deletions .github/workflows/docker.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/docker_ceres2.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .github/workflows/docker_ubuntu20.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docker Ubuntu 20.04

on: [push, pull_request]

jobs:

build-test:
name: Build docker and run tests on Ubuntu 20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Build the Docker image
run: docker build . --file Dockerfile.ubuntu20 --tag mapillary/opensfm.ubuntu20:$GITHUB_SHA

- name: Run C++ tests
run: docker run mapillary/opensfm.ubuntu20:$GITHUB_SHA /bin/bash -c 'source ~/.bashrc && conda activate opensfm && cd cmake_build && ctest'

- name: Run Python tests
run: docker run mapillary/opensfm.ubuntu20:$GITHUB_SHA /bin/bash -c 'source ~/.bashrc && conda activate opensfm && export LD_PRELOAD=$CONDA_PREFIX/lib/libtcmalloc.so && python3 -m pytest'
23 changes: 23 additions & 0 deletions .github/workflows/docker_ubuntu24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Docker Ubuntu 24.04

on: [push, pull_request]

jobs:

build-test:
name: Build docker and run tests on Ubuntu 24.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Build the Docker image
run: docker build . --file Dockerfile.ubuntu24 --tag mapillary/opensfm.ubuntu24:$GITHUB_SHA

- name: Run C++ tests
run: docker run mapillary/opensfm.ubuntu24:$GITHUB_SHA /bin/bash -c 'source ~/.bashrc && conda activate opensfm && cd cmake_build && ctest --output-on-failure'

- name: Run Python tests
run: docker run mapillary/opensfm.ubuntu24:$GITHUB_SHA /bin/bash -c 'source ~/.bashrc && conda activate opensfm && export LD_PRELOAD=$CONDA_PREFIX/lib/libtcmalloc.so && python -m pytest -v'
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ xcode
launch.json
.vscode
.idea
.claude
uv.lock

# Ignore generated files
/build
Expand All @@ -29,3 +31,5 @@ data/berlin/*

# Ignore virtualenv files
env/*

PACKAGE
31 changes: 0 additions & 31 deletions Dockerfile

This file was deleted.

43 changes: 0 additions & 43 deletions Dockerfile.ceres2

This file was deleted.

36 changes: 36 additions & 0 deletions Dockerfile.ubuntu20
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
wget \
python3-dev \
python3-pip \
python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Miniconda
FROM continuumio/miniconda3

# Setup source
COPY . /source/OpenSfM
WORKDIR /source/OpenSfM

# Create conda environment from conda.yml
RUN conda env create --file conda.yml --yes

# Override default shell and use bash in the conda environment
SHELL ["conda", "run", "-n", "opensfm", "/bin/bash", "-c"]

# Build and install OpenSfM using pip with pyproject.toml
# C++ tests are built automatically (OPENSFM_BUILD_TESTS=ON in pyproject.toml)
# and will be available in cmake_build/ directory for running with ctest
RUN pip install --no-cache-dir -e .[test]

# Ensure we always activate the conda environment when starting a bash shell
RUN echo "conda activate opensfm" >> ~/.bashrc
36 changes: 36 additions & 0 deletions Dockerfile.ubuntu24
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y \
build-essential \
cmake \
git \
wget \
python3-dev \
python3-pip \
python3-venv \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Install Miniconda
FROM continuumio/miniconda3

# Setup source
COPY . /source/OpenSfM
WORKDIR /source/OpenSfM

# Create conda environment from conda.yml
RUN conda env create --file conda.yml --yes

# Override default shell and use bash in the conda environment
SHELL ["conda", "run", "-n", "opensfm", "/bin/bash", "-c"]

# Build and install OpenSfM using pip with pyproject.toml
# C++ tests are built automatically (OPENSFM_BUILD_TESTS=ON in pyproject.toml)
# and will be available in cmake_build/ directory for running with ctest
RUN pip install --no-cache-dir -e .[test]

# Ensure we always activate the conda environment when starting a bash shell
RUN echo "conda activate opensfm" >> ~/.bashrc
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Please note that all such changes are released under the AGPLv3 license, not BSD

OpenSfM ![Docker workflow](https://github.com/mapillary/opensfm/workflows/Docker%20CI/badge.svg)
=======
[![Conda](https://github.com/mapillary/OpenSfM/actions/workflows/conda.yml/badge.svg)](https://github.com/mapillary/OpenSfM/actions/workflows/conda.yml) [![Docker Ubuntu 20.04](https://github.com/mapillary/OpenSfM/actions/workflows/docker_ubuntu20.yml/badge.svg)](https://github.com/mapillary/OpenSfM/actions/workflows/docker_ubuntu20.yml) [![Docker Ubuntu 24.04](https://github.com/mapillary/OpenSfM/actions/workflows/docker_ubuntu24.yml/badge.svg)](https://github.com/mapillary/OpenSfM/actions/workflows/docker_ubuntu24.yml)

## Overview
OpenSfM is a Structure from Motion library written in Python. The library serves as a processing pipeline for reconstructing camera poses and 3D scenes from multiple images. It consists of basic modules for Structure from Motion (feature detection/matching, minimal solvers) with a focus on building a robust and scalable reconstruction pipeline. It also integrates external sensor (e.g. GPS, accelerometer) measurements for geographical alignment and robustness. A JavaScript viewer is provided to preview the models and debug the pipeline.
Expand Down
10 changes: 6 additions & 4 deletions annotation_gui_gcp/lib/GUI.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# pyre-unsafe
import os
import random
import subprocess
Expand All @@ -6,12 +7,13 @@
from collections import defaultdict

import flask
from annotation_gui_gcp.lib.views.cad_view import CADView
from annotation_gui_gcp.lib.views.cp_finder_view import ControlPointFinderView
from annotation_gui_gcp.lib.views.image_view import ImageView
from annotation_gui_gcp.lib.views.tools_view import ToolsView
from opensfm import dataset

from .views.cad_view import CADView
from .views.cp_finder_view import ControlPointFinderView
from .views.image_view import ImageView
from .views.tools_view import ToolsView


class Gui:
def __init__(
Expand Down
Loading
Loading