Metadata-Version: 2.4
Name: telekinesis-iris
Version: 0.0.3
Summary: Model training and inference repository
Author-email: Telekinesis <support@telekinesis.ai>
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://telekinesis.ai
Project-URL: Documentation, https://docs.telekinesis.ai
Project-URL: Telekinesis Examples Repository, https://github.com/telekinesis-ai/telekinesis-examples
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: loguru>=0.7.0
Requires-Dist: opencv-python>=4.7.0.72
Requires-Dist: pycocotools>=2.0.6
Requires-Dist: numpy>=1.24.0
Requires-Dist: pydantic>=2.0
Requires-Dist: requests>=2.31.0
Requires-Dist: rerun-sdk>=0.34.0
Requires-Dist: scipy>=1.10.0
Requires-Dist: torch>=2.2.0
Requires-Dist: torch-hungarian==0.1.0rc0
Requires-Dist: tensorboard>=2.16.0
Requires-Dist: tqdm>=4.66.0
Requires-Dist: transformers<6,>=5.0.0
Requires-Dist: torchvision>=0.17.0
Requires-Dist: onnx>=1.16.0
Requires-Dist: onnxscript>=0.1.0
Requires-Dist: onnxruntime>=1.18.0
Requires-Dist: torchmetrics[detection]<1.9.0,>=1.8.2
Provides-Extra: docs
Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
Requires-Dist: mkdocstrings[python]<1,>=0.25; extra == "docs"
Requires-Dist: mkdocs-awesome-pages-plugin<3,>=2; extra == "docs"
Provides-Extra: dev
Requires-Dist: ruff==0.15.8; extra == "dev"
Requires-Dist: pylint==4.0.5; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"

<div align="center">
  <p>
    <a href="https://telekinesis.ai" target="_blank">
      <img
        width="100%"
        src="https://assets.telekinesis.ai/logo/telekinesis-banner.png"
        alt="Telekinesis"
      >
    </a>
  </p>

  <br>

  [![PyPI version](https://img.shields.io/pypi/v/telekinesis-iris)](https://pypi.org/project/telekinesis-iris/)
  [![License](https://img.shields.io/pypi/l/telekinesis-iris)](https://pypi.org/project/telekinesis-iris/)
  [![Python versions](https://img.shields.io/pypi/pyversions/telekinesis-iris)](https://pypi.org/project/telekinesis-iris/)
</div>

<p align="center">
  <a href="https://github.com/telekinesis-ai">GitHub</a>
  &nbsp;•&nbsp;
  <a href="https://www.linkedin.com/company/telekinesis-ai/">LinkedIn</a>
  &nbsp;•&nbsp;
  <a href="https://x.com/telekinesis_ai">X</a>
  &nbsp;•&nbsp;
  <a href="https://discord.gg/7NnQ3bQHqm">Discord</a>
</p>

# Telekinesis Iris

Telekinesis Iris is a computer vision library for creating COCO datasets and
training, exporting, and deploying object detection and instance segmentation
models.

It includes:

- COCO dataset generation and loading with bounding boxes and segmentation masks
- Local RF-DETR detection and segmentation model implementations
- PyTorch training, validation, checkpointing, and TensorBoard logging
- ONNX export and ONNX Runtime inference
- Rerun visualization for datasets and predictions

## Release Model

Telekinesis Iris is currently in active development (pre-1.0). APIs may evolve
between minor releases. Install the latest package version for the newest
features and fixes.

## Installation

1. Install [Miniconda](https://docs.conda.io/projects/miniconda/en/latest/).

2. Create a Python 3.11 environment:

   ```bash
   conda create -n telekinesis-iris python=3.11
   ```

3. Activate the environment:

   ```bash
   conda activate telekinesis-iris
   ```

4. Install PyTorch and TorchVision for CUDA 12.8, then install the package:

   ```bash
   pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
   ```

   ```bash
   pip install telekinesis-iris
   ```

The Python package is imported as `telekinesis.iris`, while the package published on PyPI is named `telekinesis-iris`.

## Example

Train an RF-DETR segmentation model on a COCO dataset:

```python
from telekinesis.iris.dataset import COCODataset, ResizeSample
from telekinesis.iris.models import (
    RFDETRSegNanoConfig,
    SegmentationTrainConfig,
    build_criterion_from_config,
    build_model_from_config,
    load_pretrain_weights,
)
from telekinesis.iris.trainer import Trainer

model_config = RFDETRSegNanoConfig(num_classes=3)
train_config = SegmentationTrainConfig(
    dataset_dir="dataset/train",
    output_dir="results/seg-nano",
    epochs=10,
    batch_size=4,
)

model = build_model_from_config(model_config, train_config)
load_pretrain_weights(model, model_config)
criterion, _ = build_criterion_from_config(model_config, train_config)
dataset = COCODataset(
    "dataset/train",
    transforms=ResizeSample(model_config.resolution),
    include_masks=True,
)

Trainer(
    model=model,
    criterion=criterion,
    dataset=dataset,
    output_dir="results/seg-nano",
    epochs=10,
    batch_size=4,
    evaluate_masks=True,
).train()
```

## Resources

- [Telekinesis Examples](https://github.com/telekinesis-ai/telekinesis-examples)
- [Telekinesis Documentation](https://docs.telekinesis.ai)
- [Development guide](DEVELOPMENT.md)
- [Changelog](CHANGELOG.md)

## Support

For issues and questions:

- Create an [issue](https://github.com/telekinesis-ai/telekinesis-examples/issues).
- Contact `support@telekinesis.ai`.
- Join the [Telekinesis Discord](https://discord.com/invite/7NnQ3bQHqm).
