Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of SAM2.1 Annotator for Instance Segmentation #79

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

HonzaCuhel
Copy link
Contributor

@HonzaCuhel HonzaCuhel commented Jan 31, 2025

This PR

  • adds the SAM2.1 image annotator for instance segmentation
  • adds valid links for Luxonis logo in the .ipynb

SAM2.1 Info

Model # Params (M) Designation in DD
SAM2.1 Hiera Base Plus 80.8 base
SAM2.1 Hiera Large 224.4 large

SAM2.1 Latency

Here are the measured times per prompt for various batch sizes of SLM:

Model Latency [ms]
SAM2.1 Hiera Base Plus 67.49±11.53
SAM2.1 Hiera Large 123.85±11.68
SlimSAM Base 206.01±3.20
SlimSAM Large 224.14±2.17

*Times are measured and averaged across 100 runs per 1 image for batch size of 4 on a JH device with 1 NVIDIA L4 GPU (24GB), 16 CPUs and 30 GB RAM.
** I measured the SlimSAM times several times, so the numbers should be correct, but it's definitely interesting. The SAM2 uses torch.bfloat16 during annotation + supports batch annotation, and performance looks better.

Examples

bbox_2(2)
bbox_5(1)
bbox_0(1)
bbox_6(1)

@HonzaCuhel HonzaCuhel self-assigned this Jan 31, 2025
Copy link

github-actions bot commented Jan 31, 2025

Test Results

  6 files    6 suites   3h 16m 44s ⏱️
 77 tests  58 ✅  19 💤 0 ❌
462 runs  344 ✅ 118 💤 0 ❌

Results for commit f8ef89c.

♻️ This comment has been updated with latest results.

@sokovninn
Copy link
Member

Have you benchmarked SlimSAM in a similar way? I wonder how they compare.

@HonzaCuhel
Copy link
Contributor Author

Yeah, I did, I'll share the results later.

@HonzaCuhel HonzaCuhel marked this pull request as draft February 3, 2025 08:17
Copy link

github-actions bot commented Feb 4, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
1852 1155 62% 0% 🟢

New Files

File Coverage Status
datadreamer/dataset_annotation/sam2_annotator.py 75% 🟢
TOTAL 75% 🟢

Modified Files

File Coverage Status
datadreamer/dataset_annotation/init.py 100% 🟢
datadreamer/pipelines/generate_dataset_from_scratch.py 38% 🟢
datadreamer/utils/config.py 100% 🟢
TOTAL 79% 🟢

updated for commit: f8ef89c by action🐍

@HonzaCuhel HonzaCuhel marked this pull request as ready for review February 4, 2025 10:14
@HonzaCuhel HonzaCuhel merged commit c3e70f2 into dev Feb 4, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants