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


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.

  • Picasa Desktop was great. It's sad that that's been killed. – Sridhar Sarnobat Sep 11 at 20:59

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.