랭킹으로 돌아가기

nagadomi/lbpcascade_animeface

A Face detector for anime/manga using OpenCV

opencvface-detector
스타 성장
스타
2k
포크
291
주간 성장
이슈
6
5001k1.5k
2014년 11월2018년 9월2022년 8월2026년 7월
README

lbpcascade_animeface

The face detector for anime/manga using OpenCV.

Original release since 2011 at OpenCVによるアニメ顔検出ならlbpcascade_animeface.xml (in Japanese)

Usage

Download and place the cascade file into your project directory.

wget https://raw.githubusercontent.com/nagadomi/lbpcascade_animeface/master/lbpcascade_animeface.xml

Python Example

import cv2
import sys
import os.path

def detect(filename, cascade_file = "../lbpcascade_animeface.xml"):
    if not os.path.isfile(cascade_file):
        raise RuntimeError("%s: not found" % cascade_file)

    cascade = cv2.CascadeClassifier(cascade_file)
    image = cv2.imread(filename, cv2.IMREAD_COLOR)
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    gray = cv2.equalizeHist(gray)
    
    faces = cascade.detectMultiScale(gray,
                                     # detector options
                                     scaleFactor = 1.1,
                                     minNeighbors = 5,
                                     minSize = (24, 24))
    for (x, y, w, h) in faces:
        cv2.rectangle(image, (x, y), (x + w, y + h), (0, 0, 255), 2)

    cv2.imshow("AnimeFaceDetect", image)
    cv2.waitKey(0)
    cv2.imwrite("out.png", image)

if len(sys.argv) != 2:
    sys.stderr.write("usage: detect.py <filename>\n")
    sys.exit(-1)
    
detect(sys.argv[1])

Run

python detect.py imas.jpg

result

Note

I 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.

관련 저장소
opencv/opencv

Open Source Computer Vision Library

C++Apache License 2.0opencvc-plus-plus
opencv.org
90.1k56.9k
CMU-Perceptual-Computing-Lab/openpose

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation

C++Otheropenposecomputer-vision
cmu-perceptual-computing-lab.github.io/openpose
34.3k8k
spmallick/learnopencv

Learn OpenCV : C++ and Python Examples

Jupyter Notebookcomputer-visionmachine-learning
learnopencv.com
23k11.7k
memvid/memvid

Memory layer for AI Agents. Replace complex RAG pipelines with a serverless, single-file memory layer. Give your agents instant retrieval and long-term memory.

Rustcrates.ioApache License 2.0aicontext
memvid.com
16k1.4k
vipstone/faceai

一款入门级的人脸、视频、文字检测以及识别的项目.

PythonPyPIMIT Licensedlibopencv
11.1k2.5k
go-vgo/robotgo

RobotGo, Go Native cross-platform RPA, GUI automation, Auto test and Computer use @vcaesar

GoGo ModulesApache License 2.0gorobot
atomai.cc
10.7k958
openframeworks/openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.

C++Otheropenframeworksosx
openframeworks.cc
10.4k2.6k
opencv/opencv_contrib

Repository for OpenCV's extra modules

C++Apache License 2.0opencv
10.1k5.9k
Ewenwan/MVision

机器人视觉 移动机器人 VS-SLAM ORB-SLAM2 深度学习目标检测 yolov3 行为检测 opencv PCL 机器学习 无人驾驶

C++machine-visioncnn
8.7k2.8k
bytedeco/javacv

Java interface to OpenCV, FFmpeg, and more

JavaMavenOtherjavacvjava
8.3k1.6k
vietnh1009/ASCII-generator

ASCII generator (image to text, image to image, video to video)

PythonPyPIMIT Licenseasciiascii-art
8.3k651
hybridgroup/gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO.

GoGo ModulesOtheropencvgolang
gocv.io
7.5k903