简体   繁体   English

Python face_recognition 为什么不能识别卡通图像?

[英]Python face_recognition why not recognise cartoon image?

I am trying to face recognise by python Face-recognition library我正在尝试通过 python人脸识别库进行人脸识别

I have tried below code for below image我已经尝试过下面的代码

Code:代码:

import face_recognition

image = face_recognition.load_image_file("img/bill.jpeg")
property(image)
face_locations = face_recognition.face_locations(image)

print(len(face_locations))

For below image I am getting output for total face: 6对于下图,我得到 output 的全脸:6

Image:图片:

在此处输入图像描述

But When I am trying by a cartoon image但是当我尝试通过卡通形象

在此处输入图像描述

I am getting output: 0我得到 output: 0

How can I recognise cartoon face by face-recognition?如何通过人脸识别来识别卡通人脸?

Sorry to say but if the face recognition is good it should not recognize cartoon faces, it's designed to recognize human faces and therefore should only tell you how many human faces it is on the image, otherwise it's a bad designed algorithm.很抱歉,如果人脸识别很好,它不应该识别卡通人脸,它是为识别人脸而设计的,因此应该只告诉你图像上有多少人脸,否则它是一个糟糕的设计算法。 If you want a machine-learning algorithm to recognize cartoon faces you would have to train it your self for that specific test.如果您想要一个机器学习算法来识别卡通面孔,您必须自己训练它以进行特定测试。

I did a quick search on google and the first things I found was an article named "Cartoon Face Recognition: A Benchmark Dataset" at https://arxiv.org/pdf/1907.13394.pdf .我在 google 上进行了快速搜索,我发现的第一件事是https://arxiv.org/pdf/1907.13394.pdf上的一篇名为“卡通人脸识别:基准数据集”的文章。 Maybe you can find an already existing machine-learning algorithm that have been trained to recognize cartoon faces.也许您可以找到一种已经存在的机器学习算法,该算法经过训练可以识别卡通面孔。

Hope this helped and I hope you find what you're looking for.希望这会有所帮助,我希望你能找到你要找的东西。

--------------------------------EDIT-------------------------------- - - - - - - - - - - - - - - - - 编辑 - - - - - - - - - ---------------

I found these two git repositories, could be worth looking into more我发现了这两个 git 存储库,值得进一步研究

https://github.com/srvCodes/Cartoon-Face-Detection-and-Recognition https://github.com/hako/dissertation https://github.com/srvCodes/Cartoon-Face-Detection-and-Recognition https://github.com/hako/dissertation

The last link is a link for emotions of cartoon character.最后一个链接是卡通人物情感的链接。

Short answer: You need to train a new model to detect cartoon characters.简短回答:您需要训练一个新的 model 来检测卡通人物。

Long explanation:长解释:

  • Because cartoon characters have different facial features from normal human faces.因为卡通人物的面部特征与正常人的面孔不同。 For cartoons, the face edges are smooth, perfectly round eyes, smooth-shaped mouth, and cartoonish face structure.对于卡通人物来说,脸部边缘是光滑的,完美的圆眼睛,光滑的嘴巴和卡通脸结构。
  • The pre-trained model that you are using doesn't know to identify these structures, it hasn't seen such images during training.您正在使用的预训练 model 不知道识别这些结构,它在训练期间没有看到这样的图像。
  • A model detects a face using a lot of filters, these filters could detect lines and shapes in an image. model 使用大量过滤器检测人脸,这些过滤器可以检测图像中的线条和形状。 If all these filters combine and give a high output, then there is a face in that location.如果所有这些过滤器结合起来并给出高 output,那么在那个位置就有一张脸。
  • So, you either have to look for models that are trained on cartoons, or label and train a model by your self.因此,您要么必须寻找经过卡通训练的模型,要么必须寻找 label 并自行训练 model。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM