{"id":15043480,"url":"https://github.com/nagadomi/lbpcascade_animeface","last_synced_at":"2025-05-16T03:01:56.639Z","repository":{"id":22956109,"uuid":"26305793","full_name":"nagadomi/lbpcascade_animeface","owner":"nagadomi","description":"A Face detector for anime/manga using OpenCV","archived":false,"fork":false,"pushed_at":"2018-11-23T05:53:31.000Z","size":782,"stargazers_count":1942,"open_issues_count":7,"forks_count":294,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-04-08T13:07:05.724Z","etag":null,"topics":["face-detector","opencv"],"latest_commit_sha":null,"homepage":"","language":null,"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/nagadomi.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}},"created_at":"2014-11-07T05:46:49.000Z","updated_at":"2025-04-01T07:48:43.000Z","dependencies_parsed_at":"2022-08-08T08:30:49.141Z","dependency_job_id":null,"html_url":"https://github.com/nagadomi/lbpcascade_animeface","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/nagadomi%2Flbpcascade_animeface","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nagadomi%2Flbpcascade_animeface/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nagadomi%2Flbpcascade_animeface/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nagadomi%2Flbpcascade_animeface/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nagadomi","download_url":"https://codeload.github.com/nagadomi/lbpcascade_animeface/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459077,"owners_count":22074604,"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-detector","opencv"],"created_at":"2024-09-24T20:49:07.526Z","updated_at":"2025-05-16T03:01:56.543Z","avatar_url":"https://github.com/nagadomi.png","language":null,"funding_links":[],"categories":["Image Recognition","Others"],"sub_categories":[],"readme":"# lbpcascade_animeface\n\nThe face detector for anime/manga using OpenCV.\n\nOriginal release since 2011 at [OpenCVによるアニメ顔検出ならlbpcascade_animeface.xml](http://ultraist.hatenablog.com/entry/20110718/1310965532) (in Japanese)\n\n## Usage\n\nDownload and place the cascade file into your project directory.\n\n    wget https://raw.githubusercontent.com/nagadomi/lbpcascade_animeface/master/lbpcascade_animeface.xml\n\n### Python Example\n\n```python\nimport cv2\nimport sys\nimport os.path\n\ndef detect(filename, cascade_file = \"../lbpcascade_animeface.xml\"):\n    if not os.path.isfile(cascade_file):\n        raise RuntimeError(\"%s: not found\" % cascade_file)\n\n    cascade = cv2.CascadeClassifier(cascade_file)\n    image = cv2.imread(filename, cv2.IMREAD_COLOR)\n    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)\n    gray = cv2.equalizeHist(gray)\n    \n    faces = cascade.detectMultiScale(gray,\n                                     # detector options\n                                     scaleFactor = 1.1,\n                                     minNeighbors = 5,\n                                     minSize = (24, 24))\n    for (x, y, w, h) in faces:\n        cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2)\n\n    cv2.imshow(\"AnimeFaceDetect\", image)\n    cv2.waitKey(0)\n    cv2.imwrite(\"out.png\", image)\n\nif len(sys.argv) != 2:\n    sys.stderr.write(\"usage: detect.py \u003cfilename\u003e\\n\")\n    sys.exit(-1)\n    \ndetect(sys.argv[1])\n```\nRun\n\n    python detect.py imas.jpg\n\n![result](https://user-images.githubusercontent.com/287255/43184241-ed3f1af8-9022-11e8-8800-468b002c73d9.png)\n\n## Note\nI am providing similar project at https://github.com/nagadomi/animeface-2009. animeface-2009 is my original work that was made before libcascade_animeface. The detection accuracy is higher than this project. However, installation of that is a bit complicated. Also I am providing a face cropping script using animeface-2009.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnagadomi%2Flbpcascade_animeface","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnagadomi%2Flbpcascade_animeface","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnagadomi%2Flbpcascade_animeface/lists"}