11 releases (6 breaking)
0.9.0 | Nov 5, 2024 |
---|---|
0.8.1 | Oct 28, 2024 |
0.7.1 | Oct 27, 2024 |
0.6.2 | Oct 3, 2024 |
0.3.0 | Sep 25, 2024 |
#1012 in Game dev
214 downloads per month
50KB
1K
SLoC
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"
},
...
Dependencies
~62–100MB
~2M SLoC