bevy_zeroverse_ffi

Crates.iobevy_zeroverse_ffi
lib.rsbevy_zeroverse_ffi
version0.9.0
sourcesrc
created_at2024-09-25 20:39:07.819052
updated_at2024-11-05 16:16:37.334978
descriptionbevy zeroverse ffi library
homepage
repository
max_upload_size
id1386646
size166,248
Mitchell Mosure (mosure)

documentation

README

bevy_zeroverse python bindings

install bevy_zeroverse to your python environment with pip install ffi (from repository root)

install bevy_zeroverse_dataloader to your python environment with pip install ffi/python

test

cargo test -p bevy_zeroverse_ffi --no-default-features

dataloader

torch dataloader API for online bevy_zeroverse batch generation.

run the test script with python ffi/python/test.py to see the dataloader in action.

from bevy_zeroverse_dataloader import BevyZeroverseDataset
from torch.utils.data import DataLoader


dataset = BevyZeroverseDataset(
    editor=False, headless=True, num_cameras=6,
    width=640, height=480, num_samples=1e6,
)
dataloader = DataLoader(dataset, batch_size=2, shuffle=True, num_workers=1)


for batch in dataloader:
    visualize(batch)

macos setup

macos does not support running the generator off main thread. right now, the only way to generate on mac is from rust. e.g.

cargo run -p bevy_zeroverse_ffi --bin generate -- --help

windows setup

export PYO3_PYTHON="/c/Users/{user}/.pyenv/pyenv-win/versions/3.11.7/python.exe"
export PATH="/c/Users/{user}/.pyenv/pyenv-win/versions/3.11.7/libs:$PATH"

rust-analyzer

...
    "rust-analyzer.server.extraEnv": {
        "CARGO_TARGET_DIR": "target/analyzer",
        "PYO3_PYTHON": "C:\\Users\\{user}\\.pyenv\\pyenv-win\\versions\\3.11.7\\python.exe",
        "LIB": "C:\\Users\\{user}\\.pyenv\\pyenv-win\\versions\\3.11.7\\libs"
    },
...
Commit count: 0

cargo fmt