Mask Generation
sam2
segment-anything
instance-segmentation
robotics
IB-Robot
ascend
edge-deployment
Instructions to use openEuler/sam2.1_hiera_tiny with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use openEuler/sam2.1_hiera_tiny with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained("openEuler/sam2.1_hiera_tiny") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): predictor.set_image(<your_image>) masks, _, _ = predictor.predict(<input_prompts>)# Use SAM2 with videos import torch from sam2.sam2_video_predictor import SAM2VideoPredictor predictor = SAM2VideoPredictor.from_pretrained("openEuler/sam2.1_hiera_tiny") with torch.inference_mode(), torch.autocast("cuda", dtype=torch.bfloat16): state = predictor.init_state(<your_video>) # add new prompts and instantly get the output on the same frame frame_idx, object_ids, masks = predictor.add_new_points(state, <your_prompts>) # propagate the prompts to get masklets throughout the video for frame_idx, object_ids, masks in predictor.propagate_in_video(state): ... - Notebooks
- Google Colab
- Kaggle
Add source model attribution and citation
Browse files
README.md
CHANGED
|
@@ -9,6 +9,8 @@ tags:
|
|
| 9 |
- IB-Robot
|
| 10 |
- ascend
|
| 11 |
- edge-deployment
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
# Model Card for SAM2.1 Hiera Tiny (IB-Robot)
|
|
@@ -36,10 +38,25 @@ Each Ascend deployment runs a two-stage pipeline: `encoder` then `decoder`.
|
|
| 36 |
**Encoder input:** `host.sam2.image` float32 [N,3,1024,1024] NCHW
|
| 37 |
**Decoder outputs:** `host.sam2.mask_logits` [N,1,256,256], `host.sam2.iou_predictions` [N,1], `host.sam2.low_res_masks` [N,1,256,256]
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
## Citation
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
@software{ib_robot,
|
| 42 |
-
title
|
| 43 |
-
url
|
| 44 |
license = {Apache-2.0}
|
| 45 |
}
|
|
|
|
| 9 |
- IB-Robot
|
| 10 |
- ascend
|
| 11 |
- edge-deployment
|
| 12 |
+
base_model:
|
| 13 |
+
- facebook/sam2.1-hiera-tiny
|
| 14 |
---
|
| 15 |
|
| 16 |
# Model Card for SAM2.1 Hiera Tiny (IB-Robot)
|
|
|
|
| 38 |
**Encoder input:** `host.sam2.image` float32 [N,3,1024,1024] NCHW
|
| 39 |
**Decoder outputs:** `host.sam2.mask_logits` [N,1,256,256], `host.sam2.iou_predictions` [N,1], `host.sam2.low_res_masks` [N,1,256,256]
|
| 40 |
|
| 41 |
+
## Source Model
|
| 42 |
+
|
| 43 |
+
This bundle's torch weights originate from the upstream SAM2.1 checkpoint:
|
| 44 |
+
|
| 45 |
+
- **HuggingFace:** [facebook/sam2.1-hiera-tiny](https://huggingface.co/facebook/sam2.1-hiera-tiny)
|
| 46 |
+
- **Direct checkpoint:** `https://dl.fbaipublicfiles.com/segment_anything_2/092824/sam2.1_hiera_tiny.pt`
|
| 47 |
+
|
| 48 |
+
The Ascend OM artifacts were converted from these torch weights. Download script: `scripts/download_perception_models.sh`.
|
| 49 |
+
|
| 50 |
## Citation
|
| 51 |
|
| 52 |
+
@inproceedings{sam2,
|
| 53 |
+
title = {SAM 2: Segment Anything in Images and Videos},
|
| 54 |
+
author = {Ravi, Nikhila and Gabeur, Valentin and Hu, Yuan-Ting and others},
|
| 55 |
+
booktitle = {arXiv preprint arXiv:2408.00714},
|
| 56 |
+
year = {2024}
|
| 57 |
+
}
|
| 58 |
@software{ib_robot,
|
| 59 |
+
title = {IB-Robot: Intelligence Boom Robot},
|
| 60 |
+
url = {https://gitcode.com/openeuler/IB_Robot},
|
| 61 |
license = {Apache-2.0}
|
| 62 |
}
|