Crates.io | bevy_zeroverse_ffi |
lib.rs | bevy_zeroverse_ffi |
version | 0.9.0 |
source | src |
created_at | 2024-09-25 20:39:07.819052 |
updated_at | 2024-11-05 16:16:37.334978 |
description | bevy zeroverse ffi library |
homepage | |
repository | |
max_upload_size | |
id | 1386646 |
size | 166,248 |
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
cargo test -p bevy_zeroverse_ffi --no-default-features
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 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
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.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"
},
...