From b5992a2a9b7ff7cb1df848d3113fde001e7e3050 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 13 Sep 2024 07:26:43 -0400 Subject: [PATCH 1/4] Merge cameras.json --- opendm/shots.py | 13 +++++++++++++ stages/splitmerge.py | 11 ++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/opendm/shots.py b/opendm/shots.py index 2d8ae23fb..b6eeeb302 100644 --- a/opendm/shots.py +++ b/opendm/shots.py @@ -148,3 +148,16 @@ def merge_geojson_shots(geojson_shots_files, output_geojson_file): with open(output_geojson_file, "w") as f: f.write(json.dumps(result)) + +def merge_cameras(cameras_json_files, output_cameras_file): + result = {} + for cameras_file in cameras_json_files: + with open(cameras_file, "r") as f: + cameras = json.loads(f.read()) + + for cam_id in cameras: + if not cam_id in result: + result[cam_id] = cameras[cam_id] + + with open(output_cameras_file, "w") as f: + f.write(json.dumps(result)) diff --git a/stages/splitmerge.py b/stages/splitmerge.py index 80e130978..944a6052a 100644 --- a/stages/splitmerge.py +++ b/stages/splitmerge.py @@ -15,7 +15,7 @@ from opendm.cropper import Cropper from opendm.concurrency import get_max_memory from opendm.remote import LocalRemoteExecutor -from opendm.shots import merge_geojson_shots +from opendm.shots import merge_geojson_shots, merge_cameras from opendm import point_cloud from opendm.utils import double_quote from opendm.tiles.tiler import generate_dem_tiles @@ -337,6 +337,15 @@ def merge_dems(dem_filename, human_name): else: log.ODM_WARNING("Found merged shots.geojson in %s" % tree.odm_report) + # Merge cameras + cameras_json = tree.path("cameras.json") + if not io.file_exists(cameras_json) or self.rerun(): + cameras_json_files = get_submodel_paths(tree.submodels_path, "cameras.json") + log.ODM_INFO("Merging %s cameras.json files" % len(cameras_json_files)) + merge_cameras(cameras_json_files, cameras_json) + else: + log.ODM_WARNING("Found merged cameras.json in %s" % tree.root_path) + # Stop the pipeline short by skipping to the postprocess stage. # Afterwards, we're done. self.next_stage = self.last_stage() From 8e341ddcc7c1748275b8f5449bce6a3c09262568 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 13 Sep 2024 07:42:22 -0400 Subject: [PATCH 2/4] Bump version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 444877d48..65afb3b88 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.5.3 +3.5.4 From 56b1d9eef8adef70ecf9dc1948680988f0e18a77 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 13 Sep 2024 07:45:37 -0400 Subject: [PATCH 3/4] Bump artifact version --- .github/workflows/publish-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-windows.yml b/.github/workflows/publish-windows.yml index f09a846c8..57cd39e6a 100644 --- a/.github/workflows/publish-windows.yml +++ b/.github/workflows/publish-windows.yml @@ -49,7 +49,7 @@ jobs: run: | python configure.py dist --code-sign-cert-path $env:CODE_SIGN_CERT_PATH - name: Upload Setup File - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Setup path: dist\*.exe From c80af89fa3e4f5c566657b5066d323d78e436c18 Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Fri, 13 Sep 2024 07:46:29 -0400 Subject: [PATCH 4/4] Bump artifact version --- .github/workflows/test-build-prs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-prs.yaml b/.github/workflows/test-build-prs.yaml index 092c34466..ddc127620 100644 --- a/.github/workflows/test-build-prs.yaml +++ b/.github/workflows/test-build-prs.yaml @@ -81,7 +81,7 @@ jobs: run: | python configure.py dist - name: Upload Setup File - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Setup path: dist\*.exe