facebookresearch / facebookresearch/sam3

[HELP] Is it possible to fine tune with no text prompt?

Open
#515 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11.7k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

https://github.com/facebookresearch/sam3/issues/163
> ### Practical steps to fine-tune
> 1. Choose whether you train on images or videos.
> 2. Prepare media:
>
> * Images: place images in a folder and reference their path in your config.
> * Videos: extract frames into per-video folders (frame filenames must match annotation file_names).
> * Repo provides helper scripts for downloading/extraction for several public datasets (scripts/eval/*).
> 3. Create annotation JSON:
>
> * For images: COCO-like JSON; include noun_phrase per annotation.
> * For videos: YTVIS-like JSON (videos + annotations) with per-frame segmentations and noun_phrase.
> 4. Update a training YAML config:
>
> * Set dataset root paths (e.g., roboflow_vl_100_root or odinw_data_root used by the repo examples).
> * Set batch size, learning rate, checkpoint paths, number of epochs or iterations. If starting from a SAM‑3 checkpoint, point the model init path to the provided checkpoint (use the repo’s checkpoint download links).
> 5. Run training:
>
> * python sam3/train/train.py -c
> 6. Validate / iterate:
>
> * Use evaluation scripts in scripts/eval/... to inspect outputs and run quantitative eval on SA‑Co datasets if desired.
>
> ### Tips and gotchas
> * Negative prompts: SA‑Co datasets include noun-phrases that have no matching masks (negative). For training, include such phrases as queries associated with an image/video but with no masks in annotations — the training code supports phrases without positive masks.
> * Frame filenames and annotation file_names must match exactly for video evaluation.
> * If you have videos, prefer extracting frames at the fps that matches your annotations (common options used in repo: 6fps or 24fps).
> * Keep category mapping simple (many SA‑Co setups use a single category id and rely on noun_phrase to provide the concept). Check configs for category handling examples.
> * Optional metadata: dataset code can ingest additional metadata (e.g., blurring_mask). If you need to mask out parts of images, include such fields in image metadata.

I am wondering if a text prompt / text annotation is required for fine tuning and later inferencing?

We do not have meaningful text prompts with our training data. Ideally, no prompt is required. Give an image, return labeled masks.

If not:
1. Would a dummy, constant text prompt work?
2. What about point prompts? Is it possible to not supply text prompts, but supply a point prompt?

Thanks.

Contributor guide

Open the contributing guide

Research direction

Start with sam3/train/train.py, the training YAML configurations, and the evaluation scripts under scripts/eval/*. Trace how noun_phrase, dummy text, and point prompts are handled for training and inference. Done means establishing whether text is required, whether point-only input is supported, and what documentation or implementation change would be needed.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.