Skip to content

v2.1.1

Latest

Choose a tag to compare

@PatBall1 PatBall1 released this 16 Oct 09:21
· 8 commits to master since this release

v2.1.1 – Docs overhaul, multispectral + predict/outputs upgrades, CI refresh

Compare: v2.0.1...v2.1.1
Stats: 53 commits · 40 files · +2,918 / −2,126 LOC

Highlights

  • Multispectral support in prediction/training: predict.py now reads .tif stacks via rasterio and handles H×W×C ordering; training docs cover MS workflows.
  • Smarter crown de-overlap (clean_crowns): rewritten around spatial join + union-find clustering; more robust, faster on big scenes.
  • Docs: major restructure: new tutorial series, API reference, and an HPC/cluster guide; docs build is more reliable via mocked heavy deps.
  • CI refresh: runners moved to Ubuntu 22.04, pin/upgrade key pieces (GDAL in CI, NumPy bound for tests), and a cleaner Sphinx workflow with gh-pages deploy.
  • Dependency modernisation: shapely ≥2, geopandas/rasterio/fiona ranges updated; stale geospatial deps removed.

New / Improved

Models & pipeline

  • predict.py

    • Accepts .png (RGB via OpenCV) and .tif (multispectral via rasterio).
    • Safer filename handling and JSON output naming.
    • Clearer logging and mode detection via get_filenames(...).
  • outputs.py

    • New clean_crowns algorithm:

      • bbox-based spatial join to find candidates;
      • union-find to cluster overlaps by IoU;
      • keep best per cluster by field (default Confidence_score);
      • filters invalid/empty geometry; configurable area_threshold (now default 2 m²).
  • evaluation.py

    • More robust geometry ops:

      • handles GEOSException, uses make_valid fallback;
      • consistent union_area/IoU computation;
      • safer handling of test/pred file naming.
  • train.py

    • Large update (see docs): clarified config path, support surfaced for MS training, early-stopping usage, and advanced options captured in docs.

Documentation

  • Restructure

    • New docs/source/tutorials/ series:

      • 01_getting_started, 02_data_preparation, 03_training_and_evaluation,
      • 04_prediction, 05_advanced_topics.
    • API reference via sphinx-apidoc (docs/source/api.rst).

    • Cluster/HPC guide with CSD3 examples and GPU setup (cluster.rst).

  • Build reliability

    • conf.py: add repo root to sys.path; mock heavy deps (torch, detectron2, rasterio, geopandas, shapely, etc.) so docs build without native libs.
    • release string set to 2.1.1.
    • docs/requirements.txt added.
  • Model garden

    • Updated Zenodo links; added notes for 230717_base, 230729_05dates, and 250312_flexi; example wget commands updated.

Continuous Integration

  • python-ci.yml

    • Runner: ubuntu-22.04.
    • GDAL in CI from 3.6.4; explicit numpy>=1.20,<2.0 for tests; add pytest-order.
    • Keep flake8 erroring on syntax/undefined names; soften general run with --exit-zero for metrics only.
  • sphinx-ci.yml

    • Renamed to “Sphinx Documentation”; runner ubuntu-22.04.
    • Streamlined: setup-python@v4, build, upload artifact (v4), and deploy to GitHub Pages on master.

Repo/Meta

  • .gitattributes: make *.py detectable, ignore notebooks for linguist.
  • New dark/light logos updated.
  • README: contributors updated (incl. Christopher Kotthoff).

Removals / Potentially Breaking

  • Removed data loaders:

    • detectree2/data_loading/gdrive.py
    • gdrivePull.sh
    • gee_download.py
    • quickstart.py

    If you relied on these, migrate to your own fetch scripts or keep them pinned at ≤ v2.0.1.

  • Docs cleanup: legacy tutorial.rst and tutorial_multi.rst removed (replaced by new tutorial set).

Dependency changes (setup.py)

  • Now requires

    • shapely>=2.0, geopandas>=0.13,
    • rasterio>=1.2,<1.4, fiona>=1.8,<1.10,
    • numpy>=1.20, pandas>=1.3, opencv-python>=4.5, tqdm>=4.60, pycocotools>=2.0.4,
    • detectron2 from GitHub.
  • Removed: proj, geos, pygeos, pypng, pycrs, descartes, hard-pinned prerelease rasterio, etc.

Tests

  • tests/test_preprocessing.py: updated expected ybox_coords (reflects tiling math tweak).

Upgrade notes

  • If your environment is older (e.g., shapely <2), create a fresh venv and reinstall.
  • For MS .tif predictions, ensure rasterio can open your imagery and that channel order matches expectations.
  • The new clean_crowns defaults are stricter (area_threshold=2). If you need tiny crowns, lower that or post-filter by Confidence_score.

Contributors

Thanks to everyone who pushed on CI, docs, MS support, and the crown cleaning logic. Also updated contributor credits in README.

What's Changed

New Contributors

Full Changelog: v2.0.1...v2.1.1