- The aim of the project is doing image processing and predict how much attract is the face in the image.
- Description of the Dataset and Kaggle Link
- Pandas
- Numpy
- Matplotlib
- Sklearn
- Sci-py
- Seaborn
- Flask
- Tensorflow
- Keras
- Create a virtual environment using
python -m venv myenv
. - To activate the virtual environment use
.\myenv\Scripts\activate
. - If error occurs, use
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
. - Now, app.py is the flask app code. run the command
pip install -r requirements.txt
to install the required dependencies for the flask app. - You may need to install additional libraries for running the jupyter notebooks.
- Upload the model file on Google Colab and put the Kaggle API key json file on Google Drive homepage then run the code.
- Finally, download the updated weights file of highest accuracy model like
weights.best.inc.attractive.hdf5
is of Inception V3 Model weights file goes around 185 MB. - Link it with the
app.py
file and start the python file.
- First I imported all the required libraries and dataset for this project.
- Perfoming the EDA on the whole dataset.
- Chosing 1 target feature i.e.,
Attractiveness
. - Converting all -1 values into 0 values as negative instances.
- Visualizing the dataset distribution in univariate and bivariate with target feature.
- Splitting the dataset into training, validation and testing set as given in
list_eval_partition.csv
file. - Due to high amount of dataset and uniform distribution of dataset for training, i will chose small amount from it for training, validation and testing purpose.
- Pre-processing the images i.e., Data augmentation so that model will able to predict easily on any dimension of image like inverted, or at any angle of rotation, etc and model is able to learn from these type of variation in the images.
- Finally, start building the different models like inceptionV3 model, resnet50 model, and resnet101V2 models by freezing the some of the layers of them.
- At the end, Adding some fully connected layers by own for classification problem of the model.
- Train the model and plot the accuracy and loss of the model on test dataset.
Models Used | Accuracy |
---|---|
Inception V3 | 68.80% |
ResNet-50 | 50.20% |
ResNet-101 V2 | 62.13% |
- InceptionV3 Model showing promising performance with 68.80% accuracy of the model.
- Created a user-friendly front-end framework using FLASK and integrate it to the model.