mlstac 0.4.0
pip install mlstac
Latest version
Released:
A machine learning model-sharing specification based on STAC MLM and Safetensors.
Navigation
Verified details
These details have been verified by PyPIMaintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- Author: Cesar Aybar
- Requires: Python <4.0, >=3.10
Classifiers
- Programming Language
Project description
MLSTAC: Machine Learning with STAC
We take advantage of the new mlm STAC extension to provide a unified interface for working with machine learning models. Experimental
Installation
pip install mlstac
Quick Start
import mlstac
import matplotlib.pyplot as plt
# Download model
file="https://huggingface.co/tacofoundation/supers2/resolve/main/CNN_Light_SR/mlm.json"
output_dir="models2/CNN_Light_SR"
mlstac.download(file, output_dir)
# Create a mlstac object
mlstac_object = mlstac.load(output_dir)
device = "cpu" # "cpu"
# Load model
#srmodel = mlstac_object.trainable_model() # for fine-tuning
srmodel = mlstac_object.compiled_model(device=device) # for benchmarking
# Load Demo Data
lr, hr = mlstac_object.example_data()
# Inference
sr = srmodel(lr.to(device))
# Plot
fig, ax = plt.subplots(1, 3, figsize=(15, 5))
ax[0].imshow(lr[0, 0:3].permute(1, 2, 0)*3)
ax[0].set_title("Low Resolution")
ax[1].imshow(hr[0, 0:3].permute(1, 2, 0)*3)
ax[1].set_title("High Resolution")
ax[2].imshow(sr[0, 0:3].permute(1, 2, 0)*3)
ax[2].set_title("Super Resolution")
plt.show()
# Fast plot
fig = mlstac_object.display_results()
plt.show()
Project details
Verified details
These details have been verified by PyPIMaintainers
Unverified details
These details have not been verified by PyPIProject links
Meta
- Author: Cesar Aybar
- Requires: Python <4.0, >=3.10
Classifiers
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mlstac-0.4.0.tar.gz
.
File metadata
- Download URL: mlstac-0.4.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/24.3.1 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.32.3 rfc3986/1.5.0 tqdm/4.67.1 urllib3/2.3.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13b82e624c903728d21881782f1c889af70e8da500ae40bc5051f5b7a6683ee9 |
|
MD5 | c95b7cce99342f216d9c7d3700e1f34f |
|
BLAKE2b-256 | 1d1a5985f50e990e6ed25ff7601c9c6078ee83c8fc315278f98aff143b8272be |
File details
Details for the file mlstac-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: mlstac-0.4.0-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/7.0.1 keyring/24.3.1 pkginfo/1.9.6 readme-renderer/34.0 requests-toolbelt/1.0.0 requests/2.32.3 rfc3986/1.5.0 tqdm/4.67.1 urllib3/2.3.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e13ec0c24cc3f28438abfc5d25306143d27b105d27fabfb0e171c5838f84e4c |
|
MD5 | 1ad045f9f6fe189f220d6c2c1a859715 |
|
BLAKE2b-256 | 1ae26922bd32e853aad69604a73b5b57b9405aa334ca3c0d90801d69b475de34 |