Metadata-Version: 2.4
Name: telekinesis-lens
Version: 0.1.3
Summary: Detection dataset visualizer and AI-assisted video/image annotation studio for the Telekinesis SDK.
Author-email: Telekinesis <support@telekinesis.ai>
License: Proprietary
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: <3.13,>=3.11
Description-Content-Type: text/markdown
Requires-Dist: loguru>=0.7.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: opencv-python>=4.8.0
Requires-Dist: pillow>=9.0.0
Requires-Dist: fastapi<1,>=0.115
Requires-Dist: uvicorn<1,>=0.30
Requires-Dist: pyyaml>=6.0
Requires-Dist: win32more-Microsoft.Windows.SDK.Win32Metadata<0.9,>=0.8.71.0.25; sys_platform == "win32"
Requires-Dist: telekinesis-trackers
Requires-Dist: pycocotools>=2.0.7
Requires-Dist: shapely>=2.0
Requires-Dist: scipy>=1.11
Requires-Dist: scikit-learn>=1.3
Requires-Dist: imagehash>=4.3
Requires-Dist: fiftyone>=1.0
Requires-Dist: umap-learn>=0.5
Requires-Dist: torch>=2.7
Requires-Dist: transformers<6,>=5.5
Requires-Dist: graphql-core<3.3,>=3.2
Requires-Dist: telekinesis-ai>=0.3.19
Provides-Extra: sam3
Requires-Dist: torch>=2.7; extra == "sam3"
Requires-Dist: torchvision>=0.22; extra == "sam3"
Requires-Dist: transformers<6,>=5.5; extra == "sam3"
Provides-Extra: tapnextpp
Requires-Dist: einops<1,>=0.8; extra == "tapnextpp"
Provides-Extra: rfdetr
Requires-Dist: telekinesis-iris[rfdetr]<0.2,>=0.1.5; extra == "rfdetr"
Provides-Extra: iris
Requires-Dist: telekinesis-iris[rfdetr,sam3-lora]<0.2,>=0.1.5; extra == "iris"
Provides-Extra: gpu
Requires-Dist: telekinesis-trackers[gpu]; extra == "gpu"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: ruff==0.15.8; extra == "dev"
Requires-Dist: pylint==4.0.5; extra == "dev"
Requires-Dist: psutil; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"

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

  <br>

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

</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-lens`

`telekinesis-lens` is a local visual dataset studio for inspecting, annotating,
and exporting image and video datasets. Its interface runs in the browser while
a local service reads and updates files on your computer.

Feature guides: [DEVELOPMENT.md](DEVELOPMENT.md#features).

## Installation

1. Create the environment. Lens supports Python 3.11 and 3.12:
    ```bash
    conda create -n telekinesis-lens python=3.11
    ```
    ```bash
    conda activate telekinesis-lens
    ```
2. Install the package:
    ```bash
    python -m pip install telekinesis-lens
    ```
    This installs Lens with the CPU tracker runtime (`telekinesis-trackers`).
    The package includes the compiled interface, so Node.js is not needed. To work from a source checkout, follow
    [DEVELOPMENT.md](DEVELOPMENT.md#getting-started).

### NVIDIA GPU tracking

Tracking runs on the CPU by default. For NVIDIA GPU tracking, install the `gpu`
extra. It requires a compatible NVIDIA driver:

```bash
python -m pip install "telekinesis-lens[gpu]"
```

Trackers installs the CPU ONNX Runtime in its base package, and the CPU and GPU
runtimes share one Python module directory. Stop Lens and replace the CPU
runtime:

```bash
python -m pip uninstall -y onnxruntime onnxruntime-gpu
```
```bash
python -m pip install "onnxruntime-gpu[cuda,cudnn]>=1.21,<1.27" "cupy-cuda12x[ctk]>=14,<15"
```

Check that the output lists `CUDAExecutionProvider`:

```bash
python -c "import onnxruntime as ort; print(ort.__version__, ort.get_available_providers())"
```

Reinstalling or upgrading Trackers can restore the CPU runtime. Repeat the
replacement afterward if tracking switches back to the CPU.

### Optional dependencies

| Extra | Purpose |
|---|---|
| `gpu` | NVIDIA GPU tracking with ONNX Runtime GPU, CUDA 12 user-space libraries, cuDNN, and CuPy. See [NVIDIA GPU tracking](#nvidia-gpu-tracking). |
| `iris` | Telekinesis Iris with RF-DETR and SAM3 LoRA, to run, benchmark, and train your own models. |
| `rfdetr` | Telekinesis Iris with RF-DETR only. |
| `quality` | Dataset quality checks, model benchmarks, **Model inference** runs, and the `lens-data` command. |
| `sam3` | Experimental SAM3 video mask propagation. Needs the model files described in [DEVELOPMENT.md](DEVELOPMENT.md#sam3-experimental). |
| `tapnextpp` | TAPNext++ keypoint propagation. Needs PyTorch and TAPNet as described in [DEVELOPMENT.md](DEVELOPMENT.md#tapnext-keypoint-propagation). |
| `dev` | pytest and HTTPX for developing Lens. |

Multiple extras can be installed together:

```bash
python -m pip install "telekinesis-lens[iris,quality]"
```

### Synthetic data generation

The **Synthetic data** view renders datasets with Telekinesis Illusion and
trains models on them with Iris. Illusion requires NumPy 1.x and Lens requires
NumPy 2.x, so Illusion cannot be installed in the Lens environment. Install it
in its own Python 3.11 environment, which does not need Lens:

```bash
conda create -n telekinesis-illusion python=3.11
```
```bash
conda activate telekinesis-illusion
```
```bash
python -m pip install "telekinesis-illusion>=0.3.1,<0.4"
```

Before starting Lens, set `LENS_ILLUSION_PYTHON` to the Python executable of
that environment. To print its path, run:

```bash
conda run -n telekinesis-illusion python -c "import sys; print(sys.executable)"
```

Windows PowerShell:

```powershell
$env:LENS_ILLUSION_PYTHON = "C:\path\to\miniconda3\envs\telekinesis-illusion\python.exe"
lens
```

Linux and macOS:

```bash
export LENS_ILLUSION_PYTHON="$HOME/miniconda3/envs/telekinesis-illusion/bin/python"
lens
```

Training uses Iris from the Lens environment (`iris` extra) and needs a CUDA
build of PyTorch. To train with the Python of another environment, set
`LENS_IRIS_PYTHON` the same way.

## Quickstart

```bash
lens
```
```bash
lens "/path/to/dataset-or-video"
```

Lens opens at `http://127.0.0.1:5151`. Files remain local and annotations are
saved back to the selected workspace.

## Documentation

- Feature guides, contributor setup, and releases: [DEVELOPMENT.md](DEVELOPMENT.md)
- Release notes: [CHANGELOG.md](CHANGELOG.md)
- Telekinesis documentation: [docs.telekinesis.ai](https://docs.telekinesis.ai)
- Telekinesis examples: [telekinesis-examples](https://github.com/telekinesis-ai/telekinesis-examples)
- Support: open an issue in the Lens repository, or contact
  [support@telekinesis.ai](mailto:support@telekinesis.ai) or
  [Discord](https://discord.com/invite/7NnQ3bQHqm).
