Is there a face recognition command line tool?

8

3

I've download a lot of images in one directory including People and Landscape.
I want to split the directory into two.
I'm looking for a Linux command line tool to filter by face.

enter image description here

kev

Posted 2012-05-05T11:01:38.257

Reputation: 9 972

1

related http://softwarerecs.stackexchange.com/questions/1988/floss-tools-for-facial-recognition

– Ciro Santilli 新疆改造中心法轮功六四事件 – 2016-05-27T14:01:51.897

1

and to crop out the faces: http://stackoverflow.com/questions/13211745/detect-face-then-autocrop-pictures

– Ciro Santilli 新疆改造中心法轮功六四事件 – 2016-05-28T16:22:54.777

Answers

4

You can sorta already do this with Picasa + gData API + GoogleCL.

As you know, Picasa has facial recognition, and the Google Data web API can access this. So the last piece of the puzzle is GoogleCL, which gives you access to Google services (via gData) from the command line.

I'm not sure how easy it is to do this out of the box. Perhaps you'll be the first person to attempt to access Picasa's facial recognition data via GoogleCL and you'll need to add support for it yourself. But GoogleCL already supports at least some Picasa API functions, so it shouldn't be too hard to figure out if you have some programming experience.

Of course, if you want a solution that doesn't require you to upload your images to the web, then this won't work, in which case, give pyFaces or OpenCV (Open Source Computer Vision) a try.

Lèse majesté

Posted 2012-05-05T11:01:38.257

Reputation: 3 129

Picasa Desktop was great. It's sad that that's been killed. – Sridhar Sarnobat – 2019-09-11T20:59:14.203

5

There is facedetect, which is a simple Python wrapper for OpenCV:

$ facedetect hasface.jpg
343 392 576 576
$ facedetect -q hasface.jpg;echo $?
0
$ facedetect noface.jpg
$ facedetect -q noface.jpg;echo $?
2

Installation in OS X:

curl https://raw.githubusercontent.com/wavexx/facedetect/master/facedetect>/usr/local/bin/facedetect;chmod +x /usr/local/bin/facedetect
brew tap homebrew/science;
brew install opencv;
sed -i '' s,/usr/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml,/usr/local/opt/opencv/share/OpenCV/haarcascades/haarcascade_frontalface_alt2.xml, /usr/local/bin/facedetect
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Lri

Posted 2012-05-05T11:01:38.257

Reputation: 34 501