https://github.com/zuruoke/face-crop-app
Training a RetinaNet to instinctively crop scale & pose variant face(s) from pictures and save as a new image file
https://github.com/zuruoke/face-crop-app
Last synced: 8 months ago
JSON representation
Training a RetinaNet to instinctively crop scale & pose variant face(s) from pictures and save as a new image file
- Host: GitHub
- URL: https://github.com/zuruoke/face-crop-app
- Owner: zuruoke
- Created: 2020-06-05T15:31:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-05T20:24:12.000Z (about 6 years ago)
- Last Synced: 2024-12-27T11:33:24.015Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 3.51 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Face Crop App
This Application involves Training a RetinaNet to instinctively crop out scale and position-variant face(s) from pictures and save as a new image file.
*If you want to know about the RetinaNet - I'd suggest you check [this kernel](https://github.com/zuruoke/Race-Detection-with-RetinaNet/blob/master/README.md), it's pretty intuitive*
I used a pre-trained RetinaNet with Resnet50 as the backbone and then fine-tuned it to classify and detect (to draw a bounding box around a human face). The bounding box output was used to crop out the specific object(s) in the image.
This Model is very pretty **scale** and **pose invariant**
Images from [flickr](https://www.flickr.com/) and [shutterstock](https://www.shutterstock.com/) constituted of the training dataset
The workflow are outlined as follows:
- Use labelimg to annotate (label and specify the bounding box cordinates) all the objects in the image in a [Pascal VOC format](http://host.robots.ox.ac.uk/pascal/VOC/#:~:text=The%20PASCAL%20VOC%20project%3A,and%20comparison%20of%20different%20methods)
- Run a xml script to convert the Pascal VOC format (xml) to csv as that's what a RetinaNet expects
- Load the Pretrained RetinaNet from keras and all it's dependencies and navigate to the main file directory
- Train the Pretrained RetinaNet by specifying a backbone (I used Retina50) and save the learned parameters after each epochs
- Convert the saved model to an inference graph to test on unseeen data
- Save the results as a Pandas DataFrame using the corresponding datapoints after testing on the test data
- Use OpenCV's imwrite function to save the cropped image to a folder
# Results
 















# Significance
- This can be used to build an Image Dataset or Database
# Stack Technologies
- Python 3.7
- Tensorflow 2.x
- Keras
- Numpy
- OpenCV
- Matplotlib
- Pillow
- Pandas
.
**P.S**: I had to fail (tune) the Training Process a little bit, so that the cropped image has a little background