mlstac


Namemlstac JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttps://github.com/csaybar/isp-models
SummaryA machine learning model-sharing specification based on STAC MLM and Safetensors.
upload_time2025-02-26 14:19:12
maintainerNone
docs_urlNone
authorCesar Aybar
requires_python<4.0,>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MLSTAC: Machine Learning with STAC

[![PyPI version](https://img.shields.io/pypi/v/mlstac.svg)](https://pypi.org/project/mlstac/)
[![Python Versions](https://img.shields.io/pypi/pyversions/mlstac.svg)](https://pypi.org/project/mlstac/)
[![License](https://img.shields.io/pypi/l/mlstac.svg)](https://github.com/csaybar/isp-models/blob/main/LICENSE)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://csaybar.github.io/isp-models/)

MLSTAC is a Python library that simplifies working with machine learning models using STAC (SpatioTemporal Asset Catalog) metadata standards. Load models with just a few lines of code regardless of where they're stored or how they're formatted.

## Features

- **Unified API**: Work with ML models using a consistent interface
- **Multiple Storage Backends**: Support for local, HTTP(S), FTP, S3, and Google Cloud Storage
- **Smart Visualization**: Automatic detection of Jupyter/Colab notebooks for enhanced display
- **Efficient Downloads**: Stream large model files for optimal performance
- **STAC Metadata**: Rich model information using standard metadata format

## Installation

```bash
pip install mlstac
```

## Quick Start

```python
from mlstac import ModelLoader

# Load a model by ID (will fetch metadata from the registry)
model = ModelLoader("resnet50")

# Download the model to a local directory
model.download("./models")

# Load the model for inference
inference_model = model.load_compiled_model()

# Get example data for testing
example_data = model.load_example_data()

# Run inference
result = inference_model(example_data)
```

## Working with Models

MLSTAC provides a simple, consistent interface for working with ML models:

```python
# View model information
model = ModelLoader("efficientnet")
# Prints rich information about the model in a notebook or terminal

# Get model summary as a dictionary
summary = model.get_model_summary()

# Download only specific components
model.download(
    "./models", 
    trainable_model=True, 
    compiled_model=True,
    example_data=False
)

# Load for training
trainable = model.load_trainable_model()
```

## Model Storage Support

MLSTAC supports multiple ways to access models:

- **Snippet IDs**: Short IDs that resolve to models in the registry
- **URLs**: HTTP(S) or FTP URLs to model files
- **Cloud Storage**: AWS S3 and Google Cloud Storage
- **Local Paths**: File paths on your local system

## Documentation

For complete documentation, visit our [documentation site](https://csaybar.github.io/isp-models/).

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the terms of the MIT license.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/csaybar/isp-models",
    "name": "mlstac",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": "Cesar Aybar",
    "author_email": "cesar.aybar@uv.es",
    "download_url": "https://files.pythonhosted.org/packages/70/01/0eb14686859898d482e4cec5e500d499557dd316c44537ab9248bdef1d07/mlstac-0.3.2.tar.gz",
    "platform": null,
    "description": "# MLSTAC: Machine Learning with STAC\n\n[![PyPI version](https://img.shields.io/pypi/v/mlstac.svg)](https://pypi.org/project/mlstac/)\n[![Python Versions](https://img.shields.io/pypi/pyversions/mlstac.svg)](https://pypi.org/project/mlstac/)\n[![License](https://img.shields.io/pypi/l/mlstac.svg)](https://github.com/csaybar/isp-models/blob/main/LICENSE)\n[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://csaybar.github.io/isp-models/)\n\nMLSTAC is a Python library that simplifies working with machine learning models using STAC (SpatioTemporal Asset Catalog) metadata standards. Load models with just a few lines of code regardless of where they're stored or how they're formatted.\n\n## Features\n\n- **Unified API**: Work with ML models using a consistent interface\n- **Multiple Storage Backends**: Support for local, HTTP(S), FTP, S3, and Google Cloud Storage\n- **Smart Visualization**: Automatic detection of Jupyter/Colab notebooks for enhanced display\n- **Efficient Downloads**: Stream large model files for optimal performance\n- **STAC Metadata**: Rich model information using standard metadata format\n\n## Installation\n\n```bash\npip install mlstac\n```\n\n## Quick Start\n\n```python\nfrom mlstac import ModelLoader\n\n# Load a model by ID (will fetch metadata from the registry)\nmodel = ModelLoader(\"resnet50\")\n\n# Download the model to a local directory\nmodel.download(\"./models\")\n\n# Load the model for inference\ninference_model = model.load_compiled_model()\n\n# Get example data for testing\nexample_data = model.load_example_data()\n\n# Run inference\nresult = inference_model(example_data)\n```\n\n## Working with Models\n\nMLSTAC provides a simple, consistent interface for working with ML models:\n\n```python\n# View model information\nmodel = ModelLoader(\"efficientnet\")\n# Prints rich information about the model in a notebook or terminal\n\n# Get model summary as a dictionary\nsummary = model.get_model_summary()\n\n# Download only specific components\nmodel.download(\n    \"./models\", \n    trainable_model=True, \n    compiled_model=True,\n    example_data=False\n)\n\n# Load for training\ntrainable = model.load_trainable_model()\n```\n\n## Model Storage Support\n\nMLSTAC supports multiple ways to access models:\n\n- **Snippet IDs**: Short IDs that resolve to models in the registry\n- **URLs**: HTTP(S) or FTP URLs to model files\n- **Cloud Storage**: AWS S3 and Google Cloud Storage\n- **Local Paths**: File paths on your local system\n\n## Documentation\n\nFor complete documentation, visit our [documentation site](https://csaybar.github.io/isp-models/).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the terms of the MIT license.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A machine learning model-sharing specification based on STAC MLM and Safetensors.",
    "version": "0.3.2",
    "project_urls": {
        "Documentation": "https://csaybar.github.io/isp-models/",
        "Homepage": "https://github.com/csaybar/isp-models",
        "Repository": "https://github.com/csaybar/isp-models"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "738e4b02f240725e2998633f99769fd0c46cba8cbef3ae6bd84830b4535bbac0",
                "md5": "87280631dd24674c18bfe19aa91998ab",
                "sha256": "13420f4155c40d1e365381efe127cb33562b865ec698b7544f54f27f276b4361"
            },
            "downloads": -1,
            "filename": "mlstac-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "87280631dd24674c18bfe19aa91998ab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 11101,
            "upload_time": "2025-02-26T14:19:08",
            "upload_time_iso_8601": "2025-02-26T14:19:08.900910Z",
            "url": "https://files.pythonhosted.org/packages/73/8e/4b02f240725e2998633f99769fd0c46cba8cbef3ae6bd84830b4535bbac0/mlstac-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70010eb14686859898d482e4cec5e500d499557dd316c44537ab9248bdef1d07",
                "md5": "ad6a5e11de81111319cdc4b3a20b9c24",
                "sha256": "189b457c16f405a8d20ba13f9401bc1b24fc726862a58e8ca093a73f0267308e"
            },
            "downloads": -1,
            "filename": "mlstac-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ad6a5e11de81111319cdc4b3a20b9c24",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 10710,
            "upload_time": "2025-02-26T14:19:12",
            "upload_time_iso_8601": "2025-02-26T14:19:12.666971Z",
            "url": "https://files.pythonhosted.org/packages/70/01/0eb14686859898d482e4cec5e500d499557dd316c44537ab9248bdef1d07/mlstac-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-26 14:19:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "csaybar",
    "github_project": "isp-models",
    "github_not_found": true,
    "lcname": "mlstac"
}
        
Elapsed time: 0.41282s