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_fall_sole90.py from tuanhqv123/tars-mini: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/tuanhqv123/tars-mini/resolve/main/sim/render_fall_sole90.py
- Command line
-
hf download hf://tuanhqv123/tars-mini/sim/render_fall_sole90.py
-
curl -L -o render_fall_sole90.py https://huggingface.co/tuanhqv123/tars-mini/resolve/main/sim/render_fall_sole90.py
1.29 kB
| """GIF segments: get up after a fall (90 mm soles), from lying on its back (screen up) and from lying face-down (screen down). | |
| Same motion as the verified fall_up / fall_down trials (24/24 each): legs over the top to make the V, then close the V.""" | |
| import math | |
| from cad_verify_sole90 import CAD, M, TarsSim, s_curve | |
| from render2 import Recorder | |
| def quat_x(deg): | |
| a = math.radians(deg) / 2 | |
| return [math.cos(a), math.sin(a), 0, 0] | |
| for q, name, label in ((-90, "seg_fall_back", "fell on its back"), (90, "seg_fall_face", "fell face-down")): # -90 -> screen up (checked) | |
| kw = dict(CAD); kw["pad_D"] = 0.090 | |
| p = M.Params(mu=0.8, **kw); s = TarsSim(p) | |
| s.d.qpos[3:7] = quat_x(q); s.d.qpos[2] = p.D / 2 + 0.002 | |
| s.set_angles(sL=360, sR=360); s.d.qpos[s.qa["sL"]] = s.d.qpos[s.qa["sR"]] = math.radians(360) | |
| rec = Recorder(s, [("3/4 view", 135, -18, 0.95), ("side view", 90, -6, 0.95)]) | |
| rec.caption = f"5. Get up after a fall ({label})"; s.run(1.0) | |
| rec.caption = f"5. Get up ({label}): legs over the top to make the V"; s_curve(s, dict(sL=170, sR=170), 5.0) | |
| rec.caption = f"5. Get up ({label}): close the V"; s_curve(s, dict(sL=0, sR=0), 6.0); s.run(1.0) | |
| rec.save(f"../results/{name}.gif", speedup=3) | |
| print(name, "final tilt", round(s.tilt_deg(), 1)) | |