From 52db9efc181d20d1c3c548d22a762b61229300d2 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 20 Apr 2026 17:43:25 +0100 Subject: [PATCH 1/9] feat: add simple devcontainer setup A devcontainer is a small wrapper around Docker to make it easy to set up a clean development environment. Most IDE's and code editors support these now as well as many cloud environments. I've included a very simple environment to start with which we can extend as necessary later to streamline the build process. --- .devcontainer/devcontainer.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..8e139e000 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,12 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/python +{ + "name": "Python 3", + // The cpp image includes python and we need the c++ toolchains to build our dependencies. + "image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", + "features": { + "ghcr.io/devcontainers/features/common-utils:2": {} + }, + + "postCreateCommand": "apt install python3-gdal" +} From d574ab2909158cd56a2594b3be554c279cbb3c57 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Thu, 7 May 2026 09:44:40 +0000 Subject: [PATCH 2/9] Install CUDA in devcontainer --- .devcontainer/devcontainer.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 8e139e000..697464ec6 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,12 +1,15 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/python { - "name": "Python 3", + "name": "ODM", // The cpp image includes python and we need the c++ toolchains to build our dependencies. "image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", "features": { - "ghcr.io/devcontainers/features/common-utils:2": {} + "ghcr.io/devcontainers/features/common-utils:2": {}, + "ghcr.io/devcontainers/features/nvidia-cuda:3": {} }, - - "postCreateCommand": "apt install python3-gdal" + "hostRequirements": { + "gpu": "optional" + }, + "postCreateCommand": "bash configure.sh install" } From b6f2b5e89572f46298e5aeb7379ebb2894de04cf Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 11 May 2026 10:28:10 +0100 Subject: [PATCH 3/9] Move to single Dockerfile --- .devcontainer/cpu/devcontainer.json | 28 +++++++++++++++ .devcontainer/devcontainer.json | 15 -------- .devcontainer/gpu/devcontainer.json | 31 ++++++++++++++++ .github/workflows/publish-docker-gpu.yaml | 3 ++ .github/workflows/publish-docker.yaml | 4 ++- .github/workflows/test-build-prs.yaml | 4 ++- .gitignore | 1 + Dockerfile | 44 ++++++++++++++--------- configure.sh | 6 ++-- 9 files changed, 100 insertions(+), 36 deletions(-) create mode 100644 .devcontainer/cpu/devcontainer.json delete mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/gpu/devcontainer.json diff --git a/.devcontainer/cpu/devcontainer.json b/.devcontainer/cpu/devcontainer.json new file mode 100644 index 000000000..90e3bf09f --- /dev/null +++ b/.devcontainer/cpu/devcontainer.json @@ -0,0 +1,28 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +{ + "name": "ODM", + "build": { + "context": "../..", + "dockerfile": "../../Dockerfile", + "target": "dev", + "args": { + "BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", + "RUNTIME_BASE_IMAGE": "ubuntu:24.04" + } + }, + "features": { + // https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh + // Add `odm` user for consistency with the GPU image + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "odm", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + } + }, + "remoteUser": "odm", + // Use the `code` directory for compatibility with direct Docker workflows + "workspaceMount": "source=${localWorkspaceFolder},target=/code,type=bind", + "workspaceFolder": "/code" +} diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 697464ec6..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,15 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/python -{ - "name": "ODM", - // The cpp image includes python and we need the c++ toolchains to build our dependencies. - "image": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", - "features": { - "ghcr.io/devcontainers/features/common-utils:2": {}, - "ghcr.io/devcontainers/features/nvidia-cuda:3": {} - }, - "hostRequirements": { - "gpu": "optional" - }, - "postCreateCommand": "bash configure.sh install" -} diff --git a/.devcontainer/gpu/devcontainer.json b/.devcontainer/gpu/devcontainer.json new file mode 100644 index 000000000..390531efc --- /dev/null +++ b/.devcontainer/gpu/devcontainer.json @@ -0,0 +1,31 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +{ + "name": "ODM GPU", + "build": { + "context": "../..", + "dockerfile": "../../Dockerfile", + "target": "dev", + "args": { + "BASE_IMAGE": "nvidia/cuda:12.9.1-devel-ubuntu24.04", + "RUNTIME_BASE_IMAGE": "nvidia/cuda:12.9.1-runtime-ubuntu24.04" + } + }, + "features": { + // https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh + // Add `odm` user for consistency with the CPU image + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "odm", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + } + }, + "remoteUser": "odm", + // Use the `code` directory for compatibility with direct Docker workflows + "workspaceMount": "source=${localWorkspaceFolder},target=/code,type=bind", + "workspaceFolder": "/code", + "hostRequirements": { + "gpu": "true" + } +} diff --git a/.github/workflows/publish-docker-gpu.yaml b/.github/workflows/publish-docker-gpu.yaml index 9ad834195..957593e61 100644 --- a/.github/workflows/publish-docker-gpu.yaml +++ b/.github/workflows/publish-docker-gpu.yaml @@ -32,6 +32,9 @@ jobs: push: true no-cache: true tags: opendronemap/odm:gpu + build-args: | + BASE_IMAGE=nvidia/cuda:12.9.1-devel-ubuntu24.04 + RUNTIME_BASE_IMAGE=nvidia/cuda:12.9.1-runtime-ubuntu24.04 # Trigger NodeODM build - name: Dispatch NodeODM Build Event id: nodeodm_dispatch diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml index 4aafa0265..ed9cf1fae 100644 --- a/.github/workflows/publish-docker.yaml +++ b/.github/workflows/publish-docker.yaml @@ -39,10 +39,12 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - file: ./portable.Dockerfile + file: ./Dockerfile platforms: linux/amd64,linux/arm64 push: true no-cache: true + build-args: | + PORTABLE_INSTALL=true tags: | ${{ steps.docker_meta.outputs.tags }} opendronemap/odm:latest diff --git a/.github/workflows/test-build-prs.yaml b/.github/workflows/test-build-prs.yaml index fef51196c..88bbe736c 100644 --- a/.github/workflows/test-build-prs.yaml +++ b/.github/workflows/test-build-prs.yaml @@ -20,9 +20,11 @@ jobs: - name: Build uses: docker/build-push-action@v2 with: - file: ./portable.Dockerfile + file: ./Dockerfile platforms: linux/amd64 push: false + build-args: | + PORTABLE_INSTALL=true # snapcraft: # runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index c71ff5812..1387a2f72 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ include/ lib/ logs/ share/ +datasets/ src/ diff --git a/Dockerfile b/Dockerfile index 70ae94ac9..49560e4e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,40 @@ -FROM ubuntu:24.04 AS builder +ARG BASE_IMAGE=mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04 +ARG RUNTIME_BASE_IMAGE=ubuntu:24.04 -# Env variables -ENV DEBIAN_FRONTEND=noninteractive \ - PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ - LD_LIBRARY_PATH="/code/SuperBuild/install/lib" +FROM ${BASE_IMAGE} AS dev + +# Build toggles: +# - PORTABLE_INSTALL=YES enables the portable compiler wrappers. +ARG PORTABLE_INSTALL=NO + +RUN if id "ubuntu" &>/dev/null; then \ + echo "Deleting user 'ubuntu'" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user"; \ + else \ + echo "User 'ubuntu' does not exist"; \ + fi -# Prepare directories WORKDIR /code +FROM dev AS builder + # Copy everything COPY . ./ # Run the build -RUN bash configure.sh install +RUN PORTABLE_INSTALL=${PORTABLE_INSTALL} bash configure.sh install # Run the tests ENV PATH="/code/venv/bin:$PATH" RUN bash test.sh -# Clean Superbuild -RUN bash configure.sh clean - ### END Builder ### Use a second image for the final asset to reduce the number and # size of the layers. -FROM ubuntu:24.04 +FROM ${RUNTIME_BASE_IMAGE} AS runtime + +# Optional runtime packages for image variants +ARG EXTRA_RUNTIME_PACKAGES= # Env variables ENV DEBIAN_FRONTEND=noninteractive \ @@ -43,11 +52,14 @@ ENV PATH="/code/venv/bin:$PATH" # Install shared libraries that we depend on via APT, but *not* # the -dev packages to save space! # Also run a smoke test on ODM and OpenSfM -RUN bash configure.sh installruntimedepsonly \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ - && bash run.sh --help \ - && bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'" +RUN if [ -n "${EXTRA_RUNTIME_PACKAGES}" ]; then \ + apt-get update -y && apt-get install -y ${EXTRA_RUNTIME_PACKAGES}; \ + fi; \ + bash configure.sh installruntimedepsonly; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \ + bash run.sh --help; \ + bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'" # Entry point ENTRYPOINT ["python3", "/code/run.py"] diff --git a/configure.sh b/configure.sh index 6c3196d2d..97eef8287 100755 --- a/configure.sh +++ b/configure.sh @@ -106,7 +106,7 @@ installruntimedepsonly() { } installreqs() { - cd /code + cd ${RUNPATH} ## Set up library paths export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUNPATH/SuperBuild/install/lib @@ -136,7 +136,7 @@ installreqs() { installpython() { echo "Installing Python requirements" - cd /code + cd ${RUNPATH} set -e venv/bin/pip install -r requirements.txt --ignore-installed set +e @@ -196,7 +196,7 @@ clean() { ${RUNPATH}/SuperBuild/download \ ${RUNPATH}/SuperBuild/src - # find in /code and delete static libraries and intermediate object files + # find and delete static libraries and intermediate object files find ${RUNPATH} -type f -name "*.a" -delete -or -type f -name "*.o" -delete } From ddbd6420209742fe7f623881353983b6897cf7e4 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 11 May 2026 14:19:36 +0100 Subject: [PATCH 4/9] Clean up dockerfiles and devcontainers --- .devcontainer/cpu/devcontainer.json | 8 +--- .devcontainer/gpu/devcontainer.json | 10 +---- .dockerignore | 3 +- .github/workflows/publish-docker-gpu.yaml | 3 -- .github/workflows/publish-docker.yaml | 2 +- Dockerfile | 33 +++++--------- gpu.Dockerfile | 25 ++++++++--- portable.Dockerfile | 53 ----------------------- test.sh | 7 +++ 9 files changed, 41 insertions(+), 103 deletions(-) delete mode 100644 portable.Dockerfile diff --git a/.devcontainer/cpu/devcontainer.json b/.devcontainer/cpu/devcontainer.json index 90e3bf09f..ddee50393 100644 --- a/.devcontainer/cpu/devcontainer.json +++ b/.devcontainer/cpu/devcontainer.json @@ -4,11 +4,7 @@ "build": { "context": "../..", "dockerfile": "../../Dockerfile", - "target": "dev", - "args": { - "BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04", - "RUNTIME_BASE_IMAGE": "ubuntu:24.04" - } + "target": "dev" }, "features": { // https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh @@ -16,8 +12,6 @@ "ghcr.io/devcontainers/features/common-utils:2": { "installZsh": "true", "username": "odm", - "userUid": "1000", - "userGid": "1000", "upgradePackages": "true" } }, diff --git a/.devcontainer/gpu/devcontainer.json b/.devcontainer/gpu/devcontainer.json index 390531efc..f7c4bec50 100644 --- a/.devcontainer/gpu/devcontainer.json +++ b/.devcontainer/gpu/devcontainer.json @@ -3,12 +3,8 @@ "name": "ODM GPU", "build": { "context": "../..", - "dockerfile": "../../Dockerfile", - "target": "dev", - "args": { - "BASE_IMAGE": "nvidia/cuda:12.9.1-devel-ubuntu24.04", - "RUNTIME_BASE_IMAGE": "nvidia/cuda:12.9.1-runtime-ubuntu24.04" - } + "dockerfile": "../../gpu.Dockerfile", + "target": "dev" }, "features": { // https://github.com/devcontainers/features/blob/main/src/common-utils/main.sh @@ -16,8 +12,6 @@ "ghcr.io/devcontainers/features/common-utils:2": { "installZsh": "true", "username": "odm", - "userUid": "1000", - "userGid": "1000", "upgradePackages": "true" } }, diff --git a/.dockerignore b/.dockerignore index 487ad3e85..cddf3c5a6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -17,7 +17,8 @@ images_resize /hooks /img /license +/datasets settings.yml code_of_conduct.md configure_18_04.sh -index.html \ No newline at end of file +index.html diff --git a/.github/workflows/publish-docker-gpu.yaml b/.github/workflows/publish-docker-gpu.yaml index 957593e61..9ad834195 100644 --- a/.github/workflows/publish-docker-gpu.yaml +++ b/.github/workflows/publish-docker-gpu.yaml @@ -32,9 +32,6 @@ jobs: push: true no-cache: true tags: opendronemap/odm:gpu - build-args: | - BASE_IMAGE=nvidia/cuda:12.9.1-devel-ubuntu24.04 - RUNTIME_BASE_IMAGE=nvidia/cuda:12.9.1-runtime-ubuntu24.04 # Trigger NodeODM build - name: Dispatch NodeODM Build Event id: nodeodm_dispatch diff --git a/.github/workflows/publish-docker.yaml b/.github/workflows/publish-docker.yaml index ed9cf1fae..1084686c3 100644 --- a/.github/workflows/publish-docker.yaml +++ b/.github/workflows/publish-docker.yaml @@ -44,7 +44,7 @@ jobs: push: true no-cache: true build-args: | - PORTABLE_INSTALL=true + PORTABLE=YES tags: | ${{ steps.docker_meta.outputs.tags }} opendronemap/odm:latest diff --git a/Dockerfile b/Dockerfile index 49560e4e9..4e17f301f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,4 @@ -ARG BASE_IMAGE=mcr.microsoft.com/devcontainers/cpp:ubuntu-24.04 -ARG RUNTIME_BASE_IMAGE=ubuntu:24.04 - -FROM ${BASE_IMAGE} AS dev - -# Build toggles: -# - PORTABLE_INSTALL=YES enables the portable compiler wrappers. -ARG PORTABLE_INSTALL=NO +FROM ubuntu:24.04 AS dev RUN if id "ubuntu" &>/dev/null; then \ echo "Deleting user 'ubuntu'" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user"; \ @@ -15,35 +8,32 @@ RUN if id "ubuntu" &>/dev/null; then \ WORKDIR /code +######## Builder ######## FROM dev AS builder +ARG PORTABLE=NO + # Copy everything COPY . ./ # Run the build -RUN PORTABLE_INSTALL=${PORTABLE_INSTALL} bash configure.sh install +RUN PORTABLE_INSTALL=${PORTABLE} bash configure.sh install # Run the tests ENV PATH="/code/venv/bin:$PATH" RUN bash test.sh -### END Builder +######## Runtime ######## +FROM ubuntu:24.04 AS runtime -### Use a second image for the final asset to reduce the number and -# size of the layers. -FROM ${RUNTIME_BASE_IMAGE} AS runtime - -# Optional runtime packages for image variants -ARG EXTRA_RUNTIME_PACKAGES= +ARG HARDWARE # Env variables ENV DEBIAN_FRONTEND=noninteractive \ - PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ + PYTHONPATH="/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ LD_LIBRARY_PATH="/code/SuperBuild/install/lib" \ PDAL_DRIVER_PATH="/code/SuperBuild/install/bin" -WORKDIR /code - # Copy everything we built from the builder COPY --from=builder /code /code @@ -52,10 +42,7 @@ ENV PATH="/code/venv/bin:$PATH" # Install shared libraries that we depend on via APT, but *not* # the -dev packages to save space! # Also run a smoke test on ODM and OpenSfM -RUN if [ -n "${EXTRA_RUNTIME_PACKAGES}" ]; then \ - apt-get update -y && apt-get install -y ${EXTRA_RUNTIME_PACKAGES}; \ - fi; \ - bash configure.sh installruntimedepsonly; \ +RUN bash configure.sh installruntimedepsonly; \ apt-get clean; \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \ bash run.sh --help; \ diff --git a/gpu.Dockerfile b/gpu.Dockerfile index 437d780f6..11e3c9e83 100644 --- a/gpu.Dockerfile +++ b/gpu.Dockerfile @@ -1,13 +1,21 @@ -FROM nvidia/cuda:12.9.1-devel-ubuntu24.04 AS builder +FROM nvidia/cuda:12.9.1-devel-ubuntu24.04 AS dev -# Env variables -ENV DEBIAN_FRONTEND=noninteractive \ - PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib" +RUN if id "ubuntu" &>/dev/null; then \ + echo "Deleting user 'ubuntu'" && userdel -f -r ubuntu || echo "Failed to delete ubuntu user"; \ + else \ + echo "User 'ubuntu' does not exist"; \ + fi -# Prepare directories WORKDIR /code +######## Builder ######## +FROM dev AS builder + +# Env variables +ENV DEBIAN_FRONTEND=noninteractive \ + PYTHONPATH="/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ + LD_LIBRARY_PATH="/code/SuperBuild/install/lib" + # Copy everything COPY . ./ @@ -41,7 +49,10 @@ COPY --from=builder /code /code ENV PATH="/code/venv/bin:$PATH" RUN apt-get update -y \ - && apt-get install -y ffmpeg libtbbmalloc2 + && apt-get install -y ffmpeg libtbbmalloc2 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + # Install shared libraries that we depend on via APT, but *not* # the -dev packages to save space! # Also run a smoke test on ODM and OpenSfM diff --git a/portable.Dockerfile b/portable.Dockerfile deleted file mode 100644 index 27c459a0d..000000000 --- a/portable.Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:24.04 AS builder - -# Env variables -ENV DEBIAN_FRONTEND=noninteractive \ - PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib" - -# Prepare directories -WORKDIR /code - -# Copy everything -COPY . ./ - -# Run the build -RUN PORTABLE_INSTALL=YES bash configure.sh install - -# Run the tests -ENV PATH="/code/venv/bin:$PATH" -RUN bash test.sh - -# Clean Superbuild -RUN bash configure.sh clean - -### END Builder - -### Use a second image for the final asset to reduce the number and -# size of the layers. -FROM ubuntu:24.04 - -# Env variables -ENV DEBIAN_FRONTEND=noninteractive \ - PYTHONPATH="$PYTHONPATH:/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/SuperBuild/install/lib" \ - PDAL_DRIVER_PATH="/code/SuperBuild/install/bin" - -WORKDIR /code - -# Copy everything we built from the builder -COPY --from=builder /code /code - -ENV PATH="/code/venv/bin:$PATH" - -# Install shared libraries that we depend on via APT, but *not* -# the -dev packages to save space! -# Also run a smoke test on ODM and OpenSfM -RUN bash configure.sh installruntimedepsonly \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ - && bash run.sh --help \ - && bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'" - -# Entry point -ENTRYPOINT ["python3", "/code/run.py"] diff --git a/test.sh b/test.sh index fb79218cd..c0f7d00f9 100755 --- a/test.sh +++ b/test.sh @@ -1,3 +1,10 @@ +RUNPATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +if [ -e $RUNPATH/venv ]; then + source $RUNPATH/venv/bin/activate +fi +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$RUNPATH/SuperBuild/install/lib +export DYLD_LIBRARY_PATH=$RUNPATH/SuperBuild/install/lib + if [ ! -z "$1" ]; then python3 -m unittest discover tests "test_$1.py" else From 811cb53df330db45fe5d79ec5ae2fc76c509abb6 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Mon, 11 May 2026 16:15:38 +0100 Subject: [PATCH 5/9] Working Docker and devcontainer --- .dockerignore | 1 + Dockerfile | 2 ++ gpu.Dockerfile | 5 ----- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index cddf3c5a6..bc709abd5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,6 +11,7 @@ odm_meshing odm_georeferencing images_resize .git +venv /contrib /docs diff --git a/Dockerfile b/Dockerfile index 4e17f301f..b7d841a9c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,8 @@ ENV DEBIAN_FRONTEND=noninteractive \ LD_LIBRARY_PATH="/code/SuperBuild/install/lib" \ PDAL_DRIVER_PATH="/code/SuperBuild/install/bin" +WORKDIR /code + # Copy everything we built from the builder COPY --from=builder /code /code diff --git a/gpu.Dockerfile b/gpu.Dockerfile index 11e3c9e83..8277b345c 100644 --- a/gpu.Dockerfile +++ b/gpu.Dockerfile @@ -11,11 +11,6 @@ WORKDIR /code ######## Builder ######## FROM dev AS builder -# Env variables -ENV DEBIAN_FRONTEND=noninteractive \ - PYTHONPATH="/code/SuperBuild/install/local/lib/python3.12/dist-packages:/code/SuperBuild/install/lib/python3.12/dist-packages:/code/SuperBuild/install/bin/opensfm" \ - LD_LIBRARY_PATH="/code/SuperBuild/install/lib" - # Copy everything COPY . ./ From f5496502e36631072ae17e9dbf950f5070c78ecd Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 12 May 2026 09:01:23 +0100 Subject: [PATCH 6/9] Update README with dev instructions --- .devcontainer/{cpu => }/devcontainer.json | 9 +- .devcontainer/gpu/devcontainer.json | 3 + .dockerignore | 1 - .gitignore | 3 - Dockerfile | 5 + README.md | 145 ++++++++++------------ configure.sh | 2 +- 7 files changed, 84 insertions(+), 84 deletions(-) rename .devcontainer/{cpu => }/devcontainer.json (75%) diff --git a/.devcontainer/cpu/devcontainer.json b/.devcontainer/devcontainer.json similarity index 75% rename from .devcontainer/cpu/devcontainer.json rename to .devcontainer/devcontainer.json index ddee50393..dcdff340d 100644 --- a/.devcontainer/cpu/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -2,8 +2,8 @@ { "name": "ODM", "build": { - "context": "../..", - "dockerfile": "../../Dockerfile", + "context": "..", + "dockerfile": "../Dockerfile", "target": "dev" }, "features": { @@ -18,5 +18,8 @@ "remoteUser": "odm", // Use the `code` directory for compatibility with direct Docker workflows "workspaceMount": "source=${localWorkspaceFolder},target=/code,type=bind", - "workspaceFolder": "/code" + "workspaceFolder": "/code", + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE},target=/home/odm,type=bind,consistency=cached" + ] } diff --git a/.devcontainer/gpu/devcontainer.json b/.devcontainer/gpu/devcontainer.json index f7c4bec50..6e9f4f8ae 100644 --- a/.devcontainer/gpu/devcontainer.json +++ b/.devcontainer/gpu/devcontainer.json @@ -19,6 +19,9 @@ // Use the `code` directory for compatibility with direct Docker workflows "workspaceMount": "source=${localWorkspaceFolder},target=/code,type=bind", "workspaceFolder": "/code", + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE},target=/home/odm,type=bind,consistency=cached" + ], "hostRequirements": { "gpu": "true" } diff --git a/.dockerignore b/.dockerignore index bc709abd5..c947a09a4 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,7 +18,6 @@ venv /hooks /img /license -/datasets settings.yml code_of_conduct.md configure_18_04.sh diff --git a/.gitignore b/.gitignore index 1387a2f72..4bbc91b10 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,6 @@ include/ lib/ logs/ share/ -datasets/ - - src/ !modules/* diff --git a/Dockerfile b/Dockerfile index b7d841a9c..183c7419a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,11 @@ RUN if id "ubuntu" &>/dev/null; then \ echo "User 'ubuntu' does not exist"; \ fi +RUN apt-get update -y && apt-get install -y \ + python3 \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + WORKDIR /code ######## Builder ######## diff --git a/README.md b/README.md index 7d7c20aaa..5229df47b 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ An open source command line toolkit for processing aerial drone imagery. ODM turns simple 2D images into: -* Classified Point Clouds -* 3D Textured Models -* Georeferenced Orthorectified Imagery -* Georeferenced Digital Elevation Models +- Classified Point Clouds +- 3D Textured Models +- Georeferenced Orthorectified Imagery +- Georeferenced Digital Elevation Models ![images-diag](https://user-images.githubusercontent.com/1174901/96644651-5b205600-12f7-11eb-827b-8f4a3a6f3b21.png) @@ -27,6 +27,7 @@ Run ODM by placing some images (JPEGs, TIFFs or DNGs) in a folder named “image # Windows docker run -ti --rm -v c:/Users/youruser/datasets:/datasets opendronemap/odm --project-path /datasets project ``` + ```bash # Mac/Linux docker run -ti --rm -v /home/youruser/datasets:/datasets opendronemap/odm --project-path /datasets project @@ -64,9 +65,10 @@ When the process finishes, the results will be organized as follows: |-- odm_orthophoto.tif # Orthophoto GeoTiff You can use the following free and open source software to open the files generated in ODM: - * .tif (GeoTIFF): [QGIS](http://www.qgis.org/) - * .laz (Compressed LAS): [CloudCompare](https://www.cloudcompare.org/) - * .obj (Wavefront OBJ), .ply (Stanford Triangle Format): [MeshLab](http://www.meshlab.net/) + +- .tif (GeoTIFF): [QGIS](http://www.qgis.org/) +- .laz (Compressed LAS): [CloudCompare](https://www.cloudcompare.org/) +- .obj (Wavefront OBJ), .ply (Stanford Triangle Format): [MeshLab](http://www.meshlab.net/) **Note!** Opening the .tif files generated by ODM in programs such as Photoshop or GIMP might not work (they are GeoTIFFs, not plain TIFFs). Use [QGIS](http://www.qgis.org/) instead. @@ -94,13 +96,13 @@ run C:\Users\youruser\datasets\project [--additional --parameters --here] ODM has support for doing SIFT feature extraction on a GPU, which is about 2x faster than the CPU on a typical consumer laptop. To use this feature, you need to use the `opendronemap/odm:gpu` docker image instead of `opendronemap/odm` and you need to pass the `--gpus all` flag: -``` +```bash docker run -ti --rm -v c:/Users/youruser/datasets:/datasets --gpus all opendronemap/odm:gpu --project-path /datasets project --feature-type sift ``` When you run ODM, if the GPU is recognized, in the first few lines of output you should see: -``` +```bash [INFO] Writing exif overrides [INFO] Maximum photo dimensions: 4000px [INFO] Found GPU device: Intel(R) OpenCL HD Graphics @@ -111,14 +113,14 @@ The SIFT GPU implementation is CUDA-based, so should work with most NVIDIA graph If you have an NVIDIA card, you can test that docker is recognizing the GPU by running: -``` +```bash docker run --rm --gpus all nvidia/cuda:10.0-base nvidia-smi ``` If you see an output that looks like this: -``` -Fri Jul 24 18:51:55 2020 +```bash +Fri Jul 24 18:51:55 2020 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ @@ -130,9 +132,45 @@ You're in good shape! See https://github.com/NVIDIA/nvidia-docker and https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker for information on docker/NVIDIA setup. + +## Video Support + +Starting from version 3.0.4, ODM can automatically extract images from video files (.mp4, .mov, .lrv, .ts). Just place one or more video files into the `images` folder and run the program as usual. Subtitles files (.srt) with GPS information are also supported. Place .srt files in the `images` folder, making sure that the filenames match. For example, `my_video.mp4` ==> `my_video.srt` (case-sensitive). + +## Developers + +Help improve our software! We welcome contributions from everyone, whether to add new features, improve speed, fix existing bugs or add support for more cameras. Check our [code of conduct](https://github.com/OpenDroneMap/documents/blob/master/CONDUCT.md), the [contributing guidelines](https://github.com/OpenDroneMap/documents/blob/master/CONTRIBUTING.md) and [how decisions are made](https://github.com/OpenDroneMap/documents/blob/master/GOVERNANCE.md#how-decisions-are-made). + +### Installation and first run + +For most users, the easiest way to modify the software is to use the [devcontainer](https://containers.dev/). Most IDE's natively support this format and will prompt to open the devcontainer whenever you open the repository. + +> **Note:** If your IDE doesn't support devcontainers, they can also be [run using a CLI](https://github.com/devcontainers/cli). +> ```bash +> devcontainer up +> # And to connect +> devcontainer exec /bin/bash +> ``` + +Once started either through your IDE or the CLI, you can run this command within the container to build and install ODM: + +```bash +./configure.sh install +``` + +The devcontainer mounts your home directory into the containers home directory and so you can use any datasets you have by setting the project path normally: + +```bash +# e.g. +./run.sh --project-path ~/datasets mydataset +``` + +You can now make changes to the ODM source and rebuild to test out any changes. + +## Advanced ## Native Install (Ubuntu 24.04) -You can run ODM natively on Ubuntu 24.04 (although we don't recommend it): +You can run ODM natively on Ubuntu 24.04 (although we don't recommend it): ```bash git clone https://github.com/OpenDroneMap/ODM @@ -150,8 +188,8 @@ You can run ODM natively on Intel/ARM MacOS. First install: - * Xcode 13 (not 14, there's currently a bug) - * [Homebrew](https://docs.brew.sh/Installation) +- Xcode 13 (not 14, there's currently a bug) +- [Homebrew](https://docs.brew.sh/Installation) Then Run: @@ -169,7 +207,9 @@ This could be improved in the future. [Helps us create a Homebrew formula](https When updating to a newer version of native ODM, it is recommended that you run: -`bash configure.sh reinstall` +```bash +bash configure.sh reinstall +``` to ensure all the dependent packages and modules get updated. @@ -180,7 +220,8 @@ If you want to rebuild your own docker image (if you have changed the source cod ```bash docker build -t my_odm_image --no-cache . ``` -When building your own Docker image, if image size is of importance to you, you should use the ```--squash``` flag, like so: + +When building your own Docker image, if image size is of importance to you, you should use the `--squash` flag, like so: ```bash docker build --squash -t my_odm_image . @@ -188,86 +229,38 @@ docker build --squash -t my_odm_image . This will clean up intermediate steps in the Docker build process, resulting in a significantly smaller image (about half the size). -Experimental flags need to be enabled in Docker to use the ```--squash``` flag. To enable this, insert the following into the file `/etc/docker/daemon.json`: +Experimental flags need to be enabled in Docker to use the `--squash` flag. To enable this, insert the following into the file `/etc/docker/daemon.json`: ```json { - "experimental": true + "experimental": true } ``` After this, you must restart docker. -## Video Support - -Starting from version 3.0.4, ODM can automatically extract images from video files (.mp4, .mov, .lrv, .ts). Just place one or more video files into the `images` folder and run the program as usual. Subtitles files (.srt) with GPS information are also supported. Place .srt files in the `images` folder, making sure that the filenames match. For example, `my_video.mp4` ==> `my_video.srt` (case-sensitive). - -## Developers - -Help improve our software! We welcome contributions from everyone, whether to add new features, improve speed, fix existing bugs or add support for more cameras. Check our [code of conduct](https://github.com/OpenDroneMap/documents/blob/master/CONDUCT.md), the [contributing guidelines](https://github.com/OpenDroneMap/documents/blob/master/CONTRIBUTING.md) and [how decisions are made](https://github.com/OpenDroneMap/documents/blob/master/GOVERNANCE.md#how-decisions-are-made). - - -### Installation and first run -For Linux users, the easiest way to modify the software is to make sure docker is installed, clone the repository and then run from a shell: - -```bash -$ DATA=/path/to/datasets ./start-dev-env.sh -``` - -Where `/path/to/datasets` is a directory where you can place test datasets (it can also point to an empty directory if you don't have test datasets). - -Run configure to set up the required third party libraries: -```bash -(odmdev) [user:/code] master+* ± bash configure.sh reinstall -``` - -You can now make changes to the ODM source. When you are ready to test the changes you can simply invoke: - -```bash -(odmdev) [user:/code] master+* ± ./run.sh --project-path /datasets mydataset -``` -### Stop dev container -```bash - docker stop odmdev -``` -### To come back to dev environement -change your_username to your username -```bash -docker start odmdev -docker exec -ti odmdev bash -su your_username -``` - - If you have questions, join the developer's chat at https://community.opendronemap.org/c/developers-chat/21 1. Try to keep commits clean and simple 2. Submit a pull request with detailed changes and test results 3. Have fun! -### Troubleshooting -The dev environment makes use of `opendronemap/nodeodm` by default. You may want to run -`docker pull opendronemap/nodeodm` before running `./start-dev-env.sh` to avoid using an old cached version. - -In order to make a clean build, remove `~/.odm-dev-home` and `ODM/.setupdevenv`. - ## Credits ODM makes use of [several libraries](https://github.com/OpenDroneMap/ODM/blob/master/snap/snapcraft.yaml#L36) and other awesome open source projects to perform its tasks. Among them we'd like to highlight: - - [OpenSfM](https://github.com/mapillary/OpenSfM) - - [OpenMVS](https://github.com/cdcseacave/openMVS/) - - [PDAL](https://github.com/PDAL/PDAL) - - [Entwine](https://entwine.io/) - - [MVS Texturing](https://github.com/nmoehrle/mvs-texturing) - - [GRASS GIS](https://grass.osgeo.org/) - - [GDAL](https://gdal.org/) - - [PoissonRecon](https://github.com/mkazhdan/PoissonRecon) - +- [OpenSfM](https://github.com/mapillary/OpenSfM) +- [OpenMVS](https://github.com/cdcseacave/openMVS/) +- [PDAL](https://github.com/PDAL/PDAL) +- [Entwine](https://entwine.io/) +- [MVS Texturing](https://github.com/nmoehrle/mvs-texturing) +- [GRASS GIS](https://grass.osgeo.org/) +- [GDAL](https://gdal.org/) +- [PoissonRecon](https://github.com/mkazhdan/PoissonRecon) ## Citation -> *OpenDroneMap Authors* ODM - A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. **OpenDroneMap/ODM GitHub Page** 2020; [https://github.com/OpenDroneMap/ODM](https://github.com/OpenDroneMap/ODM) +> _OpenDroneMap Authors_ ODM - A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. **OpenDroneMap/ODM GitHub Page** 2020; [https://github.com/OpenDroneMap/ODM](https://github.com/OpenDroneMap/ODM) ## Trademark diff --git a/configure.sh b/configure.sh index 97eef8287..2428f316b 100755 --- a/configure.sh +++ b/configure.sh @@ -161,7 +161,7 @@ install() { echo "Compiling SuperBuild" cd ${RUNPATH}/SuperBuild mkdir -p build && cd build - cmake .. && make -j$processes + cmake .. && make -j$processes || exit 1 # Reset terminal state cd ${RUNPATH} From 3060f51f2620fb601344323474566ee5317b65cf Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 12 May 2026 09:04:56 +0100 Subject: [PATCH 7/9] Remove old dev files --- odm_docker_readme.txt | 25 -------- start-dev-env.sh | 145 ------------------------------------------ 2 files changed, 170 deletions(-) delete mode 100644 odm_docker_readme.txt delete mode 100755 start-dev-env.sh diff --git a/odm_docker_readme.txt b/odm_docker_readme.txt deleted file mode 100644 index b5f4a595f..000000000 --- a/odm_docker_readme.txt +++ /dev/null @@ -1,25 +0,0 @@ -#ODM 0.3.1 under Debian 8.10 jessie - 2018-02-27 by yjmenezes -#https://github.com/OpenDroneMap/OpenDroneMap/wiki/Docker -#git clone https://github.com/OpenDroneMap/OpenDroneMap.git -git clone https://github.com/yjmenezes/OpenDroneMap.git -cd OpenDroneMap -# list images -docker images -#remove old my_odm_image if necessary -docker rmi my_odm_image -#build a fresh one using instructions from ./Dockerfile -docker build -t my_odm_image . -#run tests with supplied image set. -#Mapped host directories for output. -v host_path:container_path -cd tests/test_data/ -sudo rm -r odm_* opensfm -docker run -it --rm \ - -v $(pwd)/gcp_list.txt:/code/gcp_list.txt \ - -v $(pwd)/images:/code/images \ - -v $(pwd)/opensfm:/code/opensfm \ - -v $(pwd)/odm_meshing:/code/odm_meshing \ - -v $(pwd)/odm_georeferencing:/code/odm_georeferencing \ - -v $(pwd)/odm_orthophoto:/code/odm_orthophoto \ - -v $(pwd)/odm_texturing:/code/odm_texturing \ - my_odm_image --mesh-size 100000 - diff --git a/start-dev-env.sh b/start-dev-env.sh deleted file mode 100755 index f90a417ff..000000000 --- a/start-dev-env.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/bin/bash -set -eo pipefail -__dirname=$(cd $(dirname "$0"); pwd -P) -cd "${__dirname}" - -if [ "$1" = "--setup" ]; then - export HOME=/home/$2 - - if [ ! -f .setupdevenv ]; then - echo "Recompiling environment... this might take a while." - bash configure.sh reinstall - - touch .setupdevenv - apt update && apt install -y vim git - chown -R $3:$4 /code - chown -R $3:$4 /var/www - fi - - echo "Adding $2 to /etc/passwd" - echo "$2:x:$3:$4::/home/$2:/bin/bash" >> /etc/passwd - echo "Adding $2 to /etc/group" - echo "$2:x:$4:" >> /etc/group - echo "Adding $2 to /etc/shadow" - echo "$2:x:14871::::::" >> /etc/shadow - echo "$2 ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - echo "odm ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers - echo "echo '' && echo '' && echo '' && echo '###################################' && echo 'ODM Dev Environment Ready. Hack on!' && echo '###################################' && echo '' && cd /code" > $HOME/.bashrc - - # Install qt creator - if hash qtcreator 2>/dev/null; then - has_qtcreator="YES" - fi - - if [ "$has_qtcreator" != "YES" ] && [ "$5" == "YES" ]; then - apt install -y libxrender1 gdb qtcreator - fi - - # Install liquidprompt - if [ ! -e "$HOME/liquidprompt" ]; then - git clone https://github.com/nojhan/liquidprompt.git --depth 1 $HOME/liquidprompt - fi - - if [ -e "$HOME/liquidprompt" ]; then - echo "source $HOME/liquidprompt/liquidprompt" >> $HOME/.bashrc - echo "export LP_PS1_PREFIX='(odmdev)'" >> $HOME/.bashrc - fi - - # Colors - echo "alias ls='ls --color=auto'" >> $HOME/.bashrc - - # Python paths - echo $(python3 /code/opendm/context.py) >> $HOME/.bashrc - - # Vim - printf "syntax on\nset showmatch\nset ts=4\nset sts=4\nset sw=4\nset autoindent\nset smartindent\nset smarttab\nset expandtab" > $HOME/.vimrc - - # Misc aliases - echo "alias pdal=/code/SuperBuild/install/bin/pdal" >> $HOME/.bashrc - echo "alias opensfm=/code/SuperBuild/install/bin/opensfm/bin/opensfm" >> $HOME/.bashrc - - - su -c bash $2 - exit 0 -fi - -platform="Linux" # Assumed -uname=$(uname) -case $uname in - "Darwin") - platform="MacOS" - ;; - MINGW*) - platform="Windows" - ;; -esac - -if [[ $platform != "Linux" && $platform != "MacOS" ]]; then - echo "This script only works on Linux and MacOS." - exit 1 -fi - -if hash docker 2>/dev/null; then - has_docker="YES" -fi -if hash nvidia-smi 2>/dev/null; then - has_nvidia_smi="YES" -fi - - -if [ "$has_docker" != "YES" ]; then - echo "You need to install docker before running this script." - exit 1 -fi - -IMAGE_SET=NO -if [[ ! -z $IMAGE ]]; then - IMAGE_SET=YES -fi -export PORT="${PORT:=3000}" -export QTC="${QTC:=NO}" -export IMAGE="${IMAGE:=opendronemap/nodeodm}" -export GPU="${GPU:=NO}" - -if [ -z "$DATA" ]; then - echo "Usage: DATA=/path/to/datasets [VARS] $0" - echo - echo "VARS:" - echo " DATA Path to directory that contains datasets for testing. The directory will be mounted in /datasets. If you don't have any, simply set it to a folder outside the ODM repository." - echo " PORT Port to expose for NodeODM (default: $PORT)" - echo " IMAGE Docker image to use (default: $IMAGE)" - echo " GPU Enable GPU support (default: $GPU)" - echo " QTC When set to YES, installs QT Creator for C++ development (default: $QTC)" - exit 1 -fi - - -echo "Starting development environment..." -echo "Datasets path: $DATA" -echo "Expose port: $PORT" -echo "QT Creator: $QTC" -echo "Image: $IMAGE" -echo "GPU: $GPU" - -if [ ! -e "$HOME"/.odm-dev-home ]; then - mkdir -p "$HOME"/.odm-dev-home -fi - -USER_ID=$(id -u) -GROUP_ID=$(id -g) -USER=$(id -un) -GPU_FLAGS="" -if [[ "$GPU" != "NO" ]]; then - if [[ "$IMAGE_SET" = "NO" ]]; then - IMAGE="$IMAGE:gpu" - fi - - GPU_FLAGS="--gpus all" - if [[ "$has_nvidia_smi" = "YES" ]]; then - GPU_FLAGS="$GPU_FLAGS --device /dev/nvidia0 --device /dev/nvidia-uvm --device /dev/nvidia-uvm-tools --device /dev/nvidia-modeset --device /dev/nvidiactl" - fi -fi - -xhost + || true -docker run -ti --entrypoint bash --name odmdev --user root -v $(pwd):/code -v "$DATA":/datasets -p $PORT:3000 $GPU_FLAGS --privileged -e DISPLAY -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -v="/tmp/.X11-unix:/tmp/.X11-unix:rw" -v="$HOME/.odm-dev-home:/home/$USER" $IMAGE -c "/code/start-dev-env.sh --setup $USER $USER_ID $GROUP_ID $QTC" -exit 0 From c6fdac91caa6ca6e34a614fb9af093dfae6bf536 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 12 May 2026 09:09:13 +0100 Subject: [PATCH 8/9] Cleanup PR --- .dockerignore | 48 +++++++++++++-------------- .github/workflows/test-build-prs.yaml | 4 +-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.dockerignore b/.dockerignore index c947a09a4..0886cf45e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,24 +1,24 @@ -Dockerfile -SuperBuild/build -SuperBuild/download -SuperBuild/install -SuperBuild/src -build -opensfm -odm_orthophoto -odm_texturing -odm_meshing -odm_georeferencing -images_resize -.git -venv - -/contrib -/docs -/hooks -/img -/license -settings.yml -code_of_conduct.md -configure_18_04.sh -index.html +Dockerfile +SuperBuild/build +SuperBuild/download +SuperBuild/install +SuperBuild/src +build +opensfm +odm_orthophoto +odm_texturing +odm_meshing +odm_georeferencing +images_resize +.git +venv + +/contrib +/docs +/hooks +/img +/license +settings.yml +code_of_conduct.md +configure_18_04.sh +index.html diff --git a/.github/workflows/test-build-prs.yaml b/.github/workflows/test-build-prs.yaml index 88bbe736c..4c14d3a0b 100644 --- a/.github/workflows/test-build-prs.yaml +++ b/.github/workflows/test-build-prs.yaml @@ -24,8 +24,8 @@ jobs: platforms: linux/amd64 push: false build-args: | - PORTABLE_INSTALL=true - + PORTABLE=YES + # snapcraft: # runs-on: ubuntu-latest # strategy: From 267b79823649c16cd17a1e9ffbcbf54ad60d468b Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 12 May 2026 09:29:45 +0100 Subject: [PATCH 9/9] Last bit of cleanup --- Dockerfile | 12 ++++++------ README.md | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 183c7419a..eba36fcb7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN if id "ubuntu" &>/dev/null; then \ RUN apt-get update -y && apt-get install -y \ python3 \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* WORKDIR /code @@ -49,11 +49,11 @@ ENV PATH="/code/venv/bin:$PATH" # Install shared libraries that we depend on via APT, but *not* # the -dev packages to save space! # Also run a smoke test on ODM and OpenSfM -RUN bash configure.sh installruntimedepsonly; \ - apt-get clean; \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \ - bash run.sh --help; \ - bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'" +RUN bash configure.sh installruntimedepsonly \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \ + && bash run.sh --help \ + && bash -c "eval $(python3 /code/opendm/context.py) && python3 -c 'from opensfm import io, pymap'" # Entry point ENTRYPOINT ["python3", "/code/run.py"] diff --git a/README.md b/README.md index 5229df47b..38b2dda04 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ You can use the following free and open source software to open the files genera - .laz (Compressed LAS): [CloudCompare](https://www.cloudcompare.org/) - .obj (Wavefront OBJ), .ply (Stanford Triangle Format): [MeshLab](http://www.meshlab.net/) -**Note!** Opening the .tif files generated by ODM in programs such as Photoshop or GIMP might not work (they are GeoTIFFs, not plain TIFFs). Use [QGIS](http://www.qgis.org/) instead. +> **Note:** Opening the .tif files generated by ODM in programs such as Photoshop or GIMP might not work (they are GeoTIFFs, not plain TIFFs). Use [QGIS](http://www.qgis.org/) instead. ## API @@ -132,7 +132,6 @@ You're in good shape! See https://github.com/NVIDIA/nvidia-docker and https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html#docker for information on docker/NVIDIA setup. - ## Video Support Starting from version 3.0.4, ODM can automatically extract images from video files (.mp4, .mov, .lrv, .ts). Just place one or more video files into the `images` folder and run the program as usual. Subtitles files (.srt) with GPS information are also supported. Place .srt files in the `images` folder, making sure that the filenames match. For example, `my_video.mp4` ==> `my_video.srt` (case-sensitive). @@ -146,6 +145,7 @@ Help improve our software! We welcome contributions from everyone, whether to ad For most users, the easiest way to modify the software is to use the [devcontainer](https://containers.dev/). Most IDE's natively support this format and will prompt to open the devcontainer whenever you open the repository. > **Note:** If your IDE doesn't support devcontainers, they can also be [run using a CLI](https://github.com/devcontainers/cli). +> > ```bash > devcontainer up > # And to connect @@ -168,7 +168,8 @@ The devcontainer mounts your home directory into the containers home directory a You can now make changes to the ODM source and rebuild to test out any changes. ## Advanced -## Native Install (Ubuntu 24.04) + +### Native Install (Ubuntu 24.04) You can run ODM natively on Ubuntu 24.04 (although we don't recommend it): @@ -180,7 +181,7 @@ bash configure.sh install You can then process datasets with `./run.sh /datasets/odm_data_aukerman` -## Native Install (MacOS) +### Native Install (MacOS) > **Warning:** Installation on Mac is currently unmaintained, and may not work out-of-the-box. See this [issue](https://community.opendronemap.org/t/odm-install-on-a-mac-os-14-6-1/25007/3).