facebookresearch / facebookresearch/segment-anything

Trying to use SAM to segment engineering rock samples, but I need to solve two issues

Open
#749 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
54.9k
Forks
6.4k
PR merge metrics
No merged PRs in 30d

Description

Hello, I am trying to use SAM to segment engineering rock samples as follows:
![企业微信截图_17152698856512](https://github.com/facebookresearch/segment-anything/assets/9004748/85a358a0-4a83-4936-b054-5f8736b3959a)
Here's a photo that contains a box of rock samples, and what I need to do is segment all the rocks and then choose the ones that is longer than a specific length(as we know the length of the box, we can easily calculate the length of each rock based on its pixel size).

By using SAM SamAutomaticMaskGenerator, I can get the segmented elements of this photo as follows:
![企业微信截图_17152701264210](https://github.com/facebookresearch/segment-anything/assets/9004748/5d103e91-a93f-49e9-9fa9-ff7228f67b04)

However, there're two issues which I think should be solved first so that my final target can be reached:
The first one is the overlapping elements. As SAM may have **overlapping segment elements**, I may count **repeated** rocks. Is it possible to make SAM generate all non-overlapping elements?
The second one is how to separate the rocks from backgrounds. SAM segments everything including photo background, and is it possible so that I can only segment rocks?

I appreciate if anyone could help solve this issue. Thank you !

Contributor guide

Open the contributing guide

Research direction

Start with the SamAutomaticMaskGenerator entry point and the provided rock-sample images. Determine whether the requested non-overlapping masks and rock-only filtering are supported by the current interface, and define the expected mask output for both cases before assessing a change.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.