Magic Copy Home, Documentation & Downloads – Copy Foreground Objects Directly From Images – Development details

Magic Copy is a Chrome extension that extracts foreground objects from images and copies them to the clipboard, based on Meta’s Segment Anything Model

The extension is not yet available as it is still under review.Extensions can be installed manually:

  • from releases download the latest .
  • Extract the ZIP file
  • exist In Chrome, go to chrome://extensions/ enable Developer Mode, and click Load Unpack.
  • Select the corresponding folder


This extension uses the same as the Segment Anything Model’s DEMO, which extracts the foreground object from the image. The only difference is that the extracted objects are copied to the clipboard instead of being displayed on the page.

self hosting

The Meta Segment Anything model requires a visual transformer to be run on the server to generate the embeddings of the images.

Magic Copy uses the same web service, but some people may not want to send their images to third parties.server-example The directory includes a simple example of how to self-host a visual converter service. However, this example is not meant to be used in production, but rather as a proof of concept to document the input/output format of the service.

In particular, Magic Copy (and the demo of the SAM model) expects a POST endpoint that accepts an image file and returns a JSON array of length 1 with the embedded shape (1, 256, 64, 64) As a base64 encoded string.

If you wish to run your service quickly, you can use the provided Dockerfile Build the container and run it.The container will expose port 8000 and will be in / Endpoints provide services.

docker build -t segment-anything .
docker run --gpus all -p 8000:8000 segment-anything

In the Magic Copy chrome extension, the endpoint can be changed to http://localhost:8000/ .

#Magic #Copy #Home #Documentation #Downloads #Copy #Foreground #Objects #Images #Development details


發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *