Instructions to use tuanhqv123/tars-mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- stable-baselines3
How to use tuanhqv123/tars-mini with stable-baselines3:
from huggingface_sb3 import load_from_hub checkpoint = load_from_hub( repo_id="tuanhqv123/tars-mini", filename="{MODEL FILENAME}.zip", ) - Notebooks
- Google Colab
- Kaggle
Download sim/render.py from tuanhqv123/tars-mini: direct link, hf CLI and curl.
- Browser
- Download file 893 Bytes
-
https://huggingface.co/tuanhqv123/tars-mini/resolve/main/sim/render.py
- Command line
-
hf download hf://tuanhqv123/tars-mini/sim/render.py
-
curl -L -o render.py https://huggingface.co/tuanhqv123/tars-mini/resolve/main/sim/render.py
893 Bytes
| """Render verification videos: walk_forward and the sleep/stand lifecycle.""" | |
| import imageio.v2 as imageio, numpy as np | |
| from model import Params | |
| from sleep_pose import lifecycle, POWER | |
| from run_gaits import evaluate | |
| def save(frames, name, fps=25, step=1): | |
| imageio.mimsave(f"../results/{name}.gif", frames[::step], duration=1 / fps, loop=0) | |
| k = np.linspace(0, len(frames) - 1, 8).astype(int) | |
| sheet = np.vstack([np.hstack([frames[i] for i in k[:4]]), np.hstack([frames[i] for i in k[4:]])]) | |
| imageio.imwrite(f"../results/{name}_sheet.png", sheet[::2, ::2]) | |
| p = Params(mu=0.8, **POWER) | |
| r, s = lifecycle(p, 60, record=True, cam=dict(azimuth=0, elevation=-5, distance=0.65)) | |
| print(r); save(s.frames, "sleep_standup", step=2) | |
| r, s = evaluate(p, "walk_forward", record=True) | |
| print({k: r[k] for k in ("forward_cm", "max_tilt_deg", "yaw_deg")}); save(s.frames, "walk_forward", step=3) | |