Delete SAM3_DTMODEL_BUILD_GUIDE.md
Browse files- SAM3_DTMODEL_BUILD_GUIDE.md +0 -94
SAM3_DTMODEL_BUILD_GUIDE.md
DELETED
|
@@ -1,94 +0,0 @@
|
|
| 1 |
-
# Create a SAM 3 `.dtmodel` for darktable 5.6
|
| 2 |
-
|
| 3 |
-
## Important License Note
|
| 4 |
-
|
| 5 |
-
This guide does not redistribute SAM3 weights or converted ONNX files.
|
| 6 |
-
|
| 7 |
-
SAM3 is gated on Hugging Face and distributed under the Meta SAM License. You must request access from Meta, download `sam3.pt` yourself, and run the conversion locally.
|
| 8 |
-
|
| 9 |
-
This repo only provides:
|
| 10 |
-
|
| 11 |
-
```text
|
| 12 |
-
export_sam3.py
|
| 13 |
-
mask-object-sam3/config.json
|
| 14 |
-
```
|
| 15 |
-
|
| 16 |
-
The generated files are for your local use:
|
| 17 |
-
|
| 18 |
-
```text
|
| 19 |
-
mask-object-sam3/encoder.onnx
|
| 20 |
-
mask-object-sam3/decoder.onnx
|
| 21 |
-
mask-object-sam3.dtmodel
|
| 22 |
-
```
|
| 23 |
-
|
| 24 |
-
## Prerequisites
|
| 25 |
-
|
| 26 |
-
Install `uv`.
|
| 27 |
-
|
| 28 |
-
Install `git`.
|
| 29 |
-
|
| 30 |
-
Create a Hugging Face account:
|
| 31 |
-
|
| 32 |
-
```text
|
| 33 |
-
https://huggingface.co/
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
Request access to SAM3:
|
| 37 |
-
|
| 38 |
-
```text
|
| 39 |
-
https://huggingface.co/facebook/sam3
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
After access is approved, download `sam3.pt` from the `Files and versions` tab.
|
| 43 |
-
|
| 44 |
-
## Clone This Repo
|
| 45 |
-
|
| 46 |
-
```bash
|
| 47 |
-
git clone https://huggingface.co/AyedaOk/darktable-sam3
|
| 48 |
-
cd darktable-sam3
|
| 49 |
-
```
|
| 50 |
-
|
| 51 |
-
Copy `sam3.pt` into the repo root:
|
| 52 |
-
|
| 53 |
-
```text
|
| 54 |
-
darktable-sam3/sam3.pt
|
| 55 |
-
```
|
| 56 |
-
|
| 57 |
-
The folder should look like this before conversion:
|
| 58 |
-
|
| 59 |
-
```text
|
| 60 |
-
darktable-sam3/
|
| 61 |
-
export_sam3.py
|
| 62 |
-
sam3.pt
|
| 63 |
-
mask-object-sam3/
|
| 64 |
-
config.json
|
| 65 |
-
```
|
| 66 |
-
|
| 67 |
-
## Build the `.dtmodel`
|
| 68 |
-
|
| 69 |
-
Run:
|
| 70 |
-
|
| 71 |
-
```bash
|
| 72 |
-
uv run export_sam3.py
|
| 73 |
-
```
|
| 74 |
-
|
| 75 |
-
The first run can take a while because `uv` downloads Python dependencies such as PyTorch, ONNX, and ONNXRuntime.
|
| 76 |
-
|
| 77 |
-
The script will:
|
| 78 |
-
|
| 79 |
-
```text
|
| 80 |
-
clone facebookresearch/sam3 into ./sam3 if missing
|
| 81 |
-
pin SAM3 to the tested commit
|
| 82 |
-
load ./sam3.pt
|
| 83 |
-
export encoder.onnx and decoder.onnx
|
| 84 |
-
package mask-object-sam3.dtmodel
|
| 85 |
-
```
|
| 86 |
-
|
| 87 |
-
The generated files should be:
|
| 88 |
-
|
| 89 |
-
```text
|
| 90 |
-
mask-object-sam3/encoder.onnx
|
| 91 |
-
mask-object-sam3/decoder.onnx
|
| 92 |
-
mask-object-sam3/config.json
|
| 93 |
-
mask-object-sam3.dtmodel
|
| 94 |
-
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|