Skip to main content

A python package to assist in multispectral satellite image segmentation.

Project description

SatSeg (WIP)

A python package to assist in multispectral satellite image segmentation.

Installation

pip install satseg

Usage

Training

from satseg.dataset import create_datasets
from satseg.model import save_model, train_model

# A list of paths to the satellite image tif files (.TIF)
tif_paths = ["01.tif". "02.tif"]
# A list of paths to the shapefiles (.SHP) of the masks
mask_paths = ["mask.shp"]

# Create the train and validation datasets
# The intermediate image files will be saved at ./temp/labeled/
train_set, val_set = create_datasets(tif_paths, mask_paths, "temp/labeled")

# Train the model
model, metrics = train_model(train_set, val_set, "unet")

# Save the model at a specified path
model_path = "model.pt"
save_model(model, model_path)

Inference

from satseg.dataset import create_inference_dataset
from satseg.model import load_model, run_inference


tif_paths = ["03.tif", "04.tif"]
# The intermediate image files will be saved at ./temp/unlabeled/
dataset = create_inference_dataset(tif_paths, "temp/unlabeled/", 256)

# Load a previously saved model
model_path = "model.pt"
model = load_model(model_path)

# Run inference on the dataset using the loaded model
# Results will be saved ./temp/infer/
run_inference(dataset, model, "temp/infer/")

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

satseg-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

satseg-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file satseg-0.1.0.tar.gz.

File metadata

  • Download URL: satseg-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.8.9 Windows/10

File hashes

Hashes for satseg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20f31033157baa3ded48e33c1351802de0203bee0c6cd7643b104139fef1ac33
MD5 fc5f126d4e8bd3320307edec5596e6ea
BLAKE2b-256 aab9e0a679c8be293144c764fd957b086f01f46536927dfd522f479685184776

See more details on using hashes here.

File details

Details for the file satseg-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: satseg-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.8.9 Windows/10

File hashes

Hashes for satseg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e2684fcf93afebbfd2d13a5066c0aaffa64d8cdf8383675cd49c4e2f479b9e9
MD5 d90848c41bde34c7fdb0fbcf0ec589f4
BLAKE2b-256 31967986dd24d8f3e7d6047f69a6bcd99e81efa7a59b3868823f5531309533f5

See more details on using hashes here.

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