Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/build_vcpkg_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5

- name: Set up vcpkg
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 2880
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
timeout-minutes: 2880
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/publish-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.12.10'
python-version-file: "pyproject.toml"
architecture: 'x64'
- uses: Jimver/cuda-toolkit@v0.2.24
id: cuda-toolkit
Expand All @@ -32,12 +32,13 @@ jobs:
with:
fileName: 'comodo.pfx'
encodedString: ${{ secrets.CODE_SIGNING_CERT }}
- name: Install venv
run: |
python -m pip install virtualenv
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.5"
- name: Build sources
run: |
python configure.py build
uv run configure.py build
- name: Free up space
run: |
rmdir SuperBuild\download /s /q
Expand All @@ -47,7 +48,7 @@ jobs:
env:
CODE_SIGN_CERT_PATH: ${{ steps.code_sign.outputs.filePath }}
run: |
python configure.py dist --code-sign-cert-path $env:CODE_SIGN_CERT_PATH
uv run configure.py dist --code-sign-cert-path $env:CODE_SIGN_CERT_PATH
- name: Upload Setup File
uses: actions/upload-artifact@v4
with:
Expand All @@ -62,4 +63,3 @@ jobs:
file_glob: true
tag: ${{ github.ref }}
overwrite: true

21 changes: 11 additions & 10 deletions .github/workflows/test-build-prs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
Expand All @@ -32,7 +32,7 @@ jobs:
# - amd64
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# uses: actions/checkout@v5
# - name: Set Swap Space
# uses: pierotofy/set-swap-space@master
# with:
Expand All @@ -52,11 +52,11 @@ jobs:
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.12.10'
python-version-file: "pyproject.toml"
architecture: 'x64'
- uses: Jimver/cuda-toolkit@v0.2.24
id: cuda-toolkit
Expand All @@ -66,20 +66,21 @@ jobs:
uses: jwlawson/actions-setup-cmake@v1.13
with:
cmake-version: '3.24.x'
- name: Install venv
run: |
python -m pip install virtualenv
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.9.5"
- name: Build sources
run: |
python configure.py build
uv run configure.py build
- name: Free up space
run: |
rmdir SuperBuild\download /s /q
rmdir SuperBuild\build /s /q
shell: cmd
- name: Create setup
run: |
python configure.py dist
uv run configure.py dist
- name: Upload Setup File
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ LAStools.zip
pcl.tar.gz
ceres-solver.tar.gz
*.pyc
.python-version
opencv.zip
settings.yaml
.setupdevenv
Expand Down
15 changes: 3 additions & 12 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import shutil
import zipfile

from venv import EnvBuilder

parser = argparse.ArgumentParser(description='ODM Windows Configure Script')
parser.add_argument('action',
type=str,
Expand Down Expand Up @@ -62,15 +60,8 @@ def vcpkg_requirements():
return pckgs

def build():
# Create python virtual env
if not os.path.isdir("venv"):
print("Creating virtual env --> venv/")
ebuilder = EnvBuilder(with_pip=True)
ebuilder.create("venv")

run("pip install setuptools")
run("venv\\Scripts\\pip install --ignore-installed -r requirements.txt")

run("uv sync")

# Download / build VCPKG environment
if not os.path.isdir("vcpkg"):
if args.build_vcpkg:
Expand Down Expand Up @@ -129,7 +120,7 @@ def safe_remove(path):
def clean():
safe_remove("vcpkg-download.zip")
safe_remove("vcpkg")
safe_remove("venv")
safe_remove(".venv")
safe_remove(os.path.join("SuperBuild", "build"))
safe_remove(os.path.join("SuperBuild", "download"))
safe_remove(os.path.join("SuperBuild", "src"))
Expand Down
44 changes: 22 additions & 22 deletions configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ ensure_prereqs() {
sudo $APT_GET install -y -qq --no-install-recommends pkg-config
fi

if ! command -v curl &> /dev/null; then
echo "Installing curl"
sudo $APT_GET install -y -qq --no-install-recommends curl
fi

echo "Installing tzdata"
sudo $APT_GET install -y -qq tzdata

Expand All @@ -62,14 +67,11 @@ ensure_prereqs() {
sudo $APT_GET update
fi

echo "Installing Python PIP"
sudo $APT_GET install -y -qq --no-install-recommends \
python3-pip \
python3-setuptools \
python3-venv
python3 -m venv venv --system-site-packages
venv/bin/pip3 install -U pip
venv/bin/pip3 install -U shyaml
echo "Installing Python UV"
curl -LsSf https://astral.sh/uv/0.9.5/install.sh | sh

echo "Syncing Python dependencies"
uv sync
}

# Save all dependencies in snapcraft.yaml to maintain a single source of truth.
Expand All @@ -82,17 +84,18 @@ installdepsfromsnapcraft() {
*) key=build-packages; ;; # shouldn't be needed, but it's here just in case
esac

UBUNTU_VERSION=$(lsb_release -r)
SNAPCRAFT_FILE="snapcraft.yaml"
if [[ "$UBUNTU_VERSION" == *"21.04"* ]]; then
SNAPCRAFT_FILE="snapcraft21.yaml"
elif [[ "$UBUNTU_VERSION" == *"24.04"* ]]; then
SNAPCRAFT_FILE="snapcraft24.yaml"
fi
echo "Installing dependencies from snap/$SNAPCRAFT_FILE ($section.$key)"

uv run python - "$section" "$key" "snap/$SNAPCRAFT_FILE" <<'PYCODE' | \
xargs sudo $APT_GET install -y -qq --no-install-recommends
import sys, yaml

cat snap/$SNAPCRAFT_FILE | \
venv/bin/shyaml get-values-0 parts.$section.$key | \
xargs -0 sudo $APT_GET install -y -qq --no-install-recommends
section, key, snapfile = sys.argv[1:]
with open(snapfile, 'r') as f:
data = yaml.safe_load(f)
for pkg in data.get('parts', {}).get(section, {}).get(key, []):
print(pkg)
PYCODE
}

installruntimedepsonly() {
Expand Down Expand Up @@ -133,10 +136,7 @@ installreqs() {
set -e

# edt requires numpy to build
venv/bin/pip install numpy==2.3.2
venv/bin/pip install -r requirements.txt --ignore-installed
#if [ ! -z "$GPU_INSTALL" ]; then
#fi
uv pip install numpy==2.3.2
set +e
}

Expand Down
36 changes: 15 additions & 21 deletions configure_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,10 @@ ensure_prereqs() {
installreqs() {
ensure_prereqs

brew install cmake gcc@12 python@3.12 tbb@2020 eigen gdal boost cgal libomp
brew install cmake gcc@12 python@3.12 tbb@2020 eigen gdal boost cgal libomp uv
brew link tbb@2020

python3.12 -m pip install virtualenv

if [ ! -e ${RUNPATH}/venv ]; then
python3.12 -m virtualenv venv
fi

source venv/bin/activate
pip install --ignore-installed -r requirements.txt
uv sync
}

install() {
Expand All @@ -55,18 +48,19 @@ install() {
mkdir -p build && cd build
cmake .. && make -j$processes

cd /tmp
pip download GDAL==3.11.1
tar -xpzf GDAL-3.11.1.tar.gz
cd GDAL-3.11.1
if [ -e /opt/homebrew/bin/gdal-config ]; then
python setup.py build_ext --gdal-config /opt/homebrew/bin/gdal-config
else
python setup.py build_ext --gdal-config /usr/local/bin/gdal-config
fi
python setup.py build
python setup.py install
rm -fr /tmp/GDAL-3.11.1 /tmp/GDAL-3.11.1.tar.gz
# TODO check if we actually need this, when using uv / Mac?
# cd /tmp
# pip download GDAL==3.11.1
# tar -xpzf GDAL-3.11.1.tar.gz
# cd GDAL-3.11.1
# if [ -e /opt/homebrew/bin/gdal-config ]; then
# python setup.py build_ext --gdal-config /opt/homebrew/bin/gdal-config
# else
# python setup.py build_ext --gdal-config /usr/local/bin/gdal-config
# fi
# python setup.py build
# python setup.py install
# rm -fr /tmp/GDAL-3.11.1 /tmp/GDAL-3.11.1.tar.gz

cd ${RUNPATH}

Expand Down
8 changes: 4 additions & 4 deletions contrib/resize/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ Resizes images, keeps Exif data. The EXIF width and height attributes will be up
Usage:

```
pip install -r requirements.txt
python3 resize.py -i images/ -o resized/ 25%
python3 resize.py -i images/1.JPG -o resized.JPG 25%
python3 resize.py -i gcp_list.txt -o resized_gcp_list.txt
uv sync --group resize
uv run resize.py -i images/ -o resized/ 25%
uv run resize.py -i images/1.JPG -o resized.JPG 25%
uv run resize.py -i gcp_list.txt -o resized_gcp_list.txt
```

Originally forked from https://github.com/pierotofy/exifimageresize
2 changes: 0 additions & 2 deletions contrib/resize/requirements.txt

This file was deleted.

5 changes: 4 additions & 1 deletion contrib/resize/resize.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import multiprocessing
from multiprocessing.pool import ThreadPool
import sys
sys.path.append("../../")
from pathlib import Path
# Add project root to sys.path dynamically
REPO_ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(REPO_ROOT))
from opendm.gcp import GCPFile

parser = argparse.ArgumentParser(description='Exif Image Resize')
Expand Down
1 change: 0 additions & 1 deletion opendm/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

# add opencv,opensfm to python path
python_packages_paths = [os.path.join(superbuild_path, p) for p in [
'install/lib/python3.12/dist-packages',
'install/lib/python3.12/dist-packages',
'install/lib/python3/dist-packages',
'install/bin/opensfm',
Expand Down
Loading
Loading