Skip to main content

example description

Project description

Garuda

A research-oriented computer vision library for satellite imagery.

Coverage Status

Installation

Stable version:

pip install garuda

Latest version:

pip install git+https://github.com/patel-zeel/garuda

Terminology

Term Description
Local co-ordinates (x, y) where x is the column number and y is the row number. Origin is at the top-left corner.
Web Mercator (webm) co-ordinates (x, y) pixel co-ordinates as described on Google Maps Developer Documentation.
Geo co-ordinates (latitude, longitude) as genereally used in GPS systems.

Usage

See the examples directory for more details.

Functionality

Operations

Convert Ultralytics format of YOLO oriented bounding box to YOLO axis aligned bounding box.

from garuda.ops import obb_to_aa
aa_label = obb_to_aa(obb_label)

Convert local image pixel coordinates to geo coordinates (latitude, longitude).

from garuda.ops import local_to_geo
geo_coords = local_to_geo(img_x, img_y, zoom, img_center_lat, img_center_lon, img_width, img_height)

Convert geo coordinates (latitude, longitude) to global image pixel coordinates in Web Mercator projection at a given zoom level.

from garuda.ops import geo_to_webm_pixel
webm_x, webm_y = geo_to_webm_pixel(lat, lon, zoom)

Convert global image pixel coordinates in Web Mercator projection to geo coordinates (latitude, longitude) at a given zoom level.

from garuda.ops import webm_pixel_to_geo
lat, lon = webm_pixel_to_geo(x, y, zoom)

Object Detection in Satellite Imagery

Convert center of a YOLO axis-aligned or oriented bounding box to geo coordinates (latitude, longitude).

from garuda.od import yolo_aa_to_geo # for axis aligned bounding box
from garuda.od import yolo_obb_to_geo # for oriented bounding box
geo_coords = yolo_aa_to_geo(yolo_aa_label, zoom, img_center_lat, img_center_lon, img_width, img_height)
# OR
geo_coords = yolo_obb_to_geo(yolo_obb_label, zoom, img_center_lat, img_center_lon, img_width, img_height)

Visualization

Plot a satellite image with correct geo-coordinates on the x-axis and y-axis.

from garuda.plot import plot_webm_pixel_to_geo
import matplotlib.pyplot as plt
from PIL import Image

img = plt.imread('path/to/image')
# OR
# img = Image.open('path/to/image')

fig, ax = plt.subplots()
ax = plot_webm_pixel_to_geo(img, img_center_lat, img_center_lon, zoom, ax)
plt.show()

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

garuda-0.0.2.tar.gz (5.7 MB view details)

Uploaded Source

File details

Details for the file garuda-0.0.2.tar.gz.

File metadata

  • Download URL: garuda-0.0.2.tar.gz
  • Upload date:
  • Size: 5.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for garuda-0.0.2.tar.gz
Algorithm Hash digest
SHA256 868c4d38d05782b9cddf6e9db24f3c82a06a72f632a27583babd0db7a6aed06a
MD5 b1347d682e68cd41a42cf41c2c93c7dc
BLAKE2b-256 91a4101f8c3ac4558975a4ef4223616f48806f122cc20a59533bca6957960147

See more details on using hashes here.

Supported by

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