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.1.tar.gz (8.8 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.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: satseg-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 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.1.tar.gz
Algorithm Hash digest
SHA256 ba6358cb223cdb83ea8a9e01e797bba217c4ff9fb2fd08cbe36bfc680d8b6e48
MD5 c366f8daa28602bb7558a1d78db6f175
BLAKE2b-256 27536d431523dbee53a63edec0e3059073e45883f1f8c5940f3570c563653fb4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: satseg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c0f5786953ae3de2d034eced510c7b0633070afbf76efec4adfc7b8ecd46eaa3
MD5 72bdc1dcd2cab591a3db71a33698250e
BLAKE2b-256 bc8c5e8024d452b47d3412981d41d9d8e1dc4ae82a5277d6ed2353024c176d28

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