xocialize commited on
Commit
42ee2c3
·
verified ·
1 Parent(s): 9312390

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +39 -0
README.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: mlx
3
+ license: apache-2.0
4
+ license_link: https://github.com/facebookresearch/EdgeTAM/blob/main/LICENSE
5
+ base_model: facebookresearch/EdgeTAM
6
+ pipeline_tag: image-segmentation
7
+ tags:
8
+ - mlx
9
+ - segmentation
10
+ - promptable-segmentation
11
+ - sam2
12
+ - edgetam
13
+ ---
14
+
15
+ # mlx-community/EdgeTAM-fp16
16
+
17
+ [EdgeTAM](https://github.com/facebookresearch/EdgeTAM) — on-device SAM 2 for promptable segmentation —
18
+ converted to **Apple MLX** (`-fp16`) for the [`mlx-edgetam-swift`](https://github.com/xocialize/mlx-edgetam-swift)
19
+ Swift package (MLXEngine `promptSegment` ModelPackage). **Image-mode** (point/box → mask); 22× faster
20
+ than SAM 2, 16 FPS on iPhone 15 Pro Max.
21
+
22
+ From-scratch MLX-Swift architecture port: RepViT-M1 image encoder + FPN + SAM prompt encoder + two-way
23
+ mask decoder. Parity-locked vs the PyTorch oracle on the CPU stream (image_embed 9.7e-6, mask logits
24
+ 8.9e-5). This `-fp16` build is functionally identical (end-to-end mask **IoU 0.99** vs PyTorch; the
25
+ thresholded mask absorbs fp16 weight-rounding).
26
+
27
+ ## Use
28
+
29
+ ```swift
30
+ // Package.swift → .package(url: "https://github.com/xocialize/mlx-edgetam-swift", from: "0.1.0")
31
+ import EdgeTAM
32
+ let predictor = try EdgeTAMPredictor.fromPretrained(weightsPath, dtype: .float16)
33
+ predictor.setImage(sourceCGImage)
34
+ let (mask, score, _, _) = predictor.predict(point: (500, 375)) // click → object mask
35
+ ```
36
+
37
+ Or as an MLXEngine `promptSegment` ModelPackage (`MLXEdgeTAM.EdgeTAMPackage`), resolving this repo via the Hub.
38
+
39
+ Weights: Apache-2.0 (facebookresearch/EdgeTAM). Port code: MIT.