GithubHelp home page GithubHelp logo

dlab-arp / cellseg-transformers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bowang-lab/cellseg-transformers

0.0 0.0 0.0 14 KB

Multi-Modality Cell Segmentation

License: Apache License 2.0

Shell 1.35% Python 98.65%

cellseg-transformers's Introduction

CellSeg-Transformers

Scripts to reproduce the results in the response to "Transformers do not outperform Cellpose"

Installation

# 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

Fig1c: comparison between w/TTA and w/o TTA

python infer_cp_noTTA.py

Fig2a: Transformer model with learning rate 0.00005

  1. Generate the flows: python gen_flow
  2. Run the training command: cp-trans224-5e-5.sh
  3. Download the pre-trained model here and run the inference script: python infer_new_trans_neurips_data.py
  4. Submit the results to the challenge platform

Fig2b-m: New experiments on CTC cell segmentation dataset

  1. Download the organized dataset here

  2. Infer CTC dataset with Cellpose and Cellpose-Transformerd trained by Dr. Carsen Stringer and Dr. Marius Pachitariu: python infer_ctc492.py

  3. 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"
  4. Compute Metrics: python compute_metrics -g path_to_gt -s path_to_seg -o save_path -n save_name

Running time comparison for whole-slide images (WSI) segmenation

  • Infer WSIs with Cellpose (Video)
python infer_wsi_cellpose_time.py
  • Infer WSIs with Mediar (Video)
python infer_wsi_mediar_time.py

cellseg-transformers's People

Contributors

junma11 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.