Skip to main content

Free and open source library for AI object detection in geospatial rasters

Project description

GeoDeep

A fast, easy to use, lightweight Python library for AI object detection in geospatial rasters (GeoTIFFs), with pre-built models included.

Image

Install

pip install -U geodeep

Usage

From the command line

geodeep [geotiff] [model ID 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 model IDs 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 :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:
birds Retinanet bird detection model from DeepForest 2 :heavy_check_mark:
planes YOLOv7 tiny model for object detection on satellite images. Based on the Airbus Aircraft Detection dataset. 70 :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.

Does this need a GPU?

It does not! Models are tuned to run fast on the CPU.

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.

Made with ❤️ by UAV4GEO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

geodeep-0.9.5.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geodeep-0.9.5-py3-none-any.whl (40.3 kB view details)

Uploaded Python 3

File details

Details for the file geodeep-0.9.5.tar.gz.

File metadata

  • Download URL: geodeep-0.9.5.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for geodeep-0.9.5.tar.gz
Algorithm Hash digest
SHA256 5487c1d7cedd0493422e5a2defa11ee2c0799d9d58e09c10fd7f50b0839085c5
MD5 1f542c05b1d70bc499635bee6b5f256f
BLAKE2b-256 6f903d6d0cf142d712cf61e94a49ea6168b3ed09481bba40d2a879954eedb7b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for geodeep-0.9.5.tar.gz:

Publisher: publish.yml on uav4geo/GeoDeep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file geodeep-0.9.5-py3-none-any.whl.

File metadata

  • Download URL: geodeep-0.9.5-py3-none-any.whl
  • Upload date:
  • Size: 40.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for geodeep-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8dfa6291bed1d5a0852a5543d3ac0ae3a50d9be9b966d105514630029e46caf6
MD5 2603db2fa33372a07083b5ee020a8990
BLAKE2b-256 ef5ac2ab2b274b434c8e843d8cb0567fb363a2a4299d0938f681fd4409cbd9e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for geodeep-0.9.5-py3-none-any.whl:

Publisher: publish.yml on uav4geo/GeoDeep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page