GithubHelp home page GithubHelp logo

coolzhao / pytorch-unet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from johschmidt42/pytorch-2d-3d-unet-tutorial

0.0 1.0 0.0 69.77 MB

License: MIT License

Python 47.52% Makefile 0.42% Jupyter Notebook 52.05%

pytorch-unet's Introduction

PyTorch-2D-3D-UNet-Tutorial

A beginner-friendly tutorial to start a 2D or 3D image segmentation deep learning project with PyTorch & the U-Net architecture. Based on the blog series "Creating and training a U-Net model with PyTorch for 2D & 3D semantic segmentation - A guide to semantic segmentation with PyTorch and the U-Net".

image1 image2

Installation

  1. Set up a new environment with an environment manager (recommended):
    1. conda:
      1. conda create --name unet-tutorial -y
      2. conda activate unet-tutorial
      3. conda install python=3.8 -y
    2. venv:
      1. python3 -m venv unet-tutorial
      2. source unet-tutorial/bin/activate
  2. Install the libraries: pip install -r requirements.txt
  3. Start a jupyter server: jupyter-notebook OR jupyter-lab

Note: This will install the CPU-version of torch. If you want to use a GPU or TPU, please refer to the instructions on the PyTorch website

Summary

  • Part I: Building a dataset in PyTorch & visualizing it with napari
  • Part II: Creating the U-Net model in PyTorch & information about model input and output
  • Part III: Training a 2D U-Net model on a sample of the Carvana dataset with improving datasets (caching, multiprocessing)
  • Part IV: Running inference on test data
  • Part V: Building a 3D dataset
  • Part VI: Running an experiment with the experiment tracker neptune.ai and the high-level PyTorch library PyTorch Ligthning

Note: Due to updates in the neptune API, part VI will probably not work and needs to be migrated to the new neptune API first

Dataset samples

This repository contains a sample of a 2D and a 3D dataset for semantic segmentation.

U-Net model

If you are unsure what arguments to pass in the Unet class, please take a look at the enums in unet.py and view examples in test_unet.py.

Note: Weights are initialized randomly (xavier initialization) and training can take some time. To faster train a segmentation model, it is recommended to use a pretrained backbone such as ResNet for 2D or even 3D tasks.

pytorch-unet's People

Contributors

johschmidt42 avatar schmiddi-75 avatar narenakash avatar

Watchers

 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.