Scripts to reproduce the results in the response to "Transformers do not outperform Cellpose"
# create virtual environment
conda create --name cp3 python=3.10 -y
conda activate cp3
# install the latest cellpose
git clone https://github.com/mouseland/cellpose.git
cd cellpose
pip install -e .
# install GPU version of torch
pip uninstall torch
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu118
# install segmentation_models_pytorch for Transformers
pip install segmentation_models_pytorch
pip install six pandas
python infer_cp_noTTA.py
- Generate the flows:
python gen_flow
- Run the training command:
cp-trans224-5e-5.sh
- Download the pre-trained model here and run the inference script:
python infer_new_trans_neurips_data.py
- Submit the results to the challenge platform
Fig2b-m: New experiments on CTC cell segmentation dataset
-
Download the organized dataset here
-
Infer CTC dataset with
Cellpose
andCellpose-Transformerd
trained by Dr. Carsen Stringer and Dr. Marius Pachitariu:python infer_ctc492.py
-
Infer CTC dataset with
Mediar
, which was the winning solution in the NeurIPS 2022 segmentation challenge- Download the docker here
- Run the inference
docker container run --gpus="device=0" -m 28G --name mediar --rm -v $PWD/CTC-Data/imagesTr_GT492/:/workspace/inputs/ -v $PWD/CTC-Data/seg_mediar:/workspace/outputs/ osilab:latest /bin/bash -c "sh predict.sh"
-
Compute Metrics:
python compute_metrics -g path_to_gt -s path_to_seg -o save_path -n save_name
- Infer WSIs with Cellpose (Video)
python infer_wsi_cellpose_time.py
- Infer WSIs with Mediar (Video)
python infer_wsi_mediar_time.py