Skip to content
/ UNET Public

A Simple Tutorial for 2D and 3D U-Net Training and Test Pipeline in Pytorch

License

Notifications You must be signed in to change notification settings

mikami520/UNET

Repository files navigation

A Simple for 2D and 3D U-Net Pytorch Tutorial

The results trained and tested on Liver dataset from Medical Segmentation Decathlon. Checkpoints, loss plots, inference results etc are stored in the 3D UNet Liver and 2D UNet Liver

Usage

  • Clone the repository

    git clone https://github.com/mikami520/UNET.git && cd UNET
  • Train (modify the YAML as needed)

    Simply run

    python 2dunet_train.py --cfg 2dunet_config.yaml

    or

    python 3dunet_train.py --cfg 3dunet_config.yaml

    for 2D and 3D U-Net, respectively. Add --resume if you need to continue your previous training.

  • Test

    Simply run

    python 2dunet_test.py --cfg 2dunet_config.yaml

    or

    python 3dunet_test.py --cfg 3dunet_config.yaml

Metrics

Multiple evaluation metrics are added to this tutorial:

  • Mean Dice Score
  • Mean Surface Distance
  • Mean Hausdorff Distance
  • Mean Surface Dice Score
  • Mean Chamfer Distance

Star History

Star History Chart


Developed by Chris Xiao | University of Toronto

© 2025 All Rights Reserved

About

A Simple Tutorial for 2D and 3D U-Net Training and Test Pipeline in Pytorch

Topics

Resources

License

Stars

Watchers

Forks

Languages