{"id":25778495,"url":"https://github.com/justinianus2001/face-detection","last_synced_at":"2026-04-29T15:08:39.860Z","repository":{"id":181655806,"uuid":"666988463","full_name":"Justinianus2001/face-detection","owner":"Justinianus2001","description":"Building face object recognition and classification model based on Facenet model","archived":false,"fork":false,"pushed_at":"2023-07-16T16:46:59.000Z","size":2122,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T06:56:03.520Z","etag":null,"topics":["face-classification","face-detection","facenet","python","tensorflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Justinianus2001.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-16T09:07:06.000Z","updated_at":"2023-08-08T07:53:54.000Z","dependencies_parsed_at":"2023-07-16T17:52:57.508Z","dependency_job_id":null,"html_url":"https://github.com/Justinianus2001/face-detection","commit_stats":null,"previous_names":["justinianus2001/face-detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justinianus2001%2Fface-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justinianus2001%2Fface-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justinianus2001%2Fface-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justinianus2001%2Fface-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Justinianus2001","download_url":"https://codeload.github.com/Justinianus2001/face-detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Justinianus2001%2Fface-detection/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259124704,"owners_count":22809008,"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":["face-classification","face-detection","facenet","python","tensorflow"],"created_at":"2025-02-27T06:33:56.006Z","updated_at":"2026-04-29T15:08:39.814Z","avatar_url":"https://github.com/Justinianus2001.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face Detection and Classification\n\n![Python version](https://img.shields.io/badge/python-3.6.15-blue)\n![License](https://img.shields.io/badge/license-MIT-white)\n![Tensorflow version](https://img.shields.io/badge/tensorflow-1.7.0-orange)\n\n\nThis repository contains a reimplementation of the FaceNet model for face detection and classification. The model is trained to predict the name of a person appearing in an image.\n\n## Table of Contents\n\n- [Face Detection and Classification](#face-detection-and-classification)\n  - [Table of Contents](#table-of-contents)\n  - [Introduction](#introduction)\n  - [Installation](#installation)\n  - [Dataset](#dataset)\n  - [Usage](#usage)\n  - [Training](#training)\n  - [Results](#results)\n  - [Contributing](#contributing)\n  - [License](#license)\n\n## Introduction\n\nThe Face Detection and Classification project aims to detect and classify faces in images to predict the name of the person in each detected face. This repository provides an implementation of the FaceNet model, which is a deep convolutional neural network (CNN) designed for face recognition tasks.\n\n## Installation\n\n1. Clone the repository:\n\n   ```\n   git clone https://github.com/Justinianus2001/face-detection.git\n   ```\n\n2. Go to the repository folder and set the python paths to use facenet functions\n\n   ```\n   cd face-detection\n   set PYTHONPATH=[...]\\face-detection\\src\n   ```\n\n3. Install the required dependencies:\n\n   ```\n   pip install -r requirements.txt\n   ```\n\n4. Download the pre-trained detect face models for the FaceNet model and place in the `model/` directory.\n\n    | Model name      | LFW accuracy | Training dataset | Architecture |\n    |-----------------|--------------|------------------|-------------|\n    | [20180408-102900](https://drive.google.com/open?id=1R77HmFADxe87GmoLwzfgMu_HY0IhcyBz) | 0.9905        | CASIA-WebFace    | [Inception ResNet v1](https://github.com/davidsandberg/facenet/blob/master/src/models/inception_resnet_v1.py) |\n    | [20180402-114759](https://drive.google.com/open?id=1EXPBSXwTaqrSC0OhUdXNmKSh9qJUQ55-) | 0.9965        | VGGFace2      | [Inception ResNet v1](https://github.com/davidsandberg/facenet/blob/master/src/models/inception_resnet_v1.py) |\n\n## Dataset\n\nTo train the face classification model, you will need a dataset of labeled face images. Unfortunately, this repository does not provide a pre-packaged dataset. You should prepare your own dataset with images of people's faces and their corresponding names.\n\nEnsure that your dataset is organized in the following structure:\n\n```\ndata/images/raw\n├── person1/\n│   ├── image1.jpg\n│   ├── image2.jpg\n│   └── ...\n├── person2/\n│   ├── image1.jpg\n│   ├── image2.jpg\n│   └── ...\n└── ...\n```\n\nNote: Facenet model required at least 2 object detection to train and predict.\n\n## Usage\n\nTo use the face labeled system, follow these steps:\n\n1. Prepare your input images and ensure that they are stored in a directory.\n\n2. Run the following command to detect and recognize faces in the images:\n\n```\npython src/align/align_dataset_mtcnn.py data/images/raw data/images/processed --image_size 182 --margin 44 --random_order --gpu_memory_fraction 0.25\n```\n\n   This will process the images in the `data/images/raw/` directory, detect faces, and save the annotated images in the `data/images/processed/` directory.\n\n## Training\n\nTo train the face classification model on your own dataset, run the following command to start the training:\n\n```\npython src/classifier.py TRAIN data/images/processed model/[detect-model].pb model/facemodel.pkl --batch_size 1000 --min_nrof_images_per_class 40 --nrof_train_images_per_class 35\n```\n\nThis will start the training process using your dataset. The trained model will be saved in the specified output directory `model/facemodel.pkl`.\n\n## Results\n\nRun the file `src/test_webcam.py` to test your result trained model online in webcam.\n\n```\npython src/test_webcam.py\n```\n\nThe results achieved by the face detection and classification model trained on your dataset will vary depending on various factors such as the quality of your dataset, the size of the training set, and the chosen hyperparameters. It is recommended to experiment with different configurations to achieve the best results for your specific use case.\n\n## Contributing\n\nContributions to this repository are welcome. If you find any issues or would like to suggest improvements, please open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the [MIT License](https://github.com/Justinianus2001/face-detection/blob/master/LICENSE.md). Feel free to use and modify the code for your own purposes.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinianus2001%2Fface-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinianus2001%2Fface-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinianus2001%2Fface-detection/lists"}