Skip to main content

ImageSegment

20 tools in this family (folder Editor/Tools/ImageSegment/ in the bridge package). Effect: writes changes the project or the scene, read-only does not, destructive deletes or overwrites and the client asks before running it.

ToolEffectDescription
image_segment_batch_segment_folderwritesAuto-segment every image in a folder (recursive=false). Each image becomes one job,
image_segment_classify_foreground_backgroundwritesRun the heuristic foreground/background classifier on every mask of a job. Rules:
image_segment_emit_batch_pipelinewritesGenerate a MonoBehaviour that loops every image in a folder, calls a user-provided
image_segment_emit_replicate_clientwritesGenerate a MonoBehaviour that POSTs an image to Replicate, polls the prediction,
image_segment_emit_sentis_local_setupwritesGenerate a MonoBehaviour that loads a SAM2 ONNX model with Unity.Sentis and runs
image_segment_estimate_costread-onlyEstimate per-image cost for each backend at the given resolution (defaults to 1024x768).
image_segment_export_mask_pngwritesWrite a mask as a PNG to output_path. If the mask was generated on disk by the mock
image_segment_export_masked_regionwritesCrop the source image to the mask's bounding box and write the cropped pixels to
image_segment_export_setupread-onlyReturn the full family configuration snapshot — active backend, backend probe results,
image_segment_get_backend_statusread-onlyProbe every backend and return the availability + key configuration matrix.
image_segment_get_job_statusread-onlyLook up a segmentation job by id. Returns Status (Queued/Running/Completed/Failed/Cancelled),
image_segment_initwritesInitialize the image_segment_* family. Creates Library/ImageSegmentMock/ if missing,
image_segment_list_masksread-onlyList every mask produced by a job — id, bounding box, area, centroid, classification,
image_segment_segment_everythingwritesAuto-segment every object in an image (SAM2 'segment everything' mode). Routes through the
image_segment_segment_with_boxwritesSegment one object using a bounding-box prompt — useful when the user can roughly draw
image_segment_segment_with_pointwritesSegment one object using a single point prompt — SAM2's primary interaction. Pass
image_segment_set_backendwritesSet the active segmentation backend for subsequent image_segment_* calls.
image_segment_set_huggingface_keywritesStore the Hugging Face API key encrypted in EditorPrefs (AES-CBC, key derived from the project path)…
image_segment_set_replicate_keywritesStore the Replicate API key encrypted in EditorPrefs (AES-CBC, key derived from the project path).
image_segment_smooth_boundarieswritesApply a box-blur smoothing kernel to a mask's boundary pixels. Useful for cleaning up the