Image Segmentation
PyTorch
sam2
semantic-segmentation
microstructure
materials-science
segment-anything-2
lora
Instructions to use WUT-AI-AI4Mat/microstructure-sam2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use WUT-AI-AI4Mat/microstructure-sam2 with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained(WUT-AI-AI4Mat/microstructure-sam2) 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(WUT-AI-AI4Mat/microstructure-sam2) 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
Upload model card and dataset checkpoints
Browse files- README.md +4 -4
- checkpoint_manifest.json +1 -1
README.md
CHANGED
|
@@ -21,7 +21,7 @@ the exact `sam2.1_hiera_base_plus.pt` base checkpoint and
|
|
| 21 |
`configs/sam2.1/sam2.1_hiera_b+.yaml`.
|
| 22 |
|
| 23 |
Source code:
|
| 24 |
-
https://github.com/WUT-AI-AI4Mat/
|
| 25 |
|
| 26 |
## Fine-Tuning Routes and Checkpoints
|
| 27 |
|
|
@@ -81,9 +81,9 @@ class count from the table.
|
|
| 81 |
## Inference Parameters
|
| 82 |
|
| 83 |
Automatic mask generation uses `points_per_side=32`, `points_per_batch=64`,
|
| 84 |
-
`pred_iou_thresh=0.8`, `stability_score_thresh=0.8`,
|
| 85 |
-
Padded regions are removed before predictions are restored
|
| 86 |
-
image size.
|
| 87 |
|
| 88 |
## Evaluation, Intended Use, and Limitations
|
| 89 |
|
|
|
|
| 21 |
`configs/sam2.1/sam2.1_hiera_b+.yaml`.
|
| 22 |
|
| 23 |
Source code:
|
| 24 |
+
https://github.com/WUT-AI-AI4Mat/Segmentation-methods-evaluation-for-quantitative-microstructure-analysis
|
| 25 |
|
| 26 |
## Fine-Tuning Routes and Checkpoints
|
| 27 |
|
|
|
|
| 81 |
## Inference Parameters
|
| 82 |
|
| 83 |
Automatic mask generation uses `points_per_side=32`, `points_per_batch=64`,
|
| 84 |
+
`pred_iou_thresh=0.8`, `stability_score_thresh=0.8`, `box_nms_thresh=0.7`, and
|
| 85 |
+
`crop_n_layers=0`. Padded regions are removed before predictions are restored
|
| 86 |
+
to the original image size.
|
| 87 |
|
| 88 |
## Evaluation, Intended Use, and Limitations
|
| 89 |
|
checkpoint_manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"model": "SAM2.1 Hiera Base+",
|
| 3 |
-
"source_code": "https://github.com/WUT-AI-AI4Mat/
|
| 4 |
"checkpoint_count": 7,
|
| 5 |
"checkpoints": [
|
| 6 |
{
|
|
|
|
| 1 |
{
|
| 2 |
"model": "SAM2.1 Hiera Base+",
|
| 3 |
+
"source_code": "https://github.com/WUT-AI-AI4Mat/Segmentation-methods-evaluation-for-quantitative-microstructure-analysis",
|
| 4 |
"checkpoint_count": 7,
|
| 5 |
"checkpoints": [
|
| 6 |
{
|