Skip to content

feat: add support for FastSAM model with point, box and text prompts#1120

Open
barhanc wants to merge 6 commits intomainfrom
@bh/add-fast-sam
Open

feat: add support for FastSAM model with point, box and text prompts#1120
barhanc wants to merge 6 commits intomainfrom
@bh/add-fast-sam

Conversation

@barhanc
Copy link
Copy Markdown
Contributor

@barhanc barhanc commented May 5, 2026

Description

Adds support for FastSAM model with required postprocessing for point, box and text (using already existing CLIP export) prompts. Also adds an example app to test these.

Since FastSAM uses YOLO instance segmentation backbone with some clever postprocessing to imitate Facebook's SAM (see https://docs.ultralytics.com/models/fast-sam/#model-architecture), we use the existing instance segmentation C++ implementation and add TS postprocessing to minimize code duplication.

Introduces a breaking change?

  • Yes
  • No

Type of change

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Documentation update (improves or adds clarity to existing documentation)
  • Other (chores, tests, code style improvements etc.)

Tested on

  • iOS
  • Android

Testing instructions

Screenshots

You can use following image for testing.

https://upload.wikimedia.org/wikipedia/commons/c/cd/Animal_diversity_October_2007.jpg

Simulator Screenshot - iPhone 17 Pro - 2026-05-06 at 23 12 00 Simulator Screenshot - iPhone 17 Pro - 2026-05-06 at 23 15 22

Related issues

Closes #555

Checklist

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • My changes generate no new warnings

Additional notes

@barhanc barhanc self-assigned this May 5, 2026
@barhanc barhanc added feature PRs that implement a new feature model Issues related to exporting, improving, fixing ML models labels May 5, 2026
@barhanc barhanc changed the title feat: add support for FastSAM model with point and box prompts feat: add support for FastSAM model with point, box and text prompts May 6, 2026
@barhanc barhanc marked this pull request as ready for review May 6, 2026 22:12
@barhanc barhanc requested review from chmjkb and msluszniak May 6, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature PRs that implement a new feature model Issues related to exporting, improving, fixing ML models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SAM - segment anything model

1 participant