Datasets:
Formats:
csv
Languages:
English
Size:
< 1K
Tags:
robotics
embodied-ai
human-demonstration
egocentric-video
bimanual-manipulation
tactile-sensing
License:
Download player/runtime/python/Lib/site-packages/rerun/utilities/_util.py from alinarus/MultimodalData: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/utilities/_util.py
- Command line
-
hf download hf://datasets/alinarus/MultimodalData/player/runtime/python/Lib/site-packages/rerun/utilities/_util.py
-
curl -L -o _util.py https://huggingface.co/datasets/alinarus/MultimodalData/resolve/main/player/runtime/python/Lib/site-packages/rerun/utilities/_util.py
680 Bytes
| """Simple utilities to be used for Rerun demos.""" | |
| from __future__ import annotations | |
| from typing import TYPE_CHECKING, Any | |
| if TYPE_CHECKING: | |
| import numpy as np | |
| def bounce_lerp( | |
| a: float, | |
| b: float, | |
| t: float | np.ndarray[Any, np.dtype[Any]], | |
| ) -> float | np.ndarray[Any, np.dtype[Any]]: | |
| """ | |
| A linear interpolator that bounces between `a` and `b` as `t` goes above `1.0`. | |
| Parameters | |
| ---------- | |
| a: | |
| Start value (t == 0). | |
| b: | |
| End value (t == 1). | |
| t: | |
| Interpolation coefficient. | |
| """ | |
| tf = t % 1 | |
| if int(t) % 2 == 0: | |
| return (1.0 - tf) * a + tf * b | |
| else: | |
| return tf * a + (1.0 - tf) * b | |