[general]
name=Aerial LiDAR Classifier
qgisMinimumVersion=3.34
qgisMaximumVersion=4.99
description=Deep-learning semantic segmentation of aerial LiDAR point clouds with LitePT-L (default on NVIDIA GPUs) or the 3D SegFormer (GPU or CPU).
version=1.1.2
author=Abderrazzaq Kharroubi (GeoScITY Lab, University of Liege)
email=akharroubi2@gmail.com
license=GPL-3.0-or-later

about=Classifies aerial LiDAR point clouds (LAS / LAZ / COPC) into
    ground, vegetation, buildings, power lines and poles, written as
    standard ASPRS codes. Two deep-learning models: LitePT-L, a point
    transformer trained on DALES at 10 cm (default on NVIDIA GPUs), and
    the UrbanFiltering 3D SegFormer from NRCan's TreeAIBox (GPU or CPU).
    External dependencies: PyTorch, laspy, lazrs, timm, scipy and, on
    NVIDIA GPUs, spconv. A one-click setup installs them into a separate
    per-user folder on first use (no admin rights, nothing to
    configure), and the model weights download automatically. Files in
    feet are converted from their CRS; tiling and streaming handle files
    larger than RAM. Model weights are CC BY-NC 4.0. Documentation:
    https://github.com/akharroubi/AerialLidarClassifier
    The plugin author teaches a live cohort, LiDAR Point Clouds
    Processing in QGIS: https://maven.com/geomatics/qgis3d?utm_source=plugins.qgis.org&utm_medium=listing&utm_campaign=qgis3d

tracker=https://github.com/akharroubi/AerialLidarClassifier/issues
repository=https://github.com/akharroubi/AerialLidarClassifier
homepage=https://github.com/akharroubi/AerialLidarClassifier

tags=lidar,point cloud,classification,semantic segmentation,deep learning,litept,point transformer,segformer,machine learning,pytorch,asprs,las,laz,copc,aerial,dales,treeaibox

category=Analysis
icon=icon.png

experimental=False
deprecated=False
hasProcessingProvider=yes
server=False

changelog=
    1.1.2
        - Stable release: no longer marked experimental.
        - The dependency installer starts its helper programs (portable
          Python, uv, nvidia-smi) through Qt's QProcess.
        - Errors that are safe to ignore are now logged at debug level,
          and internal checks raise explicit errors. The plugin passes
          the plugins.qgis.org security scan with no configuration file.
        - Cancel during the dependency setup stops the running step at
          once on Windows.
    1.1.0
        - New default model on NVIDIA GPUs: LitePT-L, a point transformer
          trained on DALES at 10 cm (8 classes, test mIoU 0.824). The 3D
          SegFormer stays available and is the model on CPU and Apple
          Silicon. Model selector in the dock, MODEL parameter in
          Processing.
        - Model weights download automatically, during setup or on the
          first run of a model, and are SHA-256 verified before every use.
        - QGIS 4 support, tested on QGIS 4.2 (Qt 6) and 3.44 LTR,
          including the first-run setup. (GitHub #6)
        - Redesigned dock: model status with a one-click switch when a
          model cannot run on the computer, a hint saying what is missing
          before Run, and the elapsed time with an Open folder button
          when a run ends.
        - Safer output: results are written atomically, a batch can no
          longer overwrite one of its own inputs, every attribute, VLR and
          EVLR is kept, truncated files are refused instead of producing
          a shorter output, and a custom label field keeps the raw model
          classes (cars, trucks and fences stay distinct).
        - Installer: prebuilt packages only, certificate checks always
          on, no silent switch from GPU to CPU (a failed GPU setup offers
          a one-click CPU install), and Plugins > Aerial LiDAR Classifier
          > Repair dependencies. Existing environments are rebuilt once.
        - Units: vertical units from GeoTIFF vertical CRS codes;
          geographic (degree) files are refused even with a units
          override.
        - The algorithm is available from qgis_process (command line).
        - Optional link to the author's live LiDAR course in the panel,
          About and the plugin menu; it can be hidden.
    1.0.3
        - Fix: the plugin could not open on QGIS builds with Python
          3.9 to 3.11 (Ubuntu 22.04, Debian 12, macOS 3.34):
          "SyntaxError: unterminated string literal" in venv_manager.py.
          All files now compile on Python 3.9+. (GitHub #3)
        - Fix: files in feet (most US LiDAR) were fed to the model
          unconverted, so buildings came out as Wire-Conductor and
          Transmission Tower and the run was about 13x slower. The unit
          is now read from the LAS CRS and converted to metres for the
          model; a manual override exists in the dock (Advanced
          parameters > Input units) and in Processing (UNITS).
          (GitHub #5, #2)
        - Fix: flat tiles (less than 5.12 m of relief) were classified
          almost entirely as Building; the block grid now always covers
          the extent and unpredicted points are reported as ASPRS 0.
        - Fix: fresh installs could end up with a CPU-only torch because
          the second install phase let uv replace the CUDA torch with
          PyPI's newest release; the CUDA build is now pinned.
        - Fix: certificate verification for the package hosts is on by
          default; it is relaxed only after a TLS failure, with a warning.
        - Fix: a failed CUDA cascade could leave the venv without torch
          while it was reported ready.
        - Fix: Apple Silicon crashed at run time ("Torch not compiled
          with CUDA enabled"); the device is now passed end to end.
        - Fix: the Processing algorithm loaded the result layer from the
          worker thread; it is now loaded on completion, and the
          classified file is exposed as the OUTPUT_FILE output.
        - Fix: version shown in About and the Processing provider.
        - Fix: auto tile size on corridor-shaped extents; sliver tiles.
        - Streaming mode uses 1 byte per point for predictions instead
          of 4.
    1.0.2
        - Fix: Linux install failed at the venv pre-flight check with
          "error while loading shared libraries: libpython3.12.so.1.0:
          cannot open shared object file" on every distro that uses
          python-build-standalone (i.e. all of them). The
          `python -m venv --copies` flag copies the standalone python3
          binary into venv/bin/ but does NOT copy the libpython next
          to it (venv has no notion that python-build-standalone
          ships libpython as a separate file). After the copy, the
          binary's RPATH=$ORIGIN/../lib resolves to an empty
          venv/lib/ and every invocation dies. `--copies` was added
          to dodge Windows AV quarantine of the redirector launcher.
          It is now applied only on Windows; Linux and macOS use
          symlinks (the default), which point back at the standalone
          tree so the RPATH lookup still finds libpython.
        - Fix: "Use GPU" checkbox stayed unchecked across QGIS sessions
          after a fresh install. The dock's closeEvent persisted the
          checkbox state even when the GPU probe had forced it off
          (torch not yet importable, or CUDA wheel/driver mismatch
          during the cu128 -> cu118 cascade). The False stuck and left
          users silently on CPU on the next launch. The plugin now
          only persists the GPU preference when the user could
          actually choose it (i.e. the checkbox is enabled), and a
          one-time settings migration resets the stale False on first
          launch so existing v1.0.1 users get GPU back automatically.
        - Fix: streaming I/O no longer silently drops the trailing
          partial chunk on very large LAS files. v1.0.1 skipped the
          last few thousand points whenever laspy hit
          "buffer size must be a multiple of element size" at EOF.
          The chunk loop now uses read_points(n) directly and falls
          back to a raw-byte recovery path that decodes every
          whole-point-record left on disk, so the streaming output
          has the same point count as the input.
        - Polish: trimmed the long About text in the QGIS Plugin
          Manager so the rating widget is visible without scrolling.
    1.0.1
        - Fix: corporate SSL inspection blocking the install. uv now
          uses the OS native TLS (--native-tls) so Windows-installed
          corporate CAs are trusted, and download.pytorch.org is in
          the allow-insecure-host list alongside pypi.org and
          files.pythonhosted.org. Same flag added to the pip code path
          via --trusted-host.
        - Fix: Linux first-install failed at ensurepip step because
          python-build-standalone Linux tarballs do not ship the
          bundled pip wheel. The venv is now created with --without-pip
          (we use uv for all package installs anyway).
        - Fix: CUDA wheel selection now cascades through cu128 -> cu126
          -> cu124 -> cu121 -> cu118 instead of giving up at the first
          driver-version miss. Recovers GPU acceleration for NVIDIA
          drivers older than 550.
        - Fix: cap torch version per cuda index (cu118/cu121 -> torch
          <2.6, cu124 -> torch <2.8) so uv no longer picks the latest
          +cpu wheel from the cuda index instead of the latest +cuXXX.
        - Add: install marker recording the plugin version that built
          the venv. On version mismatch the Setup dock reopens with a
          one-click Reinstall that wipes the stale venv automatically.
        - Add: classification-coloured 3D renderer auto-attached to
          loaded layers so the 3D Map View renders points in 3D out of
          the box.
    1.0.0
        - Initial public release on the QGIS plugin repository
        - 3D SegFormer (UrbanFiltering, TreeAIBox / NRCan) integration
        - QGIS Processing algorithm + provider (Toolbox, Modeler, qgis_process CLI)
        - Isolated per-user venv dependency installer (PyTorch CPU /
          CUDA 12.1 / 12.4 / 12.6 / 12.8), compute-capability- and
          driver-version-aware wheel selection
        - Background QgsTask with progress and cancellation
        - LAS / LAZ / COPC input; LAS or LAZ output (matches input)
        - Spatial tiling and streaming I/O for files larger than RAM
        - Optional automatic loading of results as point-cloud layers
        - SHA-256 verification of downloaded model weights
        - Network calls go through QgsBlockingNetworkRequest (proxy /
          auth / certificates honoured per QGIS plugin guidelines)
