Metadata-Version: 2.4
Name: telekinesis-illusion
Version: 0.4.2
Summary: A synthetic data generation package.
Author-email: Telekinesis <support@telekinesis.ai>, Andranik Aristakesyan <andranik.aristakesyan@telekinesis.ai>
License-Expression: GPL-3.0-or-later
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.11
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: ~=3.11.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<2,>=1.26
Requires-Dist: Pillow>=10
Requires-Dist: h5py>=3.10
Requires-Dist: loguru>=0.7.3
Requires-Dist: opencv-contrib-python-headless==4.11.0.86
Requires-Dist: tqdm>=4.67.1
Requires-Dist: pycocotools>=2.0.11
Requires-Dist: bpy==4.5.14
Requires-Dist: trimesh==4.12.2
Requires-Dist: imageio>=2.34.1
Requires-Dist: scikit-learn>=1.5.0
Requires-Dist: scikit-image>=0.23.2
Requires-Dist: rich>=13.7.1
Requires-Dist: pypng>=0.20220715.0
Requires-Dist: httpx>=0.28.1
Requires-Dist: pyyaml>=6.0
Requires-Dist: scipy>=1.11
Requires-Dist: GitPython>=3.1
Provides-Extra: dev
Requires-Dist: ruff==0.15.9; 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"
Requires-Dist: pytest-benchmark>=4.0.0; extra == "dev"
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"
Dynamic: license-file

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

  <p align="center">
    <a href="https://docs.telekinesis.ai">
      <img src="https://img.shields.io/badge/docs-telekinesis.ai-blue" />
    </a>
    <a href="LICENSE">
      <img src="https://img.shields.io/badge/license-GPL--3.0--or--later-green" />
    </a>
  </p>

  <p>
    <a href="https://docs.telekinesis.ai/">Docs</a>
    &nbsp;•&nbsp;
    <a href="https://github.com/telekinesis-ai/telekinesis-illusion">GitHub</a>
    &nbsp;•&nbsp;
    <a href="https://discord.gg/S5v8bYAnc6">Discord</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://telekinesis.ai/">Website</a>
  </p>
</div>

#  `telekinesis-illusion`

`telekinesis-illusion` is a python package for procedurally generating physically simulated synthetic datasets for training computer vision models in robotics applications.

Open source under [GPL-3.0-or-later](LICENSE).

Full documentation: [Telekinesis Agentic OS: Illusion](https://docs.telekinesis.ai/data-engine/synthetic-datasets/overview.html).

| Synthetic | Segmentation | Depth |
|:---------:|:------------:|:-----:|
| <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_synth_001.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_seg_001.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_depth_001.webp" width="300"> |
| <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_synth_002.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_seg_002.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_depth_002.webp" width="300"> |
| <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_synth_003.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_seg_003.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_depth_003.webp" width="300"> |
| <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_synth_004.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_seg_004.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bop_depth_004.webp" width="300"> |

Real captures from the same camera setup for reference:

| | | |
|:---:|:---:|:---:|
| <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/real_000001.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/real_000002.webp" width="300"> | <img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/real_000003.webp" width="300"> |


## Installation

1. Create the enviornment;
    ```bash
    conda create -n telekinesis-illusion python=3.11
    ```
    ```bash
    conda activate telekinesis-illusion
    ```
2. Install the package:

    Via pip: The simplest way to install `telekinesis-illusion`.
    ```bash
    python -m pip install telekinesis-illusion
    ```
    Via GitHub: Alternatively, if you need to make changes to `telekinesis-illusion` or use a different branch.
    ```bash
    git clone https://github.com/telekinesis-ai/telekinesis-illusion.git
    ```
    ```bash
    cd telekinesis-illusion
    ```
    ```bash
    python -m pip install -e .
    ```

## Tested configurations

The following configurations have been manually tested with
`telekinesis-illusion` 0.4.0 and Python 3.11. This list records known-working
setups; other configurations may also work.

| Operating system | Hardware |
|---|---|
| Windows 11 Pro | NVIDIA GeForce RTX 3090 |
| Windows 11 Pro | NVIDIA GeForce RTX 2060 |
| macOS Tahoe 26.3 | Apple MacBook Pro with M5 Pro (CPU only) |
| Ubuntu 20.04.5 LTS | NVIDIA GeForce RTX 3080 |

## Quickstart

The examples are included in the installed package and run from any
directory with `python -m` inside the previosuly created environment `telekinesis-illusion`; a Git checkout is not required. 


If the current
directory contains an `assets/` directory, the examples use it. Otherwise the
first run downloads the public example assets (174 MB) to
`~/.cache/telekinesis/telekinesis-illusion/assets/assets-<VERSION>` and later
runs reuse them. 

Generated datasets are written under the directory you run the command from, in an `output/` folder. To control where the files go, pass `--output-dir` to the quickstarts, or set `dataset.output_directory` to an absolute path in the YAML for the worker.

The examples default to CUDA (`--device CUDA`); pass `--device CPU` to select
CPU rendering:

> [!NOTE]
> On macOS, launching an example for the first time can take a few minutes depending on the hardware (3-5 mins.).

> [!NOTE]
> Make sure that the previously created Conda environment is activated in the terminal where you intend to run the examples: `conda activate telekinesis-illusion`. 
The quickstarts write their results to a dataset directory below `output/` in the current working directory. It contains `shards/` with the generated shards and the exported dataset split into train, validation and test (70/20/10). Each run adds a new shard, and the export is rebuilt from all shards in `shards/`.


### Simple object based instance segmentation data generation (YOLO Format)
Run from the terminal:
```bash
python -m telekinesis.illusion.examples.quickstart_object_based_data_generation --preview
```
**Expected output:** Ten annotated images of metallic objects. The shard is saved in `output/simple_object_based_quickstart/shards/` and the YOLO instance segmentation dataset in `output/simple_object_based_quickstart/dataset_yolo/`. The viewer, titled `simple_object_based_quickstart - YOLO`, shows all generated images.

<img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/object_based_expected_output_1.webp" width="300">

Use the left and right arrow keys in the viewer to navigate through the generated data.

### Simple bin picking instance segmentation data generation (COCO Format)
Run from the terminal:
```bash
python -m telekinesis.illusion.examples.quickstart_parts_in_bin --preview
```
**Expected output:** Ten annotated images of metallic objects in varying bin colors. The shard is saved in `output/simple_bin_picking_quickstart/shards/` and the COCO instance segmentation dataset in `output/simple_bin_picking_quickstart/dataset_coco/`. The viewer, titled `simple_bin_picking_quickstart - COCO`, shows all generated images.

<img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/bin_picking_expected_output_1.webp" width="300">

Use the left and right arrow keys in the viewer to navigate through the generated data.

### Config 6D object pose dataset generation with a worker (BOP Format)
Run from the terminal:

```bash
python -m telekinesis.illusion.examples.generate_synthetic_data_with_bin_picking_worker --preview
```

**Expected output:** 20 top-down images of mixed industrial parts piled in a black lined tray, with two empty bins on each side and the robot gripper in view. Annotations are in BOP format, saved in `/output/connector_bin_picking_0.4.0_v2/`.

<img src="https://assets.telekinesis.ai/telekinesis-illusion/readme_files/config_based_expected_output_1.webp" width="600">

The bin-picking worker uses the bundled
`connector_bin_picking_0.4.0_v2.yaml` by default. Use
`--config-file <path/to/your/config.yaml>` to select another config file and `--preview` or
`--no-preview` to control the viewer. Pass `--help` to any example to list its
options.

The example sources are in
[`src/telekinesis/illusion/examples/`](src/telekinesis/illusion/examples/).
To adapt an example, copy the script or the YAML config and edit the copy.

### View generated datasets

Illusion writes generated datasets in a native sharded format. The shards can
then be merged and exported to common formats such as COCO, YOLO or BOP. Generated
images and annotations can always be inspected directly under `output/`, and the specific exports can be opened with any compatible dataset viewer.

To open a dataset in the built-in viewer, pass its directory to the
`view_dataset` example:

```bash
python -m telekinesis.illusion.examples.view_dataset <path/to/generated/shard/or/dataset>
```

It accepts a COCO, YOLO or BOP export, a single train/val/test split of it,
the `shards/` directory or a single shard. When the directory holds several
splits or shards, select one at the top of the viewer.

You can use our local visual dataset studio [telekinesis-lens](https://pypi.org/project/telekinesis-lens/). Install it from PyPI into a seperate conda envrionment and run:
```bash
lens "/path/to/synthetic/dataset"
```
> [!NOTE]
> `telekinesis-lens` is under active development. If you run into a bug or have feedback, please open an issue. We'd love to hear from you!

## Benchmarks
Coming soon! ;^)

## Tested configurations

The following configurations have been manually tested with. This list records known-working
setups; other configurations may also work.

| Operating system | Hardware |
|---|---|
| Windows 11 Pro | CPU; NVIDIA GeForce RTX 3090; RTX 2060 |
| macOS Tahoe 26.3 | Apple MacBook Pro with M5 Pro (CPU only) |
| Ubuntu 20.04.5 LTS | CPU; NVIDIA GeForce RTX 3080 |

## Documentation

Find the documentation for Illusion at: [Telekinesis Agentic OS: Illusion](https://docs.telekinesis.ai/).

## Citation

```bibtex
@software{telekinesis_illusion,
  author = {Telekinesis GmbH},
  title  = {Telekinesis-Illusion: Synthetic Data Generation for Robotics},
  year   = {2026},
  url    = {https://gitlab.com/telekinesis/illusion},
  note   = {GPL-3.0-or-later}
}
```
