Update README with conversion note about key format compatibility
Browse files
README.md
CHANGED
|
@@ -32,9 +32,23 @@ SAM3 (Segment Anything Model 3) is Meta AI's state-of-the-art foundation model f
|
|
| 32 |
|
| 33 |
| File | Description |
|
| 34 |
|---|---|
|
| 35 |
-
| `sam3.safetensors` | Model weights (safetensors format) |
|
| 36 |
| `LICENSE` | SAM License (required for redistribution) |
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
## Usage
|
| 39 |
|
| 40 |
```python
|
|
|
|
| 32 |
|
| 33 |
| File | Description |
|
| 34 |
|---|---|
|
| 35 |
+
| `sam3.safetensors` | Model weights (safetensors format, converted from official `.pt`) |
|
| 36 |
| `LICENSE` | SAM License (required for redistribution) |
|
| 37 |
|
| 38 |
+
## ⚠️ Conversion Note
|
| 39 |
+
|
| 40 |
+
The `sam3.safetensors` in this repo is converted **directly from the official `sam3.pt`** checkpoint using:
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
import torch
|
| 44 |
+
from safetensors.torch import save_file
|
| 45 |
+
|
| 46 |
+
state_dict = torch.load("sam3.pt", map_location="cpu")
|
| 47 |
+
save_file(state_dict, "sam3.safetensors")
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
This preserves the original key names (`detector.*`, `tracker.*`). Do **not** use the HuggingFace Transformers-format safetensors from `facebook/sam3` — those have different key names (`detector_model.*`) and are **incompatible** with `build_sam3_video_model()`.
|
| 51 |
+
|
| 52 |
## Usage
|
| 53 |
|
| 54 |
```python
|