About minisam-react & Simple Demo

minisam-react provides ready-to-use React components for integrating the miniSAM (Segment Anything Model) directly into your web applications. It handles model initialization, image loading, click handling, mask generation, and UI rendering with minimal setup.

Below is a live, minimal example of the MiniSamSegmenter component in action. Click on the image to segment the corgi!

Live Demo

Easy Implementation (Copy & Paste)

Implementing the segmenter is as simple as this:


import { MiniSamSegmenter } from "minisam-react";

function MyAwesomeComponent() {
  return (
    <MiniSamSegmenter
      image="/images/corgi-running.png"
      onMaskUpdate={(mask) => {
        if (mask) {
          console.log("Mask updated on About page:", mask);
        }
      }}
    />
  );
}