Metadata-Version: 2.5
Name: nidavellir-tools
Version: 0.1.0
Summary: Reusable model packaging and transfer-learning utilities
Project-URL: Homepage, https://github.com/luiskuhn/nidavellir-tools
Project-URL: Issues, https://github.com/luiskuhn/nidavellir-tools/issues
Project-URL: Repository, https://github.com/luiskuhn/nidavellir-tools
Author: Luis Kuhn Cuellar
License-Expression: MIT
License-File: LICENSE
Keywords: bioimageio,machine-learning,model-packaging,pytorch,transfer-learning
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: numpy<3,>=1.26
Requires-Dist: pyyaml<7,>=6
Requires-Dist: tifffile>=2024.8
Requires-Dist: torch<3,>=2.4
Provides-Extra: bioimageio
Requires-Dist: bioimageio-core<0.12,>=0.11; extra == 'bioimageio'
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == 'dev'
Requires-Dist: pytest-cov>=5; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.6; extra == 'dev'
Requires-Dist: twine>=5; extra == 'dev'
Provides-Extra: huggingface
Requires-Dist: huggingface-hub<2,>=0.24; extra == 'huggingface'
Provides-Extra: mlflow
Requires-Dist: mlflow<3,>=2.16; extra == 'mlflow'
Description-Content-Type: text/markdown

# Nidavellir Tools

Nidavellir Tools packages trained PyTorch models with reproducibility metadata,
portable test tensors, and BioImage.IO-compatible artifacts. It also stages and
loads packaged models for transfer-learning runs.

The library is intentionally independent of any model architecture, training
framework, microscopy modality, or dataset. Consuming projects remain
responsible for their model, DataLoader, augmentation, model RDF, and model card.

> **Status:** the initial API may change before version 1.0.

## Installation

Install the core package from PyPI:

```bash
python -m pip install nidavellir-tools
```

Optional integrations are installed explicitly, for example:

```bash
python -m pip install "nidavellir-tools[bioimageio,huggingface,mlflow]"
```

For development from a checkout, use `python -m pip install -e ".[dev]"`.

## Command line

```bash
nidavellir --help
nidavellir build --help
nidavellir samples --help
nidavellir inspect --help
nidavellir validate --help
```

The existing command names remain available during migration:

```bash
nidavellir-build --help
nidavellir-registry --help
nidavellir-samples --help
```

## Image axes

Sample TIFF creation supports model tensors described by explicit BioImage.IO
axes. Standard 2D and 3D layouts include `BCYX` and `BCZYX`. The exact NPY
tensors retain the complete model input/output boundary, including the batch
dimension; TIFFs are presentation samples derived from one selected batch item.

## Containerized development

```bash
docker build -t nidavellir-tools:dev .
docker run --rm nidavellir-tools:dev --help
```

Run tests without modifying the host Python environment:

```bash
docker run --rm \
  -v "$PWD:/workspace" \
  -w /workspace \
  python:3.12-slim \
  bash -lc 'python -m pip install -e ".[dev]" && pytest -q'
```

## Origin

The project was extracted from
[`luiskuhn/nuxnet-training`](https://github.com/luiskuhn/nuxnet-training), where
the workflow was first exercised for 3D nuclei segmentation and parent-to-child
fine-tuning. The standalone package is derived from that implementation while
removing NuxNet-specific assumptions.
