Skip to main content

A collection of segmentation models for water and river detection

Project description

Models Package

PyPI version Python License: MIT

A comprehensive Python package for water and river segmentation using deep learning models with satellite imagery data.

🌊 Features

  • Abstract Base Model: Extensible architecture for different segmentation models
  • Water Segmentation: Advanced model using Sentinel-1, Sentinel-2, and terrain data
  • River Segmentation: Specialized model for river detection and analysis
  • Data Integration: Built-in support for MinIO, TimescaleDB, and Kafka streaming
  • Data Validation: Pydantic schemas for robust data handling
  • Production Ready: Optimized for real-world deployment scenarios

📦 Installation

pip install models-package

Development Installation

pip install models-package[dev]

🚀 Quick Start

Water Segmentation

from models_package import WaterSegmentationModel

# Initialize the water segmentation model
model = WaterSegmentationModel(
    model_path="path/to/model.pth",
    model_name="WaterSegmentation",
    model_indx=0  # 0 for 7-band model, 1 for 9-band model
)

# Load the model weights
model.load_model()

# Setup connections (optional)
model.minIOConnection(
    address="localhost",
    port=9000,
    target="bucket-name",
    access_key="access_key",
    secret_key="secret_key"
)

# Make predictions
result = model.predict({
    "folder_link": "path/to/satellite/data",
    "location": "area_name"
})

print(f"Water coverage: {result['water_coverage_stats']['water_percentage']:.2f}%")

River Segmentation

from models_package import RiverSegmentationModel

# Initialize the river segmentation model
model = RiverSegmentationModel(
    model_path="path/to/river_model.pth",
    model_name="RiverSegmentation",
    input_size=(512, 512),
    model_architecture="unetplusplus",
    encoder_name="efficientnet-b3"
)

# Load model and make predictions
model.load_model()
result = model.predict({
    "image_link": "path/to/image",
    "filename": "river_image.jpg"
})

📋 Requirements

  • Python >= 3.8
  • PyTorch >= 1.9.0
  • CUDA compatible GPU (recommended)
  • See pyproject.toml for complete dependency list

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Create a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

📧 Contact

Requirements

  • Python >= 3.8
  • PyTorch >= 1.9.0
  • See requirements.txt for full dependencies

License

MIT License

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

models_package-0.1.1.tar.gz (128.1 kB view details)

Uploaded Source

Built Distribution

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

models_package-0.1.1-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: models_package-0.1.1.tar.gz
  • Upload date:
  • Size: 128.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for models_package-0.1.1.tar.gz
Algorithm Hash digest
SHA256 365f5a2b7b1084fe2346ae16b5637125958facd8d775ca76da3ac0e6cae5bdfc
MD5 d185c93bc69c10330d1cbeda1c56ff1b
BLAKE2b-256 0591f9f2905e0371f4df5bea11797881bb5601b4193a5c51b3ea8c4460b96133

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for models_package-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee1fa2a4054b7909c3cdf0eb817a0c9342f5bd5fa3c76ed6b8e7092db0872c2e
MD5 87e91641aabfc1482e90df145e80b83f
BLAKE2b-256 b495a530b434ff778a3a44ad01c568fd8e9f464d67c577a3fa2bb898e21a884f

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