Views
No views yet
| Domain | Mean IoU | Mean Dice | Best Class | Worst Class |
|---|---|---|---|---|
| Satellite | 65% | 71% | Building (78%) | Water (52%) |
| Fashion | 62% | 68% | Shirt (75%) | Shoes (48%) |
| Robotics | 59% | 65% | Robot (72%) | Safety (45%) |
| Domain | Mean IoU | Mean Dice | Best Class | Worst Class |
|---|---|---|---|---|
| Satellite | 42% | 48% | Building (62%) | Water (28%) |
| Fashion | 38% | 45% | Shirt (58%) | Shoes (25%) |
| Robotics | 35% | 42% | Robot (55%) | Safety (22%) |
1pip install -r requirements.txt
2python scripts/download_sam2.py1from models.sam2_fewshot import SAM2FewShot
2
3# Initialize model
4model = SAM2FewShot(
5 sam2_checkpoint="sam2_checkpoint",
6 device="cuda"
7)
8
9# Add support examples
10model.add_few_shot_example("satellite", "building", image, mask)
11
12# Perform segmentation
13predictions = model.segment(
14 query_image,
15 "satellite",
16 ["building"],
17 use_few_shot=True
18)1from models.sam2_zeroshot import SAM2ZeroShot
2
3# Initialize model
4model = SAM2ZeroShot(
5 sam2_checkpoint="sam2_checkpoint",
6 device="cuda"
7)
8
9# Perform zero-shot segmentation
10predictions = model.segment(
11 image,
12 "fashion",
13 ["shirt", "pants", "dress", "shoes"]
14)├── models/
│ ├── sam2_fewshot.py # Few-shot learning model
│ └── sam2_zeroshot.py # Zero-shot learning model
├── experiments/
│ ├── few_shot_satellite.py # Satellite experiments
│ └── zero_shot_fashion.py # Fashion experiments
├── utils/
│ ├── data_loader.py # Domain-specific data loaders
│ ├── metrics.py # Comprehensive evaluation metrics
│ └── visualization.py # Visualization tools
├── scripts/
│ └── download_sam2.py # Setup script
└── notebooks/
└── analysis.ipynb # Interactive analysis1@misc{sam2_fewshot_zeroshot_2024,
2 title={SAM 2 Few-Shot/Zero-Shot Segmentation: Domain Adaptation with Minimal Supervision},
3 author={Your Name},
4 year={2024},
5 url={https://huggingface.co/esalguero/Segmentation}
6}research_paper.md for complete methodologynotebooks/analysis.ipynb for exploration