Free and open source library for AI object detection in geospatial rasters
Project description
GeoDeep
A fast, lightweight Python library for AI object detection in geospatial rasters (GeoTIFFs).
Install
pip install -U geodeep
Usage
From the command line
geodeep [geotiff] [modelID or path to ONNX model]
Example:
geodeep orthophoto.tif cars
Here 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 modelID can be retrieved via:
geodeep --list-models
See also geodeep --help.
From Python
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"
Models
| 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 | :heavy_check_mark: |
| trees_yolov7 | YOLOv9 model for treetops detection on aerial images. Model is trained on a mix of publicly available datasets. | 10 | :heavy_check_mark: |
All ONNX models are published on https://huggingface.co/datasets/UAV4GEO/GeoDeep-Models
Creating New 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.
Why GeoDeep?
Compared to other software packages (e.g. Deepness), GeoDeep relies only on two dependencies, rasterio and onnxruntime. This makes it simple and lightweight.
Contributing
We welcome contributions! Pull requests are welcome.
Roadmap Ideas
- Train more detection models
- Add support for semantic segmentation models
- Faster inference optimizations
Support the Project
There are many ways to contribute to the project:
- ⭐️ us on GitHub.
- Help us test the application.
- Become a contributor!
Credits
GeoDeep was inspired and uses some code from Deepness and DeepForest.
License
The code in this repository is licensed under the AGPLv3.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file geodeep-0.9.3.tar.gz.
File metadata
- Download URL: geodeep-0.9.3.tar.gz
- Upload date:
- Size: 37.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26e41c1234796c6f9a72a8844f5bedae1d5910fffa9ee5c561130be7d902c99d
|
|
| MD5 |
c71e525b62606c6d9d1748ef7fe0b1fe
|
|
| BLAKE2b-256 |
89a49670c8da3d0376594acca960026b9700aca34dcf2e0eaaeabbcf1e98e5a9
|
Provenance
The following attestation bundles were made for geodeep-0.9.3.tar.gz:
Publisher:
publish.yml on uav4geo/GeoDeep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geodeep-0.9.3.tar.gz -
Subject digest:
26e41c1234796c6f9a72a8844f5bedae1d5910fffa9ee5c561130be7d902c99d - Sigstore transparency entry: 164543568
- Sigstore integration time:
-
Permalink:
uav4geo/GeoDeep@a9ebee402025622d02bbae817cfffd10fbba2aa2 -
Branch / Tag:
refs/tags/v0.9.3 - Owner: https://github.com/uav4geo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a9ebee402025622d02bbae817cfffd10fbba2aa2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file geodeep-0.9.3-py3-none-any.whl.
File metadata
- Download URL: geodeep-0.9.3-py3-none-any.whl
- Upload date:
- Size: 38.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dffc496a05acb4b4a65cb2226536380d28771db6b522b47ac4e8cb7d300c1e09
|
|
| MD5 |
bf5ced9ad2f66dac4d2b55bbb2a0567a
|
|
| BLAKE2b-256 |
609e7951896c17ace26c8392ea0090ede2eab1702a2adab699f6c2fa11c5fb47
|
Provenance
The following attestation bundles were made for geodeep-0.9.3-py3-none-any.whl:
Publisher:
publish.yml on uav4geo/GeoDeep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
geodeep-0.9.3-py3-none-any.whl -
Subject digest:
dffc496a05acb4b4a65cb2226536380d28771db6b522b47ac4e8cb7d300c1e09 - Sigstore transparency entry: 164543575
- Sigstore integration time:
-
Permalink:
uav4geo/GeoDeep@a9ebee402025622d02bbae817cfffd10fbba2aa2 -
Branch / Tag:
refs/tags/v0.9.3 - Owner: https://github.com/uav4geo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a9ebee402025622d02bbae817cfffd10fbba2aa2 -
Trigger Event:
release
-
Statement type: