Skip to content

This repository contains the code and data for selfie image segmentation project. The project aims to automatically segment a person's face and body from a selfie image, by using deep learning models and computer vision techniques.

Notifications You must be signed in to change notification settings

Yousef-Nasr/human-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Selfie-segmentation

Overview


This repository contains the code and data for selfie image segmentation project. The project aims to automatically segment a person's face and body from a selfie image, by using deep learning models and computer vision techniques.

Requirements


  • Python 3.7+
  • TensorFlow
  • Pillow
  • NumPy
  • Matplotlib

Dataset


This dataset is split into 1700 training samples and 300 testing samples, stored in "training" and "testing" folders respectively. Each image has a unique identifier (not unique across testing and training, though) and can be used to easily retrieve its corresponding matte/segmentation. The segmentation are only binary -- foreground and background.

Example from data set

Sample from dataset mask from dataset

Model


The model used for selfie image segmentation is a U-Net architecture, which consists of an encoder and a decoder network. The encoder network extracts features from the input image, while the decoder network generates the segmentation mask based on the extracted features.

The model is trained using binary-crossEntorpy as loss function, Dice coefficient and IoU as evaluation metric, and optimized using the Adam optimizer. The model is trained for 100 epochs, with a batch size of 32.

Download model


Results


The trained model achieves an Dice coefficient of 0.9629 on the test set,The segmentation results are visually appealing, with accurate and consistent delineation of the person's face and body.

Example for model result

Sample Result


Conclusion


In conclusion, this project demonstrates an effective approach to selfie image segmentation using a U-Net model and a well-curated dataset. The results show that the model is capable of accurately segmenting a person's face and body from a selfie image, with potential applications in various domains such as social media, e-commerce, and entertainment.

Colab Notebook

Presentation

Live demo

About

This repository contains the code and data for selfie image segmentation project. The project aims to automatically segment a person's face and body from a selfie image, by using deep learning models and computer vision techniques.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published