Skip to content

sam3-mlx 0.4.0

Latest

Choose a tag to compare

@sandovaljoseph sandovaljoseph released this 15 Nov 02:02
· 1 commit to main since this release

Breaking changes

run returns a medmlx_core.outputs.RunResult with renamed output roles. outputs["masks"] is now outputs["mask"] and outputs["prediction"] is now outputs["detections"]; the files (masks.npy, prediction.json) are unchanged. The result also holds artifacts, which records that both files are in pixel coordinates of the input image or frame.

The prompt arguments are renamed. The coordinate space is now part of the box and point names.

-from sam3_mlx.medmlx import run
-result = run(image_path="image.png", text_prompt="helmet", box_prompt=[0.5, 0.5, 0.3, 0.3], output_dir="out")
-print(result["outputs"]["masks"])
+from sam3_mlx import run
+result = run(image_path="image.png", prompt="helmet", box_cxcywh_normalized=[0.5, 0.5, 0.3, 0.3], output_dir="out")
+print(result["outputs"]["mask"])

point_prompt is now point_xy_normalized. The same renames apply to the arguments file of medmlx run sam3, where text_prompt becomes prompt. from sam3_mlx import run is new; sam3_mlx.medmlx.run still works.

Requires medmlx-core>=0.3,<0.4.

Fixes

Non-finite model predictions now raise ValueError. Before, NaN scores fell below the confidence threshold and a failed inference looked like an image with no detections.