26 captures
17 Feb 2012 - 12 Nov 2024
Apr MAY Jun
24
2012 2013 2014
success
fail

About this capture

COLLECTED BY

Organization: Internet Archive

The Internet Archive discovers and captures web pages through many different web crawls. At any given time several distinct crawls are running, some for months, and some every day or longer. View the web archive through the Wayback Machine.

Collection: Wide Crawl started April 2013

Web wide crawl with initial seedlist and crawler configuration from April 2013.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20130524082543/http://lwn.net/Articles/469662/
 
LWN.net Logo

Log in now

Create an account

Subscribe to LWN

Return to the Kernel page

LWN.net Weekly Edition for May 23, 2013

An "enum" for Python 3

An unexpected perf feature

LWN.net Weekly Edition for May 16, 2013

A look at the PyPy 2.0 release

Hardware face detection

ByJonathan Corbet
November 29, 2011
Once upon a time, a "system on chip" (SOC) was a package containing a processor and some number of I/O controllers. While SOCs still have all that, manufacturers have been busy adding hardware support for all kinds of interesting functionality. For example, OMAP4 processors have an onboard face detection module that can be used for camera focus control,『face unlock』features, and more. Naturally, there is interest in making use of such features in Linux; a recent driver submission shows that the question of just how to do that has not yet been answered, though.

The OMAP4 face recognition detection driver was submitted by Tom Leiming, but was apparently written by Ming Lei. Upon initialization, the driver allocates a memory area which is made available to an application via mmap(). The application places an image in that area (it seems that a 320x240 grayscale PGM image is the only supported option), then uses a number of ioctl() operations to specify the area of interest and to start and stop the image recognition process. A [face
recognition] read() on the device will, once detection is complete, yield a number of structures describing the locations of the faces in the image as rectangles.

Face detection functionality is clearly welcome, but this particular driver has a lot of problems and will not get into the mainline in anything resembling its current state. The most significant criticism, though, came from Alan Cox, who asked that, rather than being implemented as a standalone device, face detection be integrated into the Video4Linux2 framework.

In truth, V4L2 is probably the right place for this feature. Face detection is generally meant to be used with the camera controller integrated into the same SOC and the face detection hardware may be tightly tied to that controller. The media controller subsystem was designed for just this kind of functionality; it provides a mechanism by which camera data may (or may not) be routed to the face detection module as needed. Integration into V4L2 would bring the face detection module under the same umbrella as the rest of the video processing hardware and export the necessary data routing capabilities to user space.

The design of the user-space interface for this functionality seems likely to pose challenges of its own, though. The OMAP4 hardware is relatively simple in its operation; it appears to even lack the ability to work with multiple image formats, even moderately high-resolution images, or color data. Future hardware will certainly not be so limited. It is also not hard to imagine a shift from detection of any face to recognition of specific faces - or, at least, the generation of metrics to ease the association of faces and the identities of their owners. The hardware could become capable of blink detection, distinguishing real faces from pictures of faces, or determining when a face belongs to a poker player who is bluffing. Designing an API that can handle this kind of functionality is going to be an interesting task.

But it does not stop there. There is a discouragingly large market out there for devices capable of reading automobile license plates, for example. There is money in meeting the needs of the contemporary surveillance state, so manufacturers will certainly compete to provide the needed capabilities. In general, the world is filled with interesting things that are not faces; it is not hard to imagine that people will be able to do useful things with devices that can pick all kinds of high-level objects out of image data.

In general, we may be seeing a shift in what kinds of peripherals are attached to our processors. There will always be plenty of devices that serve essentially (from the CPU's point of view) as channels moving chunks of data in one direction or the other. But there will be more and more devices that offload some type of processing, and that is going to present some interesting ABI challenges. Hardware-based offload engines are nothing new, of course. But, once upon a time, offload devices mostly performed tasks otherwise handled by the operating system kernel. Integrated controllers and network protocol offload functionality are a couple of obvious examples. More recently, though, hardware has provided functionality that needs to be made available to user space. And that changes the game somewhat.

If one looks for examples of this kind of functionality, one almost certainly needs to start at the GPU found in most graphics cards. Creating a workable (and stable) user-space ABI providing access to the GPU has taken many years, and it is not clear that the job is done yet. The media controller ABI controls routing of data among the numerous interesting functional units in contemporary video processors, but writing a hardware-independent application using the media controller is hard. Creating a workable interface for the wide variety of available industrial sensors has also been a multi-year project.

Trying to anticipate where this kind of hardware will go in an attempt to create the perfect ABI from the outset seems like an exercise in futility. Most likely it will have to be done the way we've always done it: come up with something that seems reasonable, learn (the hard way) what it's shortcomings are, then begin the long process of replacing it with something better. It is not an ideal way to create an operating system, but it seems to be better than the alternatives. Figuring out the best way to support face detection will just be another step in this ongoing process.


(Log in to post comments)

Hardware face recognition

Posted Dec 1, 2011 3:31 UTC (Thu) by ewan (subscriber, #5533) [Link]

The OMAP4 face recognition driver was submitted by Tom Leiming, but was apparently written by Ming Lei.

Is one of those names not simply an anglicised version of the other, making them actually the same person?

Hardware face recognition

Posted Dec 1, 2011 11:01 UTC (Thu) by paulj (subscriber, #341) [Link]

According to my local chinese person, most likely their chinese name is "Lei Ming", as "Lei" is more likely to be the family name (which goes first in Chinese, and many other east-asian cultures). "Ming Lei" then is also a westernised version of their name, with the order changed to our family-name last - to avoid the hassle & confusion east-asians have when they try to use their "native" name in the West, and "Tony" is a western name they've adopted, cause us westerners never seem to be able to remember chinese names.

Another name difference tween east-asia and here: they pretty much always use full-names. They don't drop family names when they call or refer to each other, as we often do - not even within families. I.e. there pretty much is no 'familiar' name. E.g. you pretty much wouldn't ever refer to "Lei Ming" of this article as just "Ming".

Hardware face recognition

Posted Dec 2, 2011 19:59 UTC (Fri) by giraffedata (subscriber, #1954) [Link]

My local Chinese person says his family members never refer to each other with their family name. He's from Shanghai. The parents are in their 70s; children in their 40s.

Hardware face recognition

Posted Dec 6, 2011 20:13 UTC (Tue) by job (guest, #670) [Link]

I'm not so sure it's a good idea to extrapolate cultural tendencies like that. China is a continent, and I would expect regional differences to be just as large as between a Finn and a Greek for example (or a New Englander and a Mexian if you're so inclined).

Hardware face recognition

Posted Dec 13, 2011 7:27 UTC (Tue) by paulj (subscriber, #341) [Link]

So my comment is both over-reaching in its claims and a bit wrong. ;) I should have restricted myself to saying that generally with Chinese names you should use the full name, and that it appears to me to generally not be the done thing to break it up and use just a portion of it as a familiar name, as you might in the west.

Hardware face recognition

Posted Dec 1, 2011 9:22 UTC (Thu) by Fowl (subscriber, #65667) [Link]

I suppose "hardware" really means "software running somewhere else". I wonder if this somewhere else is programmable. If it is I wonder what else it could do, how it could be abstracted, as maybe another NUMA node? as a "GPGPU" type device? Does the kernel support swapping threads between architectures? It's an interesting problem. At the very least getting a common software layer above "special features".

Hardware face recognition

Posted Dec 1, 2011 11:03 UTC (Thu) by dlang (✭ supporter ✭, #313) [Link]

I believe that NUMA nodes are all expected to be the same architecture.

This also sounds to me more like a CPU with additional commands than software that happens to run on another CPU (although with microcode, all CPU commands are 'just software running on another CPU'), think of it more like the features that some CPUs have to generate random numbers, or better yet, to do AES encryption in 'hardware', you create a memory area containing the info you want the command to run on, fill it with 'interesting' data, invoke the CPU command, and get back a large chunk of 'useful' data.

Hardware face recognition

Posted Dec 1, 2011 13:46 UTC (Thu) by GhePeU (subscriber, #56133) [Link]

This came up a few months ago, when the c6x and Hexagon architectures were merged (https://lwn.net/Articles/457635/). I don't know if that virtio-based framework is being worked on.

Hardware face recognition

Posted Dec 1, 2011 21:15 UTC (Thu) by linusw (subscriber, #40300) [Link]

If this is just an offload core as in "AMP node" it'd be eligible to use Ohad Ben Cohens RPMesg for it as described elsewhere:
http://lwn.net/Articles/464391/

That requires a firmware which can be patched to talk that very protocol or more generally just that you can alter the stuff on the other side as you like.

However this is probably not the case, this seems to be autonomous silicon, judging from the very specific register map, and the note from other developers that it's also deployed in other silicon.

Hardware face recognition

Posted Dec 1, 2011 22:09 UTC (Thu) by iabervon (subscriber, #722) [Link]

A lot of the "software running somewhere else" things these days are running on FPGAs, or as ASICs designed as software but compiled to chip designs. Even in the case where it is some sort of microcontroller, it's reasonably likely not to be able to run code except from flash, making it impractical to schedule threads to, even if it is the same architecture as the nominal CPU. Even when it's programmable, it's probably best to model as a hotpluggable bus, where you can cause a device with a particular function to appear by loading its firmware, simply because it causes wear and takes significant time to reprogram it.

Hardware face recognition

Posted Dec 1, 2011 9:52 UTC (Thu) by dgm (subscriber, #49227) [Link]

> But there will be more and more devices that offload some type of processing, and that is going to present some interesting ABI challenges.

As always, a very accurate analysis, John.

It's also something that has been at the back of my head for some time now. All those processing services share many traits with plain software libraries. Maybe they should be abstracted that way, behind a layer of user-mode library code. And maybe in this case, Linus should consider to lower the standard of never breaking ABI compatibility. At least until an stable standard emerges.

Hardware face recognition

Posted Dec 1, 2011 15:41 UTC (Thu) by michaeljt (subscriber, #39183) [Link]

> It's also something that has been at the back of my head for some time now. All those processing services share many traits with plain software libraries. Maybe they should be abstracted that way, behind a layer of user-mode library code. And maybe in this case, Linus should consider to lower the standard of never breaking ABI compatibility. At least until an stable standard emerges.

Or perhaps the way to go would to be a versioned ABI. You create version 1 which supports the needs of currently known devices along with needs that near-future devices are likely to have, you expand it (1.1) as additional needs emerge and you add an incompatible version 2 (without dropping version 1) when a generation of devices emerges that are too different to comfortably fit version 1. User space then has a limited number of clearly defined ABIs to support while the kernel developers can concentrate on real usage cases without having to create a needlessly flexible/complex ABI.

Hardware face recognition

Posted Dec 1, 2011 15:25 UTC (Thu) by ming.lei (subscriber, #74703) [Link]

In fact, OMAP4 has a built-in face detection module, not face
recognition, which should be implemented on software generally
speaking, and face detection is a very key step for face
recognition.

Hardware face recognition

Posted Dec 1, 2011 15:58 UTC (Thu) by corbet (editor, #1) [Link]

Indeed, I should have written "detection," that was a bit sloppy. I've fixed it up, sorry for any confusion.

Hardware face recognition

Posted Dec 2, 2011 10:33 UTC (Fri) by koenkooi (subscriber, #71861) [Link]

To add to the confusion: TI does have SoCs with hardware face recognition available.

Hardware face recognition

Posted Dec 5, 2011 4:35 UTC (Mon) by ming.lei (subscriber, #74703) [Link]

Interesting, could you provide a link about the HW?

thanks,

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds