Skip to content

Segment Anything model wrapper used by the Medical Imaging Interaction Toolkit (MITK).

License

Notifications You must be signed in to change notification settings

MIC-DKFZ/agent-sam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Agent SAM (Segment Anything & MedSAM for MITK)

Copyright (c) German Cancer Research Center (DKFZ). All rights reserved. Please make sure that your usage of this code is in compliance with its license.

This repo contains Segment Anything model wrapper used by MITK. The Medical Imaging Interaction Toolkit (MITK) is a free open-source software system for development of interactive medical image processing software. MITK combines the Insight Toolkit (ITK) and the Visualization Toolkit (VTK) with an application framework. MITK's SAM 2D tool uses this wrapper as its backend for inferencing.

The code runs a daemon monitoring any given folder any input files (*.nrrd) and prompt points in a trigger.csv file placed inside the input folder. Embeddings generated per file is cached for future use during the runtime.

Installation

pip install git+https://github.com/MIC-DKFZ/agent-sam.git

Pip installing this will automatically install Segment Anything in the python virtual environment. Pretrained weights for the supported model type are downloaded automatically in the directory specified, if the checkpoint doesn't exist already. The code requires Python>=3.8, as well as Pytorch>=1.7 and torchvision>=0.8. Please follow the instructions here to install both PyTorch and TorchVision dependencies. Installing both PyTorch and TorchVision with CUDA support is strongly recommended.

Usage

The program can be used independent of MITK.

python run_inference_daemon.py --input-folder ./input --output-folder ./output --trigger-file trigger.csv --model-type vit_b --checkpoint ./directory --device cuda --backend MedSAM

License

The code is available as free open-source software under a 3-clause BSD license.

About

Segment Anything model wrapper used by the Medical Imaging Interaction Toolkit (MITK).

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages