Instructions to use AtlasAnalyticsLab/AtlasPatch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sam2
How to use AtlasAnalyticsLab/AtlasPatch with sam2:
# Use SAM2 with images import torch from sam2.sam2_image_predictor import SAM2ImagePredictor predictor = SAM2ImagePredictor.from_pretrained(AtlasAnalyticsLab/AtlasPatch) 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(AtlasAnalyticsLab/AtlasPatch) 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
Commit ·
854d6dd
1
Parent(s): fa7fa03
docs: update installation guide with SAM2 requirement
Browse files
README.md
CHANGED
|
@@ -20,7 +20,11 @@ Segmentation model for whole-slide image (WSI) thumbnails, built on **Segment An
|
|
| 20 |
Install dependencies:
|
| 21 |
|
| 22 |
```bash
|
|
|
|
| 23 |
pip install atlas-patch
|
|
|
|
|
|
|
|
|
|
| 24 |
```
|
| 25 |
|
| 26 |
Recommended: use the same components we ship in AtlasPatch. The segmentation service will (a) load your WSI with the registered backend, (b) build a 1.25× power thumbnail, (c) resize it to 1024×1024, (d) run SAM2 with a full-frame box, and (e) return a mask aligned to the thumbnail.
|
|
@@ -79,4 +83,14 @@ This model is released under **CC-BY-NC-SA-4.0**, which strictly disallows comme
|
|
| 79 |
|
| 80 |
## Citation
|
| 81 |
|
| 82 |
-
If you use this model, please cite
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
Install dependencies:
|
| 21 |
|
| 22 |
```bash
|
| 23 |
+
# Install AtlasPatch
|
| 24 |
pip install atlas-patch
|
| 25 |
+
|
| 26 |
+
# Install SAM2 (required for tissue segmentation)
|
| 27 |
+
pip install git+https://github.com/facebookresearch/sam2.git
|
| 28 |
```
|
| 29 |
|
| 30 |
Recommended: use the same components we ship in AtlasPatch. The segmentation service will (a) load your WSI with the registered backend, (b) build a 1.25× power thumbnail, (c) resize it to 1024×1024, (d) run SAM2 with a full-frame box, and (e) return a mask aligned to the thumbnail.
|
|
|
|
| 83 |
|
| 84 |
## Citation
|
| 85 |
|
| 86 |
+
If you use this model, please cite our paper:
|
| 87 |
+
|
| 88 |
+
```bibtex
|
| 89 |
+
@article{atlaspatch2025,
|
| 90 |
+
title = {AtlasPatch: An Efficient and Scalable Tool for Whole Slide Image Preprocessing in Computational Pathology},
|
| 91 |
+
author = {Alagha, Ahmed and Leclerc, Christopher and Kotp, Yousef and Abdelwahed, Omar and Moras, Calvin and Rentopoulos, Peter and Rostami, Rose and Nguyen, Bich Ngoc and Baig, Jumanah and Khellaf, Abdelhakim and Trinh, Vincent Quoc-Huy and Mizouni, Rabeb and Otrok, Hadi and Bentahar, Jamal and Hosseini, Mahdi S.},
|
| 92 |
+
journal = {arXiv},
|
| 93 |
+
year = {2025},
|
| 94 |
+
url = {TODO: coming soon}
|
| 95 |
+
}
|
| 96 |
+
```
|