Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 2 down vote accepted

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.

share|improve this answer

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

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

Installation in OS X:

curl>/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
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .