Skip to content

๐Ÿ“ท Image Overlap with Facial Features Detection This is a Flask web application that demonstrates image overlap with facial features detection using OpenCV. The application allows you to upload an image and detects facial features such as eyes, nose, and mouth. It then overlaps this processed image onto a second background image.

Notifications You must be signed in to change notification settings

Delicate-Jerk/face-Overlaping

Repository files navigation

Overlapped Image Config

This application helps in choosing your custom face for a 3-D model that's deplloyed in a Unread Meta-Verse, as now apart from manually customizing your charachter you can just click a pic and use that pic on the face of your charachter. ๐ŸŽฏ This is a Flask web application that detects facial features (eyes, nose, and mouth) in an image, overlaps a second image without rectangles around the features, and saves the updated overlapped image.

๐Ÿ” Objective:

The main objective of this application is to overlap a second image onto the first image, considering the facial features detected in the first image. The second image serves as the background, and the first image is overlaid on top, ensuring the facial features align properly. With the help of this you would be able to replace the face of a 3-D model in the metaverse with your own clicked photos.

๐Ÿ› ๏ธ Technologies and Libraries:

  • Python
  • Flask
  • OpenCV(cv2)

๐Ÿ–ผ๏ธ How It Works:

  1. The user uploads an image through the /process_image endpoint.
  2. The application detects facial features (eyes, nose, and mouth) in the uploaded image using OpenCV's Haar cascades.
  3. The first image (processed image) is then overlapped onto a second image (background image) without any rectangles around the detected facial features.
  4. The updated overlapped image is saved and returned as a response.

โš™๏ธ Setup and Usage:

  1. Clone this repository to your local machine.
  2. Install the required libraries listed in requirements.txt.
  3. Run the Flask application using python app.py.
  4. Use Postman or any API testing tool to send a POST request to http://localhost:5000/process_image with the image file attached.

๐Ÿ“‚ Directory Structure:

  • main.py: Contains the Flask web application code.
  • haarcascades/: Directory containing the Haar cascade classifiers for face, eyes, nose, and mouth detection.
  • Unknown.jpg: The second image (background image) you want to overlap with the first image.

๐Ÿ“ท Sample Images:

The sample images used in this repository are for demonstration purposes only. Feel free to replace Unknown.jpg with your own second image for experimentation. You can check the final result images in result folder name main.png. That png can be used to replace the face of any 3-D model.

๐Ÿšจ Important Note:

  • The application assumes that the uploaded image contains at least one face. If no face is detected, it will return an error.
  • For best results, ensure that the second image (background image) has a face of similar size and orientation as the first image.

๐Ÿ“ License:

This project is licensed under the MIT License.

๐Ÿ‘ฉโ€๐Ÿ’ป Author:

Happy overlapping ๐ŸŽ‰

About

๐Ÿ“ท Image Overlap with Facial Features Detection This is a Flask web application that demonstrates image overlap with facial features detection using OpenCV. The application allows you to upload an image and detects facial features such as eyes, nose, and mouth. It then overlaps this processed image onto a second background image.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages