Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
146 lines (127 sloc) 4.95 KB
"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
<html xml:lang='en' xmlns:svg='' xmlns=''>
<head><meta content='application/xhtml+xml;charset=utf-8' http-equiv='Content-type' /><title>Mugshot</title>
body {
margin: auto;
width: 50%;
font-family: 'DejaVu Sans', sans-serif;
h1 {
font-size: 35px;
p {
font-size: 14px;
line-height: 150%;
<h1>Mugshot (Just slightly better than alpha)</h1>
scrolling="no" frameborder="0" style="border:none; overflow:hidden;
width:450px; height:35px;" allowTransparency="true"></iframe>
Mugshot is a web service which provides simple face-detection in images. It
is an experiment making use of <a href="">libface</a>
and <a href="">node.js</a>. A simple API allows clients
to upload or provide a URL for an image file. Mugshot will detect faces
and provide co-ordinates or allow a browser-based view highlighting the
Mugshot is an <strong>experiment</strong>. It was inspired by <a
href="">OpenKeyVal</a>. It does not provide a
permanent image hosting service like Flickr or Picasa. It is liable
to go down or be shut off at any point. Do not expect
that your images will be around for-ever or that they are privacy
So please make sure you think twice before trying it on an image.
I will of course <strong>NOT sell or distribute</strong> your images in any manner,
but <strong>nothing is stopping others</strong> from browsing through images by ID.
<h2>Who is behind Mugshot?</h2>
Mugshot is created by <a href="">Nikhil
Marathe</a> using a thin V8 binding he has written to libface.
All code is open source and available on <a
Mugshot allows either file uploads or providing a URL to a remote image
API access is of course langauge and platform specific. <a
href="">cURL</a> examples are provided.
<p>Images are restricted to a maximum of 5Mb in size. They will also be
deleted whenever disk space is low in order of least recently uploaded.</p>
All replies are formatted as <a href="">JSON</a> literals.
The <code>status</code> attribute will be either <code>"success"</code> or
If <code>"success"</code>, the reply will be:</p>
"status": "success",
"id": "&lt;id&gt;",
"image_url": ";unique_image_file&gt;",
"share_url": ";id&gt;",
"faces": [{
"x": 5,
"y": 5,
"width": 30,
"height": 30
<code>image_url</code> provides the image directly, while
<code>share_url</code> has JavaScript and CSS which highlights the faces and
is a good way to view in the browser.
<code>faces</code> is an array of objects, each having
the co-ordinates of one face. It <strong>may</strong> be empty, if no faces
are detected. In case of an error:
"status": "error",
"message": "error message"
In addition, the HTTP status code will depend on the result.
<li>200 - OK</li>
<li>415 - libface error. The most likely reason is the image format not
being supported.</li>
<li>500 - Some other error.</li>
<h3>File uploads</h3>
<p>Make a POST request to <a href=""></a>
with the request body being the image data.</p>
curl --data-binary @/path/to/image/file.ext
<p>Make a POST request to <a href=""></a>
with the request body being the URL where the image can be found.</p>
curl --data "http://url/toimage"
<h2>Thanks to</h2>
<a href="">Swair Shah</a> and <a
href="">Aditya Bhatt</a> for pointing
out edge case bugs.