{"id":19430713,"url":"https://github.com/jmrashed/face-detection-using-opencv","last_synced_at":"2026-05-07T16:40:14.559Z","repository":{"id":238827338,"uuid":"621174251","full_name":"jmrashed/face-detection-using-opencv","owner":"jmrashed","description":"Face Detection using OpenCV","archived":false,"fork":false,"pushed_at":"2023-03-30T15:57:33.000Z","size":10556,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-07T20:14:40.009Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jmrashed.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":"2023-03-30T06:16:44.000Z","updated_at":"2023-03-30T06:17:55.000Z","dependencies_parsed_at":"2024-05-08T11:41:32.621Z","dependency_job_id":null,"html_url":"https://github.com/jmrashed/face-detection-using-opencv","commit_stats":null,"previous_names":["jmrashed/face-detection-using-opencv"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Fface-detection-using-opencv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Fface-detection-using-opencv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Fface-detection-using-opencv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmrashed%2Fface-detection-using-opencv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmrashed","download_url":"https://codeload.github.com/jmrashed/face-detection-using-opencv/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240612535,"owners_count":19829027,"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-10T14:26:15.455Z","updated_at":"2025-11-18T16:04:19.672Z","avatar_url":"https://github.com/jmrashed.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face Detection using OpenCV\nThis project is a simple face detection program using OpenCV in Python. It detects faces in real-time video stream from a webcam or a video file and marks the faces with green rectangles if they match the faces in a pre-defined list, and red rectangles if they don't match.\n\n## Getting Started\nTo get started with the project, you need to have OpenCV installed on your system. You can install OpenCV using pip:\n`pip install opencv-python`\nYou also need to download the haarcascade_frontalface_default.xml file and save it in the same directory as the Python script. This file contains the pre-trained classifier for detecting frontal faces.\n\n## Usage\nTo run the program, execute the following command in the terminal:\n`python face_detection.py`\n\nThe program will open a video stream from your default webcam and start detecting faces in real-time. If you want to use a video file instead, you can modify the cap variable in the code:\n\n`cap = cv2.VideoCapture('path/to/video/file.mp4')`\n\nYou can also modify the faces list to match the `faces` you want to detect. The list should contain the file paths of the images of the faces you want to detect.\n\n# Output\nWhen the program detects a face that matches one of the faces in the faces list, it will mark the face with a green rectangle:\n\n\u003cimg src=\"output/Screenshot 2023-03-30 at 12.13.58 PM.png\"\u003e\n\nIf the program detects a face that does not match any of the faces in the faces list, it will mark the face with a red rectangle:\n\n\u003cimg src=\"output/Screenshot 2023-03-30 at 12.13.58 PM.png\"\u003e\n\nThe program also writes the file paths of the faces it detects to two text files: found.txt and notfound.txt. The found.txt file contains the file paths of the faces that were detected, while the notfound.txt file contains the file paths of the faces that were not detected.\n\n\n# Credits\nThe `haarcascade_frontalface_default.xml` file used in this project is part of the `OpenCV` library and was created by Rainer Lienhart and Jochen Maydt. The file can be found in the OpenCV GitHub repository.\n\n\n## License\n\nThis project is licensed under the terms of the [MIT](https://choosealicense.com/licenses/mit/) license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrashed%2Fface-detection-using-opencv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmrashed%2Fface-detection-using-opencv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmrashed%2Fface-detection-using-opencv/lists"}