Skip to content

DLYuanGod/BioSAM2

Repository files navigation

Installation

  1. Create a virtual environment conda create -n medsam python=3.10 -y and activate it conda activate medsam
  2. Install pip3 install torch torchvision torchaudio
  3. git clone https://github.com/DLYuanGod/BioSAM2
  4. Enter the BioSAM2 folder cd BioSAM2 and run pip install -e .
  5. Enter cd segment-anything-2 and pip install -e . ; cd ..

Model Training

Data preprocessing

Download [SAM2 checkpoint] cd segment-anything-2/checkpoints;./download_ckpts.sh and place it at here and change the cfg here.

Download the dataset.

Run pre-processing

Datasets 701 and 702:

Install cc3d: pip install connected-components-3d and change the path here and here and output dir here.

python pre_CT_MR.py

Datasets 703 and 704

Change the path here and here and output dir here.

python pre_CELL_EN.py

Training on one GPU

Change the data npy path here and here.

python train_one_gpu.py

Testing

Change the ckpt here and arg here.

And eval using

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published