Installation¶
OBIA requires Python 3.11 or newer. The core installation includes the dependencies for loading rasters, creating objects, extracting features, and training classifiers, including XGBoost.
Install a release¶
1 | |
Verify the install:
1 | |
Install from source¶
This documentation follows the repository's main branch. To use the same code
as the guides and notebooks, install from a checkout:
1 2 3 | |
The -e option makes this an editable installation: changes in the checkout are
available without reinstalling the package.
Run the notebooks¶
From the repository root, install the notebook dependencies and launch JupyterLab:
1 2 | |
Open a notebook under docs/examples/. See the
notebook guide for kernel setup and the available workflows.
Optional dependencies¶
Install an extra for the workflow you need. In an editable source installation,
replace obia[extra] with -e ".[extra]" in these commands.
| Extra | Install command | Purpose |
|---|---|---|
| SHAP | python -m pip install "obia[explain]" |
Feature-attribution explanations |
| Documentation | python -m pip install "obia[docs]" |
Build and preview these docs |
| Detection | python -m pip install "obia[detection]" |
Experimental bounding-box detection |
SHAP requires version 0.51 or newer. Point-cloud file readers also need system libraries, so follow the setup below if you plan to use them.
Point-cloud support¶
For LAS/LAZ files, install PDAL in a conda environment, then install OBIA with
pip in that environment. In-memory point arrays and tables do not need these
file-reading dependencies.
1 2 3 | |
This gives OBIA access to the conda-forge PDAL Python bindings for LAS/LAZ reading.
If you also want the optional pyforestscan reader, install the point-cloud extra after activating the same environment:
1 | |
Docker¶
Build the image from the repository root:
1 | |
Release images are published to Docker Hub as iosefa/obia:
1 | |
The Docker image includes OBIA, PDAL, the PDAL Python bindings, and pyforestscan.
Start a Python session in the downloaded image:
1 | |
Mount a local data directory when working with rasters, vectors, or point clouds:
1 2 3 | |
If you built the image locally with docker build -t obia ., use obia as the
image name instead.
Development environment¶
For local development, clone the repository and create the conda environment:
1 2 3 4 | |
The environment installs OBIA in editable mode and includes the notebook, documentation, point-cloud, detection, explanation, XGBoost, and test dependencies used during development.
For a smaller development setup, install documentation and test dependencies into your own Python environment from the repository root:
1 | |
Preview the documentation¶
Run the local documentation server from the repository root:
1 | |
Open http://127.0.0.1:8000 in a browser. If that port is already in use, choose another port:
1 | |
To build the static site:
1 | |
The generated HTML is written to site/.