Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juniorxsound/TF-Unet
🗺 General purpose U-Network implemented in Keras for image segmentation
https://github.com/juniorxsound/TF-Unet
cnn cv dnn tensorflow unet
Last synced: 3 months ago
JSON representation
🗺 General purpose U-Network implemented in Keras for image segmentation
- Host: GitHub
- URL: https://github.com/juniorxsound/TF-Unet
- Owner: juniorxsound
- License: apache-2.0
- Created: 2019-08-14T14:09:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-09T00:10:36.000Z (about 5 years ago)
- Last Synced: 2024-04-12T02:59:52.537Z (7 months ago)
- Topics: cnn, cv, dnn, tensorflow, unet
- Language: Jupyter Notebook
- Homepage:
- Size: 339 KB
- Stars: 2
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-tensorflow - TF-Unet - General purpose U-Network implemented in Keras for image segmentation (Models/Projects)
- fucking-awesome-tensorflow - TF-Unet - General purpose U-Network implemented in Keras for image segmentation (Models/Projects)
README
TF-Unet
General purpose U-Network implemented in Keras for image segmentation
Getting started •
Training •
Evaluation
## Getting started
Looking for Jupyter notebooks? checkout the [training](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Training.ipynb), [evaulation](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Evaluation.ipynb) and [prediction](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Prediction.ipynb) notebooks or run `make jupyter` to serve them locally. Looking for pre-trained weights? [download them here](https://storage.cloud.google.com/orfleisher-production.appspot.com/models/unet/toy_network.zip).### Dependencies
To quickly get started make sure you have the following dependencies installed:
- [Docker (19 or newer)](https://docs.docker.com/install/) 📦
- [Make](https://www.gnu.org/software/make/) *[Optional macOS / Linux]* ðŸ›
- [Nvidia Container Toolkit](https://github.com/NVIDIA/nvidia-docker#quickstart) *[Optional for GPUs]* 🗜### Setup
Clone (or [download](https://github.com/juniorxsound/TF-Unet/archive/master.zip)) the repository and `cd` into it
```sh
git clone https://github.com/juniorxsound/TF-Unet.git && cd TF-Unet
```
Next build the Docker image by simply running `make build`
> The build process will pick either `Dockerfile.cpu` or `Dockerfile.gpu` based on your system## Training
This repository uses the `ShapeDataset` synthetic data generator written by Matterport (in [Mask R-CNN](https://github.com/matterport/Mask_RCNN/blob/master/samples/shapes/train_shapes.ipynb)). No download is needed, as all data is generated during runtime, here is a sample of the datasetTo start training, simply call `make train` which will start the training process using the [parameters defined in `train.py`](https://github.com/juniorxsound/TF-Unet/blob/master/train.py#L13-L16). A model will be saved at the end of the training process into the weights folder in [`SavedModel` format](https://www.tensorflow.org/guide/saved_model).
If you are interested in following the training process, you can use `make log` during training to start a Tensorboard server with accuracy and loss metrics being updated every batch.
> Tensorboard image hereIf you want to train in a Jupyter notebook follow the [Training notebook](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Training.ipynb)
## Evaluation
To quickly evaluate download the [pre-trained weights](https://storage.cloud.google.com/orfleisher-production.appspot.com/models/unet/toy_network.zip) and unzip the contents into the weights folder. To run evaluation simply use `make evaluate` or the Jupyter [Evaluation notebook](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Evaluation.ipynb).> The weights provided were trained for 50 epochs on 8000 samples with batch size of 18. Training takes 5 hours using 2 GTX 2080ti's and reaches 96.56% accuracy.
## Prediction
See the Jupyter [Prediction notebook](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Prediction.ipynb).## Architecture
The implementation was inspired by [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/)## Thanks to
The [original paper authors](https://arxiv.org/abs/1505.04597), this [Keras UNet implementation](https://github.com/zhixuhao/unet), this [Tensorflow UNet implementation](https://github.com/jakeret/tf_unet) and [Mask R-CNN authors](https://github.com/matterport/Mask_RCNN).