facebookresearch / facebookresearch/segment-anything

Multiple coords + Multiple boxes + Multiple labels solution - Need suggest

Open
#723 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
54.9k
Forks
6.4k
PR merge metrics
No merged PRs in 30d

Description

i implemented in my code

```predictor = SamPredictor(self.sam)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
predictor.set_image(image)

input_boxes = np.array(boxes) if len(boxes) > 0 else None
input_boxes = torch.tensor(input_boxes, device=predictor.device)
transformed_boxes = predictor.transform.apply_boxes_torch(input_boxes, image.shape[:2])

masks, scores, logits = predictor.predict_torch(
point_coords=None,
point_labels=None,
boxes=transformed_boxes,
multimask_output=False,
)
```

how can i use multiple coord and labels ? What format it is ?
Thanks for help.

Contributor guide

Open the contributing guide

Research direction

Start with the SamPredictor usage shown in the issue, especially predict_torch and its point_coords and point_labels parameters, then compare the repository’s example notebooks. Document the accepted format for multiple coordinates and labels alongside the existing boxes example, and verify that the example explains how the inputs correspond to the returned masks.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, opencv, python, pytorch
Domain
computer-vision, documentation, machine-learning
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.