<div align="center">

# QPredict

### Deep learning inference for geospatial rasters in QGIS

<p>
  <img src="https://img.shields.io/badge/QGIS-3.40%20LTE-589632?style=for-the-badge&logo=qgis&logoColor=white" alt="QGIS"/>
  <img src="https://img.shields.io/badge/Python-3.10+-3776AB?style=for-the-badge&logo=python&logoColor=white" alt="Python"/>
  <img src="https://img.shields.io/badge/PyTorch-2.0+-EE4C2C?style=for-the-badge&logo=pytorch&logoColor=white" alt="PyTorch"/>
  <img src="https://img.shields.io/badge/Release-0.9.0-blue?style=for-the-badge" alt="Release"/>
  <img src="https://img.shields.io/badge/License-GPLv2+-green?style=for-the-badge" alt="License"/>
</p>

<p>
  <a href="https://qgeoai.nextelia.fr">📚 Documentation</a> •
  <a href="https://github.com/nextelia/qgeoai_server">🖥️ Server</a>
</p>

<img src="assets/images/logo.png" alt="QPredict" width="1024"/>

---

**Apply trained models to raster data with professional-grade inference**

</div>

## Key Features

<div align="center">
<table>
<tr>
<td width="50%">

**Versatile Inference**
- Semantic segmentation (class rasters, reliability maps, vectors)
- Instance segmentation (vector polygons)
- Object detection (YOLO11, YOLO11-obb)
- YOLO segmentation (YOLO11-seg)

</td>
<td width="50%">

**Professional Pipeline**
- Tiled inference with overlap
- Memory-efficient processing
- Professional vectorization
- Multiple output formats
- Automatic layer styling

</td>
</tr>
</table>
</div>

## Interface

<div align="center">
<img src="assets/images/qp_ui.png" alt="QPredict ui" width="1024"/>
</div>

## Quick Start

### Prerequisites

- **QGIS 3.40 LTE** or higher
- **[QGeoAI Server](https://github.com/nextelia/qgeoai_server)** (required for inference)
- **CUDA-capable GPU** (recommended) or CPU
- **Trained models** in .qmtp format (from QModel Trainer)

### Installation

1. Download the plugin from [Releases](../../releases) or clone this repository
2. Copy `qpredict/` to your QGIS plugins directory:
```bash
   # Windows
   %APPDATA%\QGIS\QGIS3\profiles\default\python\plugins\
   
   # Linux
   ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/
   
   # macOS
   ~/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/
```
3. Restart QGIS and enable the plugin via `Plugins` → `Manage and Install Plugins`

**Full documentation**: [qgeoai.nextelia.fr](https://qgeoai.nextelia.fr)

## Workflow

1. **Load model** (.qmtp file from QModel Trainer)
2. **Select raster** and processing extent (full/viewport/selection)
3. **Configure tiling** (tile size, overlap, padding, batch size)
4. **Choose output format** (raster or vector)
5. **Run inference** with real-time progress monitoring

## Output Formats

**Class Raster** | 8-bit raster with class IDs | Standard classification output |
**Prediction Reliability** | Confidence/uncertainty maps | Quality assessment, uncertainty analysis |
**Vector Layer** | Professional polygons with attributes | GIS workflows, spatial analysis |

## Advanced Features

### Tiling System
- Configurable tile size and overlap
- Edge padding to reduce artifacts
- Batch processing for GPU efficiency
- Seamless output reconstruction

### Professional Vectorization
- Topology-aware polygonization
- Morphological cleaning
- Douglas-Peucker simplification
- Chaikin smoothing for organic shapes
- Automatic attribute enrichment

## Why QPredict?

- ✅ **No-code inference**: User-friendly interface, no Python scripting
- ✅ **Production-ready**: Memory-efficient tiling, GPU acceleration
- ✅ **Geospatial native**: CRS preservation, geotransform handling
- ✅ **Quality outputs**: Professional vectorization pipeline
- ✅ **Open source**: GPLv2+ license, fully auditable

## Support & Contribution

### Community Support

**Documentation**: [qgeoai.nextelia.fr](https://qgeoai.nextelia.fr)

### Professional Support

For operational support, custom integrations, or training:

- **Email**: [hello@nextelia.fr](mailto:hello@nextelia.fr)
- **Website**: [nextelia.fr](https://www.nextelia.fr)

The suite is free and open-source. Professional services ensure sustainable development.

### Contributing

This project is developed as an open, production-grade GeoAI platform for QGIS.

We welcome:
- Bug reports with reproducible steps
- Documentation improvements
- Real-world feedback

For larger changes, new features or architectural modifications, please open an issue first to discuss alignment with the project roadmap.

The roadmap is maintained by the core team to ensure long-term stability, consistency and production readiness.

---

<div align="center">

**Part of [QGeoAI Tools](https://qgeoai.nextelia.fr)** suite

**Copyright** © 2026 Nextelia® • **Version** 0.9.0 • **Updated** January 15, 2026

</div>