Skip to main content

For investigating the manifold geometry of complex dynamical systems and using this information to learn improved world models.

Project description

Seamstress

It's this easy:

# Import pip installed modules
from seamstress import WorldModel

# Load weights from hugging face
model = WorldModel.from_pretrained("isaac-ronald-ward/seamstress-rotorcraft").eval()

# Pass in the context data, and the intended action sequence
# you want to imagine the outcome of
pred = model.imagine(
    # (context_len, |states_numeric|)
    past_states_numeric=...,  
    # (context_len, image_channels, image_height, image_width)
    past_states_image=..., 
    # (context_len, |actions|)
    past_actions=...,
    future_actions=...
)

# Inspect the imagined outputs
# (future_len, |states_numeric|)
pred["pred_future_states_numeric"]  
# (future_len, image_channels, image_height, image_width)
pred["pred_future_states_image"]    

Complete the instructions under installation before proceeding.

For the full inference walkthrough, including loading the shipped demo trajectory and writing predicted videos, see docs/README.inference.md.

Installation

Git LFS

Git Large File Storage (LFS) is used to manage large files in this repository. After cloning the repository, make sure to install Git LFS and pull the large files:

git lfs install
git lfs pull

Docker

Docker is used for reproducibility and ease of setup, and should be installed if you don't have it already.

We provide a development container style setup that bind-mounts the repo into the container, so edits on the host are reflected immediately inside the container, and vice versa.

To build and run the GPU container (requires NVIDIA drivers + nvidia-container-toolkit):

# The build step takes a while the first time round. Subsequent usage only requires the run command. For now, go grab a cuppa!
docker compose -f docker/compose.seamstress.yml build --no-cache seamstress-gpu
docker compose -f docker/compose.seamstress.yml run --rm -it seamstress-gpu bash

# Ensure that your GPUs are visible inside the container with:
nvidia-smi

This repository concerns the training of deep learning-based world models, so we recommend using a GPU. That said, we also provide a CPU container for development and testing:

# The build step takes a while the first time round. Subsequent usage only requires the run command. For now, go grab a cuppa!
docker compose -f docker/compose.seamstress.yml build --no-cache seamstress-cpu
docker compose -f docker/compose.seamstress.yml run --rm -it seamstress-cpu bash

Standard Docker commands apply:

# Leave the container
exit
# List all the containers and find the desired container id
docker ps
# Use the container id to start a new shell in the running container
docker exec -it ae8c43356adf bash
# Stop a running container with the container id
docker stop ae8c43356adf
# Stop all containers
docker stop $(docker ps -q)

Environment variables

Finally, copy .env.example to .env and fill in required fields (Weights & Biases, HuggingFace tokens, etc.). Note that nothing under the blocks:

# ----------------------------------------------------------------------
# Optional FiGS sidecar integration (GPU-only)
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# The following can remain unchanged unless you are tinkering
# ----------------------------------------------------------------------

Need changing for standard usage, but feel free to edit these for tinkering and ablations.

Getting started

We provide the following specific guides to get started with different aspects of the project, recommending that you always start with 1.

  1. Running the full workflow on a toy environment
  2. Loading a pretrained Seamstress model and using it for inference
  3. Using 'Flying in Gaussian Splats' for high fidelity quadrotor simulations
  4. Training on real world data
  5. Using your own data

Convienience commands

To delete all the logs and training artefacts in the repo use:

rm -rf ./logs/*
rm -rf ./wandb/*
rm -rf ./outputs/*

To delete all logs on Weights & Biases that do not include '*' in the run name use:

uv run -- python -m seamstress.utils.wandb_cleanup    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seamstress_world_models-1.0.4.tar.gz (33.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seamstress_world_models-1.0.4-py3-none-any.whl (28.8 MB view details)

Uploaded Python 3

File details

Details for the file seamstress_world_models-1.0.4.tar.gz.

File metadata

  • Download URL: seamstress_world_models-1.0.4.tar.gz
  • Upload date:
  • Size: 33.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for seamstress_world_models-1.0.4.tar.gz
Algorithm Hash digest
SHA256 58de38fa144467ada0ed6a9447795e5491c3cb62ce0c276a342131f9a7498c2c
MD5 93fbf3b31dd2a2f3610dd388684ea03a
BLAKE2b-256 12dc3b74c5cedf802178ea09afb4e4c425df4548eb44289b4128a0a97bde67a0

See more details on using hashes here.

Provenance

The following attestation bundles were made for seamstress_world_models-1.0.4.tar.gz:

Publisher: release.yml on isaac-ward/seamstress

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file seamstress_world_models-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for seamstress_world_models-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 753705d649ed73d8bedb2ea4b3e81e09ca34c04fa359ae74db90411b0773c2df
MD5 bb68e4396fdbcbbb1f49bc6676e3ddae
BLAKE2b-256 4f236c5601ed3973fddb8050ee8ab5acc57fd6aad6ba54839d888e0d713022f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for seamstress_world_models-1.0.4-py3-none-any.whl:

Publisher: release.yml on isaac-ward/seamstress

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page