Update README.md
Browse files
README.md
CHANGED
|
@@ -37,6 +37,18 @@ embedding = session.run(None, {"latlon": coordinates})[0] # shape [2, 3072]
|
|
| 37 |
deploy_embedding = embedding[:, :64]
|
| 38 |
```
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
The ONNX graph expects `latlon` with shape `[N, 2]` in `(lat, lon)` order and returns the full 3,072-dimensional trunk.
|
| 41 |
Use the leading 64 columns as the deployment embedding. The safetensors and PyTorch files are also available for users
|
| 42 |
who have a compatible loader.
|
|
|
|
| 37 |
deploy_embedding = embedding[:, :64]
|
| 38 |
```
|
| 39 |
|
| 40 |
+
Or use `torch.hub`
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
import torch
|
| 44 |
+
|
| 45 |
+
model = torch.hub.load("taylor-geospatial/mind", "mind", trust_repo=True)
|
| 46 |
+
coords = torch.tensor([[37.77, -122.42], [51.51, -0.13]]) # latitude, longitude
|
| 47 |
+
with torch.inference_mode():
|
| 48 |
+
full = model(coords, return_features=True) # [2, 3072]
|
| 49 |
+
features = full[:, :64] # [2, 64]
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
The ONNX graph expects `latlon` with shape `[N, 2]` in `(lat, lon)` order and returns the full 3,072-dimensional trunk.
|
| 53 |
Use the leading 64 columns as the deployment embedding. The safetensors and PyTorch files are also available for users
|
| 54 |
who have a compatible loader.
|