Official implementation of the paper published at MICCAI 2024
Report Bug
- Clone the repository:
git clone https://github.com/CVPR-KIT/SAM-Guided-Enhanced-Nuclei-Segmentation.git
- Create a new environment and install the required packages:
pip install -r requirements.txt
Three datasets are used in the experiments.
The datasets are chosen for their diversity in staining methods and tissue complexity. CryoNuSeg includes a collection of 30 images, NuInsSeg contains 665 image patches, and CoNIC contains 4981 images in the dataset.
The datasets can be organised using organize_dataset.py and followed up with genAugmentation.py to generate augmnetations. the code file genSAMEncoding.py can be used to obtain SAM encodings of the images that is to be used during the experiments. The final structure of dataset directory configuration should look something like the following.
NuInsSeg/
├── test/
│ ├── 0.png (input image)
│ └── 0_label.png (groundtruth image)
│ └── 0_en.pt (SAM encoding)
├── train/
│ ├── 0.png
│ └── 0_label.png
│ └── 0_en.pt
└── val/
│ ├── 0.png
│ └── 0_label.png
│ └── 0_en.pt
Each of the directory has indexed files. each index has 3 corresponding parts - an input image, a label image and SAM encoding.
All modifiable parameters related to the experiment and augmentation are present in the config files. Set up all parameters here before proceeding.
After checking the dataset information in the config file, run:
python main.py --config config.sys |& tee log/experiments/log-02-15.txt
For testing or inferencing images, ensure they are in the correct format and directory information is added correctly in the config.sys file:
python train_test.py --expt_dir <path to experiment directory>
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- If you have suggestions for adding or removing projects, feel free to open an issue to discuss it, or directly create a pull request after editing the README.md file with necessary changes.
- Please make sure you check your spelling and grammar.
- Create individual PRs for each suggestion.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/newFeature
) - Commit your Changes (
git commit -m 'Added some new feature'
) - Push to the Branch (
git push origin feature/newFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
- Bishal Ranjan Swain - PhD Candidate at Kumoh National Institute of Technology