Skip to content

Add macOS installation guide, pinned dependencies and CLI test script - #126

Open
EnricoTalpa wants to merge 1 commit into
agisoft-llc:masterfrom
EnricoTalpa:master
Open

Add macOS installation guide, pinned dependencies and CLI test script#126
EnricoTalpa wants to merge 1 commit into
agisoft-llc:masterfrom
EnricoTalpa:master

Conversation

@EnricoTalpa

Copy link
Copy Markdown

Summary

This PR contributes macOS-specific installation documentation, a pinned requirements file and a CLI test script for verifying the full dependency stack with Metashape's internal Python.

Changes

README.md

Added a complete macOS installation procedure (6 steps) below the existing upstream content:

  1. Clone the repository
  2. Copy scripts to Metashape's auto-load folder
  3. Xcode SDK symlink workaround (required when only Command Line Tools are installed — Metashape's Python 3.12 was compiled against MacOSX11.1.sdk which no longer ships with CLT)
  4. Install Python dependencies into Metashape's isolated user-packages-py312 environment
  5. Patch detect_objects.py to replace CUDA-only torch wheels with CPU-compatible ones
  6. Verification steps (terminal test + GUI menu item)

Includes a compatibility table and installed file structure map.

mac_requirements.txt

Pinned requirements file for macOS Intel covering all scripts except detect_objects.py:

  • numpy==1.26.4, onnxruntime==1.18.1, opencv-python==4.10.0.84, Pillow==10.3.0
  • open3d==0.19.0, scipy==1.12.0 and their full pinned dependency set
  • rasterio==1.4.3 (bundles GDAL 3.9.3, no system GDAL required)

test_libraries.py

CLI test script (13 tests) runnable with Metashape's internal Python without launching the GUI:

PYTHONUSERBASE="$HOME/Library/Application Support/Agisoft/Metashape Pro/user-packages-py312" \
/Applications/MetashapePro.app/Contents/Frameworks/Python.framework/Versions/3.12/bin/python3.12 \
test_libraries.py

Covers: numpy, Pillow, opencv, scipy, onnxruntime, rasterio, open3d, torch, torchvision, albumentations, pytorch-lightning, deepforest, faster-coco-eval.

Tested on

  • macOS · Intel Core i7 (x86_64)
  • Metashape Professional 2.3.1 (build 22580)
  • Python 3.12.12 (Metashape internal)
  • All 13/13 tests pass

Notes on detect_objects.py and macOS

The upstream script pins torch==2.7.0+cu128 which does not exist for macOS (PyTorch dropped Intel macOS support after 2.2.x). The README documents the required patch to torch==2.2.2 (CPU). The script's existing CPU fallback logic (line 552: "Using CPU (will be very slow)...") works correctly without any further changes.

- README.md: complete macOS installation guide (6 steps) with
  compatibility notes, expected test output and file structure map
- mac_requirements.txt: pinned Python dependencies compatible with
  macOS Intel (numpy, onnxruntime, opencv, Pillow, open3d, scipy,
  rasterio and full open3d dependency set)
- test_libraries.py: CLI test script (13 tests) verifying all
  installed libraries with the Metashape internal Python 3.12

Tested on Metashape Professional 2.3.1 (macOS Intel x86_64).
All 13/13 tests pass including torch 2.2.2 CPU and deepforest 2.0.0.

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant