{"id":13798857,"url":"https://github.com/juniorxsound/TF-Unet","last_synced_at":"2025-05-13T06:31:37.391Z","repository":{"id":89601874,"uuid":"202363612","full_name":"juniorxsound/TF-Unet","owner":"juniorxsound","description":"🗺 General purpose U-Network implemented in Keras for image segmentation","archived":false,"fork":false,"pushed_at":"2019-11-09T00:10:36.000Z","size":347,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-26T10:14:11.834Z","etag":null,"topics":["cnn","cv","dnn","tensorflow","unet"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/juniorxsound.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-14T14:09:28.000Z","updated_at":"2022-08-31T17:23:59.000Z","dependencies_parsed_at":"2024-01-07T10:56:48.560Z","dependency_job_id":null,"html_url":"https://github.com/juniorxsound/TF-Unet","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorxsound%2FTF-Unet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorxsound%2FTF-Unet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorxsound%2FTF-Unet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juniorxsound%2FTF-Unet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juniorxsound","download_url":"https://codeload.github.com/juniorxsound/TF-Unet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253888886,"owners_count":21979522,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn","cv","dnn","tensorflow","unet"],"created_at":"2024-08-04T00:00:55.408Z","updated_at":"2025-05-13T06:31:36.983Z","avatar_url":"https://github.com/juniorxsound.png","language":"Jupyter Notebook","funding_links":[],"categories":["Models/Projects"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eTF-Unet\u003c/h1\u003e\n    \u003cimg href=\"#\" src=\"./samples/u.jpg\" /\u003e\n    \u003cp\u003eGeneral purpose U-Network implemented in Keras for image segmentation\u003c/p\u003e\n    \u003cp\u003e\n        \u003ca href=\"#getting-started\"\u003eGetting started\u003c/a\u003e •\n        \u003ca href=\"#training\"\u003eTraining\u003c/a\u003e •\n        \u003ca href=\"#evaluation\"\u003eEvaluation\u003c/a\u003e\n    \u003c/p\u003e\n    \u003cimg src=\"https://travis-ci.com/juniorxsound/TF-Unet.svg?token=ztzi6EexNpaHGeSp1q8W\u0026branch=master\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/python-3.6-blue.svg\" /\u003e\n\u003c/div\u003e\n\n## Getting started\nLooking 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).\n\n### Dependencies\nTo quickly get started make sure you have the following dependencies installed:\n- [Docker (19 or newer)](https://docs.docker.com/install/) 📦\n- [Make](https://www.gnu.org/software/make/) *[Optional macOS / Linux]* 🛠\n- [Nvidia Container Toolkit](https://github.com/NVIDIA/nvidia-docker#quickstart) *[Optional for GPUs]* 🗜\n\u003c/ul\u003e\n\n### Setup\nClone (or [download](https://github.com/juniorxsound/TF-Unet/archive/master.zip)) the repository and `cd` into it\n```sh\ngit clone https://github.com/juniorxsound/TF-Unet.git \u0026\u0026 cd TF-Unet\n```\nNext build the Docker image by simply running `make build`\n\u003e The build process will pick either `Dockerfile.cpu` or `Dockerfile.gpu` based on your system\n\n## Training\nThis 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 dataset\n\u003cimg src=\"./samples/sample.png\" width=\"500\"\u003e\n\nTo 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).\n\nIf 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. \n\u003e Tensorboard image here\n\nIf you want to train in a Jupyter notebook follow the [Training notebook](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Training.ipynb)\n\n## Evaluation\nTo 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).\n\n\u003e 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.\n\n## Prediction\nSee the Jupyter [Prediction notebook](https://github.com/juniorxsound/TF-Unet/blob/master/notebooks/Prediction.ipynb).\n\n\u003cimg src=\"./samples/prediction_treshold.png\" width=\"500\" /\u003e\n\n## Architecture\nThe implementation was inspired by [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/)\n\n\u003cimg src=\"./samples/unet_arch.png\" width=\"500\"\u003e\n\n## Thanks to\nThe [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).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniorxsound%2FTF-Unet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuniorxsound%2FTF-Unet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuniorxsound%2FTF-Unet/lists"}