Giter VIP home page Giter VIP logo

lightning_unet's Introduction

PyTorch Lightning Implementation of UNET model for Semantic Segmentation

0. Repository Structure

.
├── data/
│   ├── train/
│   │   ├── 00087a6bd4dc_01.jpg
│   │   ├── 00087a6bd4dc_02.jpg
│   │   ├── 00087a6bd4dc_03.jpg
│   │   ├── 00087a6bd4dc_04.jpg
│   │   ├── 00087a6bd4dc_05.jpg
│   │   └── ...
│   └── train_masks/
│       ├── 00087a6bd4dc_01_mask.gif
│       ├── 00087a6bd4dc_02_mask.gif
│       ├── 00087a6bd4dc_03_mask.gif
│       ├── 00087a6bd4dc_04_mask.gif
│       ├── 00087a6bd4dc_05_mask.gif
│       └── ...
├── README.md
├── dataset.py
├── model.py
├── requirements.txt
├── train.py
└── kaggle.json
└── train.py

1. Getting started

# clone repository
$ git clone https://github.com/LxYuan0420/lightning_unet.git
$ cd lightning_unet/

# activate virtual env
$ python -m venv v
$ source env/bin/activate

# install libaries
(env)$ pip install -r requirements.txt

# get kaggle api token from your kaggle account
(env)$ mkdir -p ~/.kaggle/ && mv kaggle.json ~/.kaggle/ && chmod 600 ~/.kaggle/kaggle.json

# accept compentition rules and download dataset
(env)$ kaggle competitions download -c carvana-image-masking-challenge

# unzip and remove other files to make sure your data/ dir is
# the same as the expected repository structure.

2. Start training

# optional: modify hyperparameters
(env)$ vim train.py

(env)$ python train.py

...
Epoch 8: 100%|██████████| 319/319 [01:01<00:00,  5.21it/s, loss=0.0198, v_num=2, train_loss_step=0.0183, val_loss=0.310, val_acc=0.914, val_f1=0.832, train_loss_epoch=0.0193]

(env)$ ls unet_models/
'unet_implementation-epoch-epoch=06-val_loss-val_loss=0.02-val_acc-val_acc=0.99-val_f1-val_f1=0.98.ckpt'

lightning_unet's People

Contributors

lxyuan0420 avatar

Watchers

 avatar

Forkers

a-biao96

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.