upload model
Browse files
README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- anthonyav/so100-lego-v3
|
| 5 |
+
language:
|
| 6 |
+
- zh
|
| 7 |
+
- en
|
| 8 |
+
base_model:
|
| 9 |
+
- lerobot/pi0fast_base
|
| 10 |
+
---
|
| 11 |
+
# Model Description
|
| 12 |
+
so100-pi0fast is the finetuned result of Hangzhou Theseus Yihai Rong Silicon Technology Co., LTD. based on the lerobot/pi0fast-base model and the anthonyav/so100-lego-v3 dataset
|
| 13 |
+
# How to use
|
| 14 |
+
```shell
|
| 15 |
+
from lerobot.common.policies.pi0fast.modeling_pi0fast import PI0FASTPolicy
|
| 16 |
+
|
| 17 |
+
policy = PI0FASTPolicy.from_pretrained("Xiaoyan97/so100-pi0fast")
|
| 18 |
+
policy.eval()
|
| 19 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 20 |
+
policy.to(device)
|
| 21 |
+
while True:
|
| 22 |
+
start_time = time.perf_counter()
|
| 23 |
+
obs = robot.capture_observation()
|
| 24 |
+
for key in obs:
|
| 25 |
+
if "image" in key:
|
| 26 |
+
img = obs[key].type(torch.float32) / 255
|
| 27 |
+
obs[key] = img.permute(2, 0, 1).unsqueeze(0)
|
| 28 |
+
else:
|
| 29 |
+
obs[key] = obs[key].unsqueeze(0)
|
| 30 |
+
obs[key] = obs[key]
|
| 31 |
+
obs["task"] = [prompt]
|
| 32 |
+
with torch.no_grad():
|
| 33 |
+
action = policy.select_action(obs).squeeze(0).cpu().numpy()
|
| 34 |
+
robot.send_action(torch.tensor(action))
|
| 35 |
+
dt = time.perf_counter() - start_time
|
| 36 |
+
busy_wait(1 / 30 - dt)
|
| 37 |
+
print(f"Frame processed in {dt:.4f} seconds")
|
| 38 |
+
```
|