{"id":18644870,"url":"https://github.com/zuruoke/face-crop-app","last_synced_at":"2025-11-05T02:30:35.230Z","repository":{"id":113055319,"uuid":"269685525","full_name":"zuruoke/Face-Crop-App","owner":"zuruoke","description":"Training a RetinaNet to instinctively crop scale \u0026 pose variant face(s) from pictures and save as a new image file","archived":false,"fork":false,"pushed_at":"2020-06-05T20:24:12.000Z","size":3683,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T11:33:24.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuruoke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-05T15:31:55.000Z","updated_at":"2020-06-05T20:24:15.000Z","dependencies_parsed_at":"2023-06-07T13:30:24.333Z","dependency_job_id":null,"html_url":"https://github.com/zuruoke/Face-Crop-App","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FFace-Crop-App","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FFace-Crop-App/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FFace-Crop-App/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuruoke%2FFace-Crop-App/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuruoke","download_url":"https://codeload.github.com/zuruoke/Face-Crop-App/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239449541,"owners_count":19640532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T06:13:51.518Z","updated_at":"2025-11-05T02:30:35.185Z","avatar_url":"https://github.com/zuruoke.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face Crop App\n\nThis Application involves Training a RetinaNet to instinctively crop out scale and position-variant face(s) from pictures and save as a new image file. \n\n*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*\n\nI 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.\n\nThis Model is very pretty **scale** and **pose invariant**\n\nImages from [flickr](https://www.flickr.com/) and [shutterstock](https://www.shutterstock.com/) constituted of the training dataset\n\nThe workflow are outlined as follows:\n\n- 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)\n- Run a xml script to convert the Pascal VOC format (xml) to csv as that's what a RetinaNet expects\n- Load the Pretrained RetinaNet from keras and all it's dependencies and navigate to the main file directory\n- Train the Pretrained RetinaNet by specifying a backbone (I used Retina50) and save the learned parameters after each epochs\n- Convert the saved model to an inference graph to test on unseeen data\n- Save the results as a Pandas DataFrame using the corresponding datapoints after testing on the test data\n- Use OpenCV's imwrite function to save the cropped image to a folder\n\n# Results\n![220](https://user-images.githubusercontent.com/51057490/83917973-b221f600-a76f-11ea-8484-c82f6f8f0780.jpg) ![c5](https://user-images.githubusercontent.com/51057490/83918046-daa9f000-a76f-11ea-8543-64252f236f99.JPG)\n![c6](https://user-images.githubusercontent.com/51057490/83918051-dda4e080-a76f-11ea-8a75-317637b17cc3.JPG)\n\n\n\n\n![180](https://user-images.githubusercontent.com/51057490/83918128-062cda80-a770-11ea-8aa4-be090dbe9422.jpg)\n![c1](https://user-images.githubusercontent.com/51057490/83918140-0a58f800-a770-11ea-843e-9d021fe6413a.JPG)\n\n\n![160](https://user-images.githubusercontent.com/51057490/83918218-2e1c3e00-a770-11ea-8467-e0bc3b11860e.jpg)\n![c8](https://user-images.githubusercontent.com/51057490/83918234-34121f00-a770-11ea-815a-c1e47965ca18.JPG)![c15](https://user-images.githubusercontent.com/51057490/83918408-9408c580-a770-11ea-84ee-60fb2a9e29f2.JPG)\n\n![170](https://user-images.githubusercontent.com/51057490/83918480-b8fd3880-a770-11ea-88b8-f582965e32df.jpg)\n![c7](https://user-images.githubusercontent.com/51057490/83918490-bef31980-a770-11ea-821e-dbe8f01a3af5.JPG)\n\n![190](https://user-images.githubusercontent.com/51057490/83918539-dd591500-a770-11ea-856f-d55c068f66ac.jpg)\n![c13](https://user-images.githubusercontent.com/51057490/83918552-ea760400-a770-11ea-9e4a-4b6e7dae56cc.JPG)\n![c14](https://user-images.githubusercontent.com/51057490/83918589-fc57a700-a770-11ea-8b76-e0aa849aa63e.JPG)\n\n![200](https://user-images.githubusercontent.com/51057490/83918699-2d37dc00-a771-11ea-97fa-8e0fed1b2e7a.jpg)\n![c2](https://user-images.githubusercontent.com/51057490/83918812-5e181100-a771-11ea-822c-3d6926c50322.JPG)\n\n![210](https://user-images.githubusercontent.com/51057490/83918942-991a4480-a771-11ea-84ef-e6875d7fc997.jpeg)\n![c9](https://user-images.githubusercontent.com/51057490/83918965-a1727f80-a771-11ea-9bd6-d5441a8610f2.JPG)\n![c10](https://user-images.githubusercontent.com/51057490/83918974-a59e9d00-a771-11ea-8a28-881d668a8802.JPG)\n\n\n# Significance\n\n- This can be used to build an Image Dataset or Database\n\n# Stack Technologies\n\n- Python 3.7\n- Tensorflow 2.x\n- Keras\n- Numpy \n- OpenCV\n- Matplotlib\n- Pillow\n- Pandas\n\n\n\n\n                                             .\n\n\n**P.S**: I had to fail (tune) the Training Process a little bit, so that the cropped image has a little background\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuruoke%2Fface-crop-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuruoke%2Fface-crop-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuruoke%2Fface-crop-app/lists"}