[general]
name=Bambi - QGIS Integration
qgisMinimumVersion=3.22
description=Detect and track wildlife in drone videos/photos with geo-referencing
version=8.0.0
author=Christoph Praschl, Anna Maschek, David C.Schedl
email=christoph.praschl@fh-hagenberg.at

about=A comprehensive QGIS plugin for detecting, tracking, and geo-referencing wildlife in aerial drone recordings (videos or still photos) from DJI Enterprise drones with thermal and/or RGB cameras.
    Features include:
    - Frame extraction and undistortion from drone videos (SRT timestamps) or photo collections (EXIF)
    - Animal detection using YOLO models (auto-downloaded from HuggingFace)
    - Multi-object tracking with built-in, BoxMOT, or geo-referenced backends; import of pre-computed TRex tracklets
    - Demographic classification of tracked animals: cross-modal RGB/thermal track matching, DINOv3 features, occlusion/species/sex classifiers aggregated per animal by vote, and a size-based juvenile flag (requires a Hugging Face token for the gated DINOv3 model)
    - Segmentation tool: SAM3 / SAM 3.1 on the extracted frames by text or clicked point prompts, per frame or tracked across a sequence, through the Roboflow API, transformers, or Meta's sam3 package; masks geo-referenced, added as layers and exported as GeoJSON
    - Geo-referencing of detections, tracks, and SAM3 segmentations onto a DEM (real-world UTM coordinates)
    - Flight route visualization and perpendicular distance sampling for transect-based surveys
    - Survey analytics over several flights at once: census summary (counts, densities and sex/age breakdown per species and flight), track inventory, kernel-density heatmaps, coverage maps, line-transect distance-sampling density/abundance estimation (from detections or tracks), and transect-based population estimation (naive, bootstrap, zero-inflated negative binomial)
    - Survey plot and exclusion zones drawn or imported in QGIS, limiting every survey analytic to the census area
    - Per-frame camera field-of-view footprints and coverage areas
    - Georeferenced map products: per-frame GeoTIFFs, true orthomosaics, and ALFS light-field mosaics
    - DEM import: automatic download (Austria), GeoTIFF conversion, or flat surface meshes for aquatic surveys
    - Calibration wizards for camera intrinsics (single-camera SfM, stereo RGB+thermal) and per-flight pose corrections
    - Companion tools: result video creator, radiometric thermal image viewer (DJI Thermal SDK), randomized transect flight planner, and interactive map-canvas inspectors
    - Key-frame based labelling tool: review detections/tracks on extracted frames (thermal or RGB), draw and edit track bounding boxes with species/sex/age/occlusion classes, interpolate between key frames, and propagate boxes of one or several tracks across frames via DEM geo-referencing
    - Transect splitting tool: split a flight into named transects (frame ranges) on the extracted frames, with a flight-route overview map, flight-path length measurement and an "end after X metres" helper
    - Results stored in GeoPackages that carry their own meaning: every detection has an id the later steps refer to, user-defined fields travel through the whole pipeline, and each step records what it produced and what it invalidated
    - Export to COCO, YOLO, MOT, TRex tracklets, GeoJSON (animals or segmentations), Camtrap DP and Darwin Core Archive (GBIF publishing)
    - Several flights per QGIS project, each with its own target folder, configuration and layer group, analysed together as one survey
    - Built-in dependency manager to install all required and optional packages from within QGIS
    All results are automatically added as styled layers to the QGIS project, grouped per flight.

changelog=Version 8.0.0
    The Survey Analytics tab is reworked around surveys rather than flights. A census covers an area, often flown in several flights or on several days, and its numbers should be reported for that area - so the survey tools no longer follow the flight selected on the processing tabs, and the census area itself can now be drawn in QGIS.
    Changed (breaking):
    - Survey Analytics: a new Survey box at the top of the tab lists the project's flights with a tick each, a camera selector and a survey folder. Every survey tool - census summary, track inventory, density heatmap, coverage map, distance sampling and population estimation - runs on all ticked flights at once, independent of the active flight. The "Projects" lists with their "Add Folder / Add Flight / Add current project" buttons on distance sampling and population estimation are gone, and so are the separate camera selectors of the coverage map, the track inventory and the population estimation. A flight brings its own CRS and DEM from its stored configuration, so adding one to a population estimate no longer asks for its dem.json. Flights in different target CRSs cannot be pooled and are refused with a message naming them.
    - Survey results are written to the survey folder (analytics_t / analytics_w; default: bambi_survey next to the QGIS project) instead of the active flight's target folder, and survey layers go into a "BAMBI Survey" layer group. The track inventory additionally keeps a per-flight copy in each flight's analytics folder (the inspector reads it), and the population estimation still writes each flight's transect tables and areas into that flight's folder, from where "Add Transect Areas to QGIS" loads them into the flight's own group. Results of earlier versions stay where they are and are not moved.
    - Survey Analytics: species are chosen by name across the ticked flights, since species ids are assigned per flight. A species a flight does not know simply contributes nothing from that flight. The species filter no longer applies to 'Calculate Perpendicular' / 'Calculate Track Perpendicular' on the Processing tab; the distance sampling and population estimation filter the distances by species themselves.
    - The flight selection, camera and survey folder are saved in the QGIS project.
    Added:
    - Survey Area (Survey Analytics tab): a census plot and exclusion zones (e.g. thick forest cover, with a reason), drawn with the normal QGIS digitising tools ("Draw Plot", "Draw Exclusion Zone") or imported from any polygon layer in the project - a shapefile, KML or GeoJSON of the hunting district, reprojected on the way in. Stored in the survey folder as survey_area/survey_area.gpkg. With "Limit analytics to the survey area" ticked, every survey tool counts only animals inside the plot and outside the exclusions, and uses only that ground: the density heatmap is blank outside it and reports animals per hectare of the plot; the coverage map is clipped and reports the share of the plot the flights covered; distance sampling drops observations outside, counts only the flight route inside as effort, and adds an abundance for the survey area; the population estimation clips every transect's monitored area to the plot and offers the plot as the study area ("Use survey area"). Each result records the plot, the exclusions and what they removed.
    - Census Summary (Survey Analytics tab): counts per species and flight, with "All species" and "All flights" totals - counted, inside the survey area, outside, without a position, approved - and animals per km² on two bases: the survey plot minus its exclusions (one census of the plot), and the ground the frames actually covered inside it (survey effort, right for repeat flights too). The sex and age breakdown is listed per row. Counts tracks (one per animal) or detections (every box, for still-photo surveys without tracking). Written as census_summary_tracks/detections.csv and .json and shown in a table that copies straight into a spreadsheet.
    - Track inventory, report and QGIS layer carry a "flight" column when several flights are surveyed; approving a track or opening it in the inspector acts on the right flight.

tracker=https://github.com/bambi-eco/Bambi-QGIS/issues
repository=https://github.com/bambi-eco/Bambi-QGIS
tags=wildlife,detection,tracking,drone,thermal,YOLO,geo-referencing

homepage=https://github.com/bambi-eco/Bambi-QGIS
category=Analysis
icon=icons/icon.png
experimental=True
deprecated=False
