{"id":23406955,"url":"https://github.com/charan12-git/gender-and-age-detection","last_synced_at":"2026-06-23T13:32:24.136Z","repository":{"id":266881805,"uuid":"899634520","full_name":"charan12-git/Gender-and-Age-Detection","owner":"charan12-git","description":"A Python project which can detect gender and age using OpenCV of the person  in a image or through camera.","archived":false,"fork":false,"pushed_at":"2024-12-06T18:45:55.000Z","size":3467,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T23:35:33.597Z","etag":null,"topics":["age","agedetection","gender-detection","images","opencv","python","webcam"],"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/charan12-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-12-06T17:14:46.000Z","updated_at":"2024-12-06T18:45:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"65b31559-4b18-441a-b2f8-72ad42ba801b","html_url":"https://github.com/charan12-git/Gender-and-Age-Detection","commit_stats":null,"previous_names":["charan12-git/gender-and-age-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/charan12-git/Gender-and-Age-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan12-git%2FGender-and-Age-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan12-git%2FGender-and-Age-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan12-git%2FGender-and-Age-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan12-git%2FGender-and-Age-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charan12-git","download_url":"https://codeload.github.com/charan12-git/Gender-and-Age-Detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charan12-git%2FGender-and-Age-Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272936462,"owners_count":25018169,"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","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["age","agedetection","gender-detection","images","opencv","python","webcam"],"created_at":"2024-12-22T14:16:26.108Z","updated_at":"2026-06-23T13:32:24.087Z","avatar_url":"https://github.com/charan12-git.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gender-and-Age-Detection\n\n\u003ch2\u003eObjective\u003c/h2\u003e\n\n\u003cp\u003eDevelop a gender and age detection system capable of estimating the gender and age range of a person based on their facial image, either from a photo or a webcam feed.\u003c/p\u003e\n\n\u003cp\u003eThis Python-based project leverages deep learning techniques to estimate gender and age from a single facial image. The models, pre-trained by Tal Hassner and Gil Levi, have been utilized to perform these predictions. The gender prediction outputs one of two categories: Male or Female. For age, the system predicts one of the following predefined ranges:\n\n(0 – 2)\n(4 – 6)\n(8 – 12)\n(15 – 20)\n(25 – 32)\n(38 – 43)\n(48 – 53)\n(60 – 100)\nThe classification approach was chosen over regression due to the inherent challenges in pinpointing an exact age from a single image. Factors such as makeup, lighting, obstructions, and facial expressions can significantly impact accuracy. By framing it as a classification problem, the model can effectively assign the image to the most probable age range.\n\n\n\n\u003c/p\u003e\n\u003ch2\u003eAdditional Python Libraries Required :\u003c/h2\u003e\n\u003cul\u003e\n  \u003cli\u003eOpenCV\u003c/li\u003e\n          \n     pip install opencv-python\n  \n\u003c/ul\u003e\n\u003cul\u003e\n \u003cli\u003eargparse\u003c/li\u003e\n  \n     pip install argparse\n\u003c/ul\u003e\n\u003ch2\u003eContents :\u003c/h2\u003e\n\u003cul\u003e\n  \u003cli\u003eopencv_face_detector.pbtxt\u003c/li\u003e\n  \u003cli\u003eopencv_face_detector_uint8.pb\u003c/li\u003e\n  \u003cli\u003eage_deploy.prototxt\u003c/li\u003e\n  \u003cli\u003egender_deploy.prototxt\u003c/li\u003e\n  \u003cli\u003ea few pictures to try the project on\u003c/li\u003e\n  \u003cli\u003edetect.py\u003c/li\u003e\n \u003c/ul\u003e\n\u003cp\u003eFor face detection, we have a .pb file- this is a protobuf file (protocol buffer); it holds the graph definition and the trained weights of the model. We can use this to run the trained model. And while a .pb file holds the protobuf in binary format, one with the .pbtxt extension holds it in text format. These are TensorFlow files. For age and gender, the .prototxt files describe the network configuration \u003c/p\u003e\n \u003ch2\u003eUsage :\u003c/h2\u003e\n \u003cul\u003e\n  \u003cli\u003eDownload my Repository\u003c/li\u003e\n  \u003cli\u003eOpen your Command Prompt or Terminal and change directory to the folder where all the files are present.\u003c/li\u003e\n  \u003cli\u003e\u003cb\u003eDetecting Gender and Age of face in Image\u003c/b\u003e Use Command :\u003c/li\u003e\n  \n  \n      python detect.py --image \u003cimage_name\u003e\n\u003c/ul\u003e\n \u003cp\u003e\u003cb\u003eNote: \u003c/b\u003eThe Image should be present in same folder where all the files are present\u003c/p\u003e \n\u003cul\u003e\n  \u003cli\u003e\u003cb\u003eDetecting Gender and Age of face through webcam\u003c/b\u003e Use Command :\u003c/li\u003e\n  \n      python detect.py\n\u003c/ul\u003e\n\u003ch2\u003eWorking And Examples\u003c/h2\u003e\n            \n    \u003epython detect.py --image woman_1.jpg\n    Gender: Female\n    Age: 25-32years \n\u003cimg src=\"detect_woman_1.png\"\u003e\n \n    \u003epython detect.py --image oldman_2.jpg\n    Gender: Male\n    Age: 60-100 years\n    \n    \n\u003cimg src=\"detect_oldman.png\"\u003e\n          \u003cp\u003e\u003e\u003cli\u003epython detect.py --image man_1.jpg\u003c/li\u003e\n    \u003cli\u003eGender: Man\u003c/li\u003e\n   \u003cli\u003e Age: 25-32 years \u003c/li\u003e \u003c/p\u003e\n\n    \n\u003cimg src=\"detecting man_1.png\"\u003e\n\n    \u003epython detect.py --image girl_2.jpg\n    Gender: Female\n    Age: 8-12 years  \n    \n\u003cimg src=\"detect_girl_2.png\"\u003e\n            \n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharan12-git%2Fgender-and-age-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharan12-git%2Fgender-and-age-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharan12-git%2Fgender-and-age-detection/lists"}