CoolFace
Apppublic

AravinthKumar24/Real_Time_Face_Segmentation_for_Movie_Cast_Identification

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

๐ŸŽฌ Real-Time Face Segmentation for Movie Cast Identification

๐Ÿ“Œ Project Overview

This project focuses on detecting and segmenting human faces in movie scenes using deep learning techniques. The goal is to enable a "Pause-and-Identify" feature in streaming platforms, where users can instantly view actor details.


๐Ÿš€ Features

  • โ€”Face segmentation using U-Net architecture
  • โ€”MobileNetV2 encoder (transfer learning)
  • โ€”Real-time inference using Streamlit
  • โ€”Image upload and webcam support
  • โ€”Performance dashboard with metrics
  • โ€”Downloadable logs and results

๐Ÿง  Problem Statement

Streaming platforms need a system that can:

  • โ€”Detect faces in complex movie scenes
  • โ€”Segment faces accurately
  • โ€”Identify actors in real-time

๐Ÿ’ผ Business Use Cases

  • โ€”๐ŸŽฅ Pause & Identify actors
  • โ€”๐ŸŽฏ Personalized recommendations
  • โ€”๐Ÿ›ก Content moderation
  • โ€”๐Ÿ“ข Targeted advertising

๐Ÿ—‚ Dataset

  • โ€”Movie scene images
  • โ€”Corresponding binary face masks
  • โ€”Preprocessing:
  • โ€”Resize to 256x256
  • โ€”Data augmentation (flip, rotate, brightness)

๐Ÿ— Model Architecture

  • โ€”U-Net architecture
  • โ€”MobileNetV2 as encoder
  • โ€”Skip connections for better localization
  • โ€”Custom Dice Loss function

โš™๏ธ Training Details

  • โ€”Optimizer: Adam
  • โ€”Loss: Dice Loss + Binary Crossentropy
  • โ€”Metrics: Dice Coefficient, IoU
  • โ€”Techniques:
  • โ€”Early Stopping
  • โ€”Model Checkpoint
  • โ€”Learning Rate Scheduling

๐Ÿ“Š Evaluation Metrics

MetricTarget
Dice Coefficient> 0.92
IoU> 0.88
F1 Score> 0.90
Inference Speed< 100ms

๐Ÿ” Results

  • โ€”High accuracy in face segmentation
  • โ€”Works well in crowded scenes
  • โ€”Real-time performance achieved

๐Ÿ–ฅ Streamlit App

Features:

  • โ€”Upload images
  • โ€”Real-time webcam detection
  • โ€”Visualization of masks
  • โ€”Metrics dashboard

Run App:

bash
streamlit run app.py

๐Ÿ“ฆ Installation

bash
git clone <repo_url>
cd project
pip install -r requirements.txt

๐Ÿ“ Project Structure

โ”œโ”€โ”€ data/
โ”œโ”€โ”€ models/
โ”œโ”€โ”€ notebooks/
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md

๐Ÿ“Œ Future Improvements

  • โ€”Add face recognition (actor identification)
  • โ€”Improve inference speed
  • โ€”Deploy on cloud (AWS / HuggingFace)

๐Ÿง‘โ€๐Ÿ’ป Tech Stack

  • โ€”Python
  • โ€”OpenCV
  • โ€”TensorFlow / Keras
  • โ€”Streamlit
  • โ€”NumPy, Pandas, Matplotlib

๐Ÿ™Œ Acknowledgements

  • โ€”Open-source community
  • โ€”TensorFlow & Streamlit contributors