Metadata-Version: 2.4
Name: mimic-video
Version: 0.0.22
Summary: Mimic Video
Project-URL: Homepage, https://pypi.org/project/mimic-video/
Project-URL: Repository, https://github.com/lucidrains/mimic-video
Author-email: Phil Wang <lucidrains@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Phil Wang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: artificial intelligence,attention mechanism,deep learning,video language action model
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: einops>=0.8.1
Requires-Dist: einx>=0.3.0
Requires-Dist: hyper-connections>=0.4.3
Requires-Dist: torch-einops-utils>=0.0.8
Requires-Dist: torch>=2.5
Requires-Dist: tqdm
Requires-Dist: x-mlps-pytorch
Provides-Extra: examples
Provides-Extra: test
Requires-Dist: accelerate; extra == 'test'
Requires-Dist: diffusers>=0.32.0; extra == 'test'
Requires-Dist: pytest; extra == 'test'
Requires-Dist: transformers; extra == 'test'
Description-Content-Type: text/markdown

<img src="./mimic-video.png" width="450px"></img>

## Mimic Video (wip)

Implementation of [Mimic-Video](https://mimic-video.github.io/), Video-Action Models for Generalizable Robot Control Beyond VLAs

## Appreciation

- [Pranoy](https://github.com/pranoyr) for submitting a pull request for proprioception masking

## Install

```shell
$ pip install mimic-video
```

## Usage

```python
import torch

# video wrapper
# but will be agnostic to the model

from mimic_video.cosmos_predict import CosmosPredictWrapper

video_wrapper = CosmosPredictWrapper(
    extract_layer = 1,
    random_weights = True,
    tiny = True
)

# mimic video

from mimic_video import MimicVideo

model = MimicVideo(512, video_wrapper)

# states

video = torch.rand(2, 3, 3, 32, 32)

joint_state = torch.randn(2, 32)

# action

actions = torch.randn(2, 32, 20)

# training

loss = model(
    prompts = [
        'put the package on the conveyer belt',
        'pass the butter'
    ],
    video = video,
    actions = actions,
    joint_state = joint_state
)

loss.backward()

# inference

actions = model.sample(
    prompts = 'peel the orange',
    video = video[:1],
    joint_state = joint_state[:1]
)

assert actions.shape == (1, 32, 20)
```

## Contributing

First make sure `pytest` and test dependencies are installed with

```shell
$ pip install '.[test]'
```

Then add your test to `tests/test_mimic_video.py` and run

```shell
$ pytest tests
```

That's it

## Citations

```bibtex
@inproceedings{Pai2025mimicvideoVM,
    title   = {mimic-video: Video-Action Models for Generalizable Robot Control Beyond VLAs},
    author  = {Jonas Pai and Liam Achenbach and Victoriano Montesinos and Benedek Forrai and Oier Mees and Elvis Nava},
    year    = {2025},
    url     = {https://api.semanticscholar.org/CorpusID:283920528}
}
```
