Instructions to use AlexWortega/tinyvla-microduck-stage25 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use AlexWortega/tinyvla-microduck-stage25 with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Microduck
How to use AlexWortega/tinyvla-microduck-stage25 with Microduck:
# Replace SLOT with the slot specified in the model card (walk, stand, sitstand, ground_pick, kick_left, kick_right, roulade). sudo robotctl policy load SLOT AlexWortega/tinyvla-microduck-stage25
- Notebooks
- Google Colab
- Kaggle
File size: 1,292 Bytes
5d7d734 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/usr/bin/env python3
from __future__ import annotations
import argparse
import base64
import json
import urllib.request
from pathlib import Path
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--url", default="http://127.0.0.1:8080")
parser.add_argument("--image", type=Path, required=True)
parser.add_argument(
"--state",
type=Path,
required=True,
help="JSON file containing a 61-float array.",
)
parser.add_argument("--instruction", required=True)
parser.add_argument("--control-index", type=int, default=0)
args = parser.parse_args()
payload = {
"image_jpeg_base64": base64.b64encode(args.image.read_bytes()).decode(),
"state": json.loads(args.state.read_text()),
"instruction": args.instruction,
"control_index": args.control_index,
"autonomous_recovery": True,
}
request = urllib.request.Request(
f"{args.url.rstrip('/')}/predict",
data=json.dumps(payload).encode(),
headers={"Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(request) as response:
result = json.load(response)
print(json.dumps(result, indent=2))
if __name__ == "__main__":
main()
|