Coder Social home page Coder Social logo

lixiang007666 / flare2021-baseline Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yaozhang93/flare2021-baseline

0.0 0.0 0.0 138.05 MB

[MICCAI 2021 Challenge] The official baseline model for MICCAI Challenge: Fast and Low GPU memory Abdominal oRgan sEgmentation (FLARE21)

License: Apache License 2.0

Shell 0.02% Python 99.92% Dockerfile 0.06%

flare2021-baseline's Introduction

FLARE21 Baseline

The official baseline model for "MICCAI 2021 FLARE Challenge: Fast and Low GPU memory Abdominal oRgan sEgmentation", derived from nnUNet [1].

Usage

1. Download pretrained models

Download models from

2. Setup models

git clone https://github.com/YaoZhang93/FLARE21nnUNetBaseline.git
cp ./FLARE21nnUNetBaseline/nnUNet.zip ./FLARE21/datasets
cd ./FLARE21nnUNetBaseline/FLARE21/datasets/
unzip nnUNet.zip
cd ../..

3. Inference

python inference/predict_simple.py -i INPUT_FOLDER -o OUTPUT_FOLDER -t Task000_FLARE21Baseline -m CONFIGURATION
  • INPUT_FOLDER is the folder path that contains nii files for testing
  • OUTPUT_FOLDER is the folder path for the predictions of the baseline model
  • CONFIGUREATION should be 2d or 3d_fullres referring to 2D or 3D models, respectively.

For more usage, please refer to the repositry of nnUNet.

4. Get the number of parameters

python get_params.py -m CONFIGURATION
  • CONFIGURATION should be 2d or 3d_fullres referring to 2D or 3D models, respectively.

The output for 2d should be:

Total params: 41,268,192

Trainable params: 41,268,192

Non-trainable params: 0

The output for 3d_fullres should be:

Total params: 30,787,584

Trainable params: 30,787,584

Non-trainable params: 0

We use torchsummary to get the summary of the model. A simple usage is

from torchsummary import summary

# The input_size of the baseline model is 1*80*192*160
summary(model, input_size)

Please refer to pytorch-summary document for more details.

We encourage the participants to use it for the analysis of the models. get_params.py could be an example to adapt it to your own model.

5. Get the number of FLOPs

python get_flops.py -m CONFIGURATION
  • CONFIGURATION should be 2d or 3d_fullres referring to 2D or 3D models, respectively.

The output for 2d should be:

Total FLOPs: 61307143168

The output for 3d_fullres should be:

Total FLOPs: 590861472000

We use fvcore to get the FLOPs of the model. A simple usage is

from fvcore import FlopCountAnalysis

# The input_size of the baseline model is 1*1*80*192*160
inputs = (torch.randn(input_size),)
flops = FlopCountAnalysis(model, inputs)

Please refer to fvcore document for more details.

We encourage the participants to use it for the analysis of the models. get_flops.py could be an example to adapt it to your own model.

6. Evaluation

Please refer to FLARE21 Evaluation Code.

7. Submission of Segmentation Results

First, compress the segmentation results by

zip -r TeamNameVal1.zip OUTPUT_FOLDER

FLARE21/BaselineVal1.zip is an example generated by the baseline model.

Then, submit the results on FLARE21 Submission Page.

8. Build a Docker Image

Build a docker image of the model by

docker build -t  docker_image_name .

The configuration of the docker image is in Dokcerfile. It will call predict.sh when starting the docker image. Please refer to the video tutorial for more details.

9. Reference

[1] Isensee, Fabian, Paul F Jaeger, Simon A A Kohl, Jens Petersen, and Klaus H Maier-Hein. 2021. “nnU-Net: A Self-Configuring Method for Deep Learning-Based Biomedical Image Segmentation.” Nature Methods 18 (2): 203–11.

flare2021-baseline's People

Contributors

yaozhang93 avatar junma11 avatar anxingle avatar h1shen 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.