abhisheks008 / DL-Simplified

Deep Learning Simplified is an Open-source repository, containing beginner to advance level deep learning projects for the contributors, who are willing to start their journey in Deep Learning. Devfolio URL, https://devfolio.co/projects/deep-learning-simplified-f013
https://quine.sh/repo/abhisheks008-DL-Simplified-499023976
MIT License
324 stars 290 forks source link

[Feature Addition]: Web Application for Age and Sex Prediction #538 #575

Closed theiturhs closed 1 month ago

theiturhs commented 1 month ago

Pull Request for DL-Simplified 💡

Issue Title : [Feature Addition]: Web Application for Age and Sex Prediction #538

Closes: #538

Describe the add-ons or changes you've made 📃

  1. Started with downloading the model trained in .h5 format using CNN model which was already trained here. No changes are made in this training model code.
  2. Creating a web interface using Flask.
  3. For prediction, the images uploaded by the users were pre-processed in the same manner that was executed while training the model which required RGB image to grayscale conversion, resizing the image, and normalizing it.
  4. Since the dataset contained only facial images, so a new function is added that will extract the face from uploaded image by the user. For this, haar cascade is used designed by OpenCV to detect frontal face.
  5. Then the image becomes ready for prediction.

Type of change ☑️

What sort of change have I made:

How Has This Been Tested? ⚙️

Initially, I successfully ran the Flask application without any errors, verifying its smooth operation on the local server. I then tested user interactions, ensuring that users can't proceed without uploading an image and that any issues with image uploads redirected them to an error page. This error page is designed which will indicate the user that "Something went wrong" and provided an option to return to the home page. To further validate the feature, I used images from open-source platforms like Pixabay, ensuring that the application can work with these images also. The face detection functionality, utilizing Haar Cascade, was verified to crop faces accurately in the these images.

Checklist: ☑️

Thanks!

github-actions[bot] commented 1 month ago

Our team will soon review your PR. Thanks @theiturhs :)

theiturhs commented 1 month ago

@abhisheks008 Thank you! It was great working with Flask.