{"id":27242367,"url":"https://github.com/animikhaich/semantic-segmentation-using-autoencoders","last_synced_at":"2025-04-10T20:19:24.512Z","repository":{"id":53608448,"uuid":"340891379","full_name":"animikhaich/Semantic-Segmentation-using-AutoEncoders","owner":"animikhaich","description":"Lightweight and Fast Person Segmentation using Autoencoders (Trained Weights Included)","archived":false,"fork":false,"pushed_at":"2021-11-27T17:17:47.000Z","size":28993,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-18T08:14:16.754Z","etag":null,"topics":["autoencoder","autoencoders","cnn","cnn-keras","convolutional-neural-networks","jupyter","jupyter-notebook","keras","python","segmentation","semantic-segmentation","tensorflow","tensorflow2"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/animikhaich.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}},"created_at":"2021-02-21T12:03:22.000Z","updated_at":"2023-11-20T23:05:21.000Z","dependencies_parsed_at":"2022-08-27T04:50:53.998Z","dependency_job_id":null,"html_url":"https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FSemantic-Segmentation-using-AutoEncoders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FSemantic-Segmentation-using-AutoEncoders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FSemantic-Segmentation-using-AutoEncoders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/animikhaich%2FSemantic-Segmentation-using-AutoEncoders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/animikhaich","download_url":"https://codeload.github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248289600,"owners_count":21078917,"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":["autoencoder","autoencoders","cnn","cnn-keras","convolutional-neural-networks","jupyter","jupyter-notebook","keras","python","segmentation","semantic-segmentation","tensorflow","tensorflow2"],"created_at":"2025-04-10T20:19:23.882Z","updated_at":"2025-04-10T20:19:24.494Z","avatar_url":"https://github.com/animikhaich.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"assets/vision_icon.png\" alt=\"Logo\" width=\"150\" height=\"150\"\u003e\n\n  \u003ch2 align=\"center\"\u003eSemantic Segmentation using Auto Encoders\u003c/h2\u003e\n\n  \u003cp align=\"center\"\u003e\n    A Lightweight Human (Person) Segmentation Model built using Autoencoders, trained on COCO.\n    \u003cbr /\u003e\n    \u003ca href=\"https://nbviewer.jupyter.org/github/animikhaich/Semantic-Segmentation-using-AutoEncoders/blob/main/Model.ipynb\"\u003eModel Notebook\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/issues/new\"\u003eReport Bug\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/segmentation.png\" alt=\"Demo GIF\"\u003e\n\u003c/p\u003e\n\u003c!-- TABLE OF CONTENTS --\u003e\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [About The Project](#about-the-project)\n- [Jupyter Notebooks - nbViewer](#jupyter-notebooks---nbviewer)\n- [Dataset Information](#dataset-information)\n- [Features](#features)\n- [Results](#results)\n- [How to Run](#how-to-run)\n  - [Hardware Used for the Experiment](#hardware-used-for-the-experiment)\n  - [Dataset Directory Structure (For Training)](#dataset-directory-structure-for-training)\n  - [Built With](#built-with)\n- [Changelog](#changelog)\n- [Contributing](#contributing)\n- [License](#license)\n- [Contact](#contact)\n    - [Animikh Aich](#animikh-aich)\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n## About The Project\n\nInspired from UNet ([Paper](https://arxiv.org/abs/1505.04597)), which is a form of Autoencoder with Skip Connections, I wondered why can't a much shallower network create segmentation masks for a single object? Hence, the birth of this small project.\n\nThe primary goal of this is to determine if a shallow end-to-end CNN can learn complicated features like human beings. Hence, as a proof of concept, this notebook has been created.\n\nThe notebooks do not render properly on GitHub, hence please use the [nbviewer](https://nbviewer.jupyter.org/) links provided below to see the results.\n\n## Jupyter Notebooks - nbViewer\n\n- [Dataset Preparation - Extracting Masks for Person from COCO Dataset](https://nbviewer.jupyter.org/github/animikhaich/Semantic-Segmentation-using-AutoEncoders/blob/main/Dataset%20Preparation.ipynb)\n- [Model - Main Notebook Containing the Dataset Loader and Model Architecture](https://nbviewer.jupyter.org/github/animikhaich/Semantic-Segmentation-using-AutoEncoders/blob/main/Model.ipynb)\n\n\n## Dataset Information\n\n- The Model is trained on [COCO 2017 Dataset](https://cocodataset.org/).\n- Dataset Splits Used:\n  - Train: COCO 2017 Train Images + Train Annotations - `instances_train2017.json`\n  - Val: COCO 2017 Val Images + Val Annotations - `instances_val2017.json`\n- Dataset Download: https://cocodataset.org/#download\n- Dataset Format Information: https://cocodataset.org/#format-data\n- API to parse COCO: https://github.com/philferriere/cocoapi\n\n## Features\n\n- **Pre Trained Weights** - The weights can directly be downloaded from here: [weights.h5](https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/blob/main/weights.h5) - It is stored using Git LFS.\n- **Fast Inference** - Inference Time for batch of `32` images of `512x512` dimensions with an Nvidia RTX 2080Ti is just `10.3 µs`.\n\n## Results\n\nImages (Left to Right): `Input Image`, `Predicted Image`, `Thresholded Mask @ 0.5`, `Ground Truth Mask`\n\n![Result 1](assets/result_1.jpg)\n![Result 2](assets/result_2.jpg)\n![Result 3](assets/result_3.jpg)\n![Result 4](assets/result_4.jpg)\n![Result 5](assets/result_5.jpg)\n![Result 6](assets/result_6.jpg)\n![Result 7](assets/result_7.jpg)\n![Result 8](assets/result_8.jpg)\n![Result 9](assets/result_9.jpg)\n![Result 10](assets/result_10.jpg)\n![Result 11](assets/result_11.jpg)\n![Result 12](assets/result_12.jpg)\n\n## How to Run\n\nThe experiment should be fairly reproducible. However, a GPU would be recommended for training. For Inference, a CPU System would suffice.\n\n### Hardware Used for the Experiment\n\n- CPU: AMD Ryzen 7 3700X - 8 Cores 16 Threads\n- GPU: Nvidia GeForce RTX 2080 Ti 11 GB\n- RAM: 32 GB DDR4 @ 3200 MHz\n- Storage: 1 TB NVMe SSD (This is not important, even a normal SSD would suffice)\n- OS: Ubuntu 20.10\n\nAlternative Option: [Google Colaboratory - GPU Kernel](https://colab.research.google.com/)\n\n### Dataset Directory Structure (For Training)\n\n- Use the COCO API to extract the masks from the dataset. (Refer: [Dataset Preparation.ipynb Notebook](https://nbviewer.jupyter.org/github/animikhaich/Semantic-Segmentation-using-AutoEncoders/blob/main/Dataset%20Preparation.ipynb))\n- Save the masks in a directory as `.jpg` images.\n- Example Directory Structure:\n\n```sh\n.\n├── images\n│   ├── train\n│   │   ├── *.jpg\n│   └── val\n│       └── *.jpg\n└── masks\n│   ├── train\n│   │   ├── *.jpg\n│   └── val\n│       └── *.jpg\n```\n\n### Built With\n\nSimple List of Deep Learning Libraries. The main Architecture/Model is developed with Keras, which comes as a part of Tensorflow 2.x\n\n- [Tensorflow 2.4.1](https://www.tensorflow.org/)\n- [OpenCV 4.5.1.48](https://opencv.org/)\n- [Numpy 1.19.5](https://numpy.org/)\n- [Matplotlib 3.3.4](https://matplotlib.org/)\n- [PyCOCOTools 2.0.2](https://github.com/philferriere/cocoapi)\n\n\n## Changelog\n\nSince this is a Proof of Concept Project, I am not maintaining a CHANGELOG.md at the moment. However, the primary goal is to improve the architecture to make the predicted masks more accurate.\n\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nDistributed under the MIT License. See [LICENSE](LICENSE.md) for more information.\n\n## Contact\n\n#### Animikh Aich\n\n- Website: [Animikh Aich - Website](http://www.animikh.me/)\n- LinkedIn: [animikh-aich](https://www.linkedin.com/in/animikh-aich/)\n- Email: [animikhaich@gmail.com](mailto:animikhaich@gmail.com)\n- Twitter: [@AichAnimikh](https://twitter.com/AichAnimikh)\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\n[contributors-shield]: https://img.shields.io/github/contributors/animikhaich/Semantic-Segmentation-using-AutoEncoders.svg?style=flat-square\n[contributors-url]: https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/animikhaich/Semantic-Segmentation-using-AutoEncoders.svg?style=flat-square\n[forks-url]: https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/network/members\n[stars-shield]: https://img.shields.io/github/stars/animikhaich/Semantic-Segmentation-using-AutoEncoders.svg?style=flat-square\n[stars-url]: https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/stargazers\n[issues-shield]: https://img.shields.io/github/issues/animikhaich/Semantic-Segmentation-using-AutoEncoders.svg?style=flat-square\n[issues-url]: https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/issues\n[license-shield]: https://img.shields.io/github/license/animikhaich/Semantic-Segmentation-using-AutoEncoders.svg?style=flat-square\n[license-url]: https://github.com/animikhaich/Semantic-Segmentation-using-AutoEncoders/blob/master/LICENSE.md\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=flat-square\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/animikh-aich/\n[product-screenshot]: assets/face-blur-demo.gif\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimikhaich%2Fsemantic-segmentation-using-autoencoders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanimikhaich%2Fsemantic-segmentation-using-autoencoders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanimikhaich%2Fsemantic-segmentation-using-autoencoders/lists"}