A fast, easy to use, lightweight Python library for AI object detection in geospatial rasters (GeoTIFFs), with pre-built models included.
pip install -U geodeepgeodeep [geotiff] [model ID or path to ONNX model]Example:
geodeep orthophoto.tif carsHere GeoDeep will find cars in the orthophoto and write the result as a GeoJSON file containing the bounding boxes, confidence scores and class labels.
A list of up-to-date model IDs can be retrieved via:
geodeep --list-modelsSee also geodeep --help.
from geodeep import detect
bboxes, scores, classes = detect('orthophoto.tif', 'cars')
print(bboxes) # <-- [[x_min, y_min, x_max, y_max], [...]]
print(scores) # <-- [score, ...]
print(classes) # <-- [(id: int, label: str), ...]
geojson = detect('orthophoto.tif', 'cars', output_type="geojson")Models by default will be cached in ~/.cache/geodeep. You can change that with:
from geodeep import models
models.cache_dir = "your/cache/path"| Model | Description | Resolution (cm/px) | Experimental |
|---|---|---|---|
| cars | YOLOv7-m model for cars detection on aerial images. Based on ITCVD. | 10 | |
| trees | Retinanet tree crown detection model from DeepForest | 10 | |
| birds | Retinanet bird detection model from DeepForest | 2 | ✔️ |
| trees_yolov7 | YOLOv9 model for treetops detection on aerial images. Model is trained on a mix of publicly available datasets. | 10 | ✔️ |
All ONNX models are published on https://huggingface.co/datasets/UAV4GEO/GeoDeep-Models
Instructions coming soon. The basic idea is to create an ONNX model (see the retinanet conversion script) and possibly make some modifications to GeoDeep to handle different conventions in model architectures via conditional checking.
Compared to other software packages (e.g. Deepness), GeoDeep relies only on two dependencies, rasterio and onnxruntime. This makes it simple and lightweight.
We welcome contributions! Pull requests are welcome.
- Train more detection models
- Add support for semantic segmentation models
- Faster inference optimizations
There are many ways to contribute to the project:
- ⭐️ us on GitHub.
- Help us test the application.
- Become a contributor!
GeoDeep was inspired and uses some code from Deepness and DeepForest.
The code in this repository is licensed under the AGPLv3.
Made with ❤️ by UAV4GEO
