pablodawson/segment-anything-automatic 🖼️🔢 → 🖼️

▶️ 5.2K runs 📅 Apr 2023 ⚙️ Cog 0.6.1 🔗 GitHub 📄 Paper ⚖️ License
image-segmentation

About

SegmentAnything Model (SAM) automatic mask generator

Example Output

Output

Example output

Performance Metrics

10.53s Prediction Time
10.66s Total Time
All Input Parameters
{
  "image": "https://replicate.delivery/pbxt/IbLtTz5PFfyk5W9GZCCKXyiyldxQyRGhmLlGo4zdCf2snIbW/chameleon.jpg",
  "resize_width": 1080,
  "box_nms_thresh": 0.7,
  "crop_nms_thresh": 0.7,
  "points_per_side": 32,
  "pred_iou_thresh": 0.88,
  "crop_overlap_ratio": 0.3413333333333333,
  "min_mask_region_area": 30,
  "stability_score_offset": 1,
  "stability_score_thresh": 0.95,
  "crop_n_points_downscale_factor": 1
}
Input Parameters
image (required) Type: string
Input image
resize_width Type: integerDefault: 1024
The width to resize the image to before running inference.
crop_n_layers Type: integerDefault: 0
If >0, mask prediction will be run again on crops of the image. Sets the number of layers to run, where each layer has 2**i_layer number of image crops
box_nms_thresh Type: numberDefault: 0.7
The box IoU cutoff used by non-maximal suppression to filter duplicate masks.
crop_nms_thresh Type: numberDefault: 0.7
The box IoU cutoff used by non-maximal suppression to filter duplicate masks between different crops.
points_per_side Type: integerDefault: 32
The number of points to be sampled along one side of the image. The total number of points is points_per_side**2. If None, point_grids must provide explicit point sampling.
pred_iou_thresh Type: numberDefault: 0.88
A filtering threshold in [0,1], using the model's predicted mask quality.
crop_overlap_ratio Type: numberDefault: 0.3413333333333333
Sets the degree to which crops overlap. In the first crop layer, crops will overlap by this fraction of the image length. Later layers with more crops scale down this overlap.
min_mask_region_area Type: integerDefault: 0
If >0, postprocessing will be applied to remove disconnected regions and holes in masks with area smaller than min_mask_region_area.
stability_score_offset Type: numberDefault: 1
The amount to shift the cutoff when calculated the stability score.
stability_score_thresh Type: numberDefault: 0.95
A filtering threshold in [0,1], using the stability of the mask under changes to the cutoff used to binarize the model's mask predictions.
crop_n_points_downscale_factor Type: integerDefault: 1
The number of points-per-side sampled in layer n is scaled down by crop_n_points_downscale_factor**n.
Output Schema

Output

Type: stringFormat: uri

Version Details
Version ID
14fbb04535964b3d0c7fad03bb4ed272130f15b956cbedb7b2f20b5b8a2dbaa0
Version Created
April 5, 2023
Run on Replicate →