Update README.md
Browse files
README.md
CHANGED
@@ -7,6 +7,11 @@ language:
|
|
7 |
base_model:
|
8 |
- allenai/Molmo-7B-D-0924
|
9 |
pipeline_tag: robotics
|
|
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
# GraspMolmo
|
@@ -42,4 +47,32 @@ Running the above code could result in the following output:
|
|
42 |
In order to accomplish the task "Pour coffee from the blue mug.", the optimal grasp is described as follows: "The grasp is on the middle handle of the blue mug, with fingers grasping the sides of the handle.".
|
43 |
|
44 |
<point x="28.6" y="20.7" alt="Where to grasp the object">Where to grasp the object</point>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
```
|
|
|
7 |
base_model:
|
8 |
- allenai/Molmo-7B-D-0924
|
9 |
pipeline_tag: robotics
|
10 |
+
tags:
|
11 |
+
- robotics
|
12 |
+
- grasping
|
13 |
+
- task-oriented-grasping
|
14 |
+
- manipulation
|
15 |
---
|
16 |
|
17 |
# GraspMolmo
|
|
|
47 |
In order to accomplish the task "Pour coffee from the blue mug.", the optimal grasp is described as follows: "The grasp is on the middle handle of the blue mug, with fingers grasping the sides of the handle.".
|
48 |
|
49 |
<point x="28.6" y="20.7" alt="Where to grasp the object">Where to grasp the object</point>
|
50 |
+
```
|
51 |
+
|
52 |
+
## Grasp Inference
|
53 |
+
|
54 |
+
To predict a grasp point *and* match it to one of the candidate grasps, refer to the [GraspMolmo](https://github.com/abhaybd/GraspMolmo/blob/main/graspmolmo/inference/grasp_predictor.py) class.
|
55 |
+
First, install `graspmolmo` with
|
56 |
+
|
57 |
+
```bash
|
58 |
+
pip install "git+https://github.com/abhaybd/GraspMolmo.git#egg=graspmolmo[infer]"
|
59 |
+
```
|
60 |
+
|
61 |
+
and then inference can be run as follows:
|
62 |
+
|
63 |
+
```python
|
64 |
+
from graspmolmo.inference.grasp_predictor import GraspMolmo
|
65 |
+
|
66 |
+
task = "..."
|
67 |
+
rgb, depth = get_image()
|
68 |
+
camera_intrinsics = np.array(...)
|
69 |
+
|
70 |
+
point_cloud = backproject(rgb, depth, camera_intrinsics)
|
71 |
+
# grasps are in the camera reference frame
|
72 |
+
grasps = predict_grasps(point_cloud) # Using your favorite grasp predictor (e.g. M2T2)
|
73 |
+
|
74 |
+
gm = GraspMolmo()
|
75 |
+
idx = gm.pred_grasp(rgb, point_cloud, task, grasps)
|
76 |
+
|
77 |
+
print(f"Predicted grasp: {grasps[idx]}")
|
78 |
```
|