https://github.com/j-bodek/formal-photo-verification
An easy web application that predicts whether the photo is in a formal style
https://github.com/j-bodek/formal-photo-verification
computer-vision convolutional-neural-networks fastapi resnet-50 streamlit-webapp tensorflow2
Last synced: about 2 months ago
JSON representation
An easy web application that predicts whether the photo is in a formal style
- Host: GitHub
- URL: https://github.com/j-bodek/formal-photo-verification
- Owner: j-bodek
- Created: 2021-08-30T19:23:51.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-01T10:48:29.000Z (about 4 years ago)
- Last Synced: 2025-06-06T03:41:48.461Z (5 months ago)
- Topics: computer-vision, convolutional-neural-networks, fastapi, resnet-50, streamlit-webapp, tensorflow2
- Language: Jupyter Notebook
- Homepage: https://share.streamlit.io/liljack118/formal-photo-verification/app/app.py
- Size: 87.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Formal Photo Verification App
This easy web application predicts whether the photo is in a formal style.
APP: https://share.streamlit.io/liljack118/formal-photo-verification/app/app.py
API: https://formal-photo-verification-api.herokuapp.com/## Data
To train network I used dataset of 3500 images in total.
Training set - 2800 images ( 1200 positive / 1600 negative)
Validation set - 350 images (150 positive / 200 negative)
Test set - 350 images (150 positive / 200 negative)Invalid images contains:
- rotated head
- frontal head photos with sunglasses/hats/headset/unnatural mimic
- frontal head photos on wrong background
- animated frontal head photos
- empty rooms photos
- person with body
Invalid images from every subfolder were distributed equally to training,validation and test set to make sure that images in every set came from same distribution.

## Model
To make predictions I used ResNet50 network with imagenet weights. Firstly i extracted features (that will be feeded to fully connected layers) of headless model and then visualize them with t-sne to see if they are well seperated. Input size is (224,224,3).
As we can see ResNet50 with imagenet weights makes good job to separate valid and invalid images. Now let's add fully connected layers to make predictions! I chose to add two instead of one because it performs slightly better.

Model performance on test set:
## APP
To create app i used streamlit library and deployed it on https://share.streamlit.io/.## API
Api was created with fastapi and deployed on heroku.